hunk.code_window:       '@pnpm/logger': ^1.0.0
       resolution:
         integrity: sha512-Vm37jaOTw+oW+lO3INjwbidXucJ4By/GuHYAXOyWAjwWiuBbcIxyoC82vFNGHTC3zGcBi1PA/4DNgJ8tbaDnwQ==
     /@pnpm/package-requester/1.0.0:
       dependencies:
         '@pnpm/check-package': 1.0.0
         '@pnpm/fetcher-base': 1.0.0
         '@pnpm/pkgid-to-filename': 1.0.1
  
hunk.labels: keep keep keep replace keep keep keep keep
hunk.after_edit:   /@pnpm/package-requester/2.0.0-0:
  
hunk.file_path: shrinkwrap.yaml
hunk.type: replace
file: import mkdirp = require('mkdirp-promise')
  import fs = require('mz/fs')
  import path = require('path')
  import pathTemp = require('path-temp')
  import rimraf = require('rimraf-then')
  
  export default async function linkIndexedDir (existingDir: string, newDir: string, filenames: string[]) {
    const stage = pathTemp(path.dirname(newDir))
    try {
      await rimraf(stage)
      await tryLinkIndexedDir(existingDir, stage, filenames)
      await rimraf(newDir)
      await fs.rename(stage, newDir)
    } catch (err) {
      try { await rimraf(stage) } catch (err) {} // tslint:disable-line:no-empty
      throw err
    }
  }
  
  async function tryLinkIndexedDir (existingDir: string, newDir: string, filenames: string[]) {
    const alldirs = new Set()
    filenames
      .forEach((f) => {
        alldirs.add(path.join(newDir, path.dirname(f)))
      })
    await Promise.all(
      Array.from(alldirs).sort((d1, d2) => d1.length - d2.length).map((dir) => mkdirp(dir)),
    )
    await Promise.all(
      filenames
        .map((f: string) => fs.link(path.join(existingDir, f), path.join(newDir, f))),
    )
  }
  