hunk.code_window:     if (err.code === 'ENOENT') return true
       logger.warn(`Moving ${depName} that was installed by a different package manager to "node_modules/.ignored`)
       const ignoredDir = path.join(modules, '.ignored')
       await mkdirp(ignoredDir)
       await fs.rename(
         path.join(modules, depName),
  
hunk.labels: keep keep keep replace replace keep keep
hunk.after_edit:     const ignoredDir = path.join(modules, '.ignored', depName)
       await mkdirp(path.dirname(ignoredDir))
  
hunk.file_path: src/safeIsInnerLink.ts
hunk.type: replace
file: import {PackageSpec, ResolveOptions, TarballResolution, ResolveResult} from '.'
  import parseNpmTarballUrl from 'parse-npm-tarball-url'
  
  /**
   * Resolves a 'remote' package.
   *
   * @example
   *     pkg = {
   *       raw: 'http://registry.npmjs.org/is-array/-/is-array-1.0.1.tgz',
   *       scope: null,
   *       name: null,
   *       rawSpec: 'http://registry.npmjs.org/is-array/-/is-array-1.0.1.tgz',
   *       spec: 'http://registry.npmjs.org/is-array/-/is-array-1.0.1.tgz',
   *       type: 'remote' }
   *     resolveTarball(pkg)
   */
  export default async function resolveTarball (spec: PackageSpec, opts: ResolveOptions): Promise<ResolveResult> {
    const resolution: TarballResolution = {
      tarball: spec.rawSpec,
    }
  
    if (spec.rawSpec.startsWith('http://registry.npmjs.org/')) {
      const parsed = parseNpmTarballUrl(spec.rawSpec)
      if (parsed) {
        return {
          id: `${parsed.host}/${parsed.pkg.name}/${parsed.pkg.version}`,
          resolution,
        }
      }
    }
  
    return {
      id: spec.rawSpec
        .replace(/^.*:\/\/(git@)?/, '')
        .replace(/\.tgz$/, ''),
      resolution,
    }
  }
  