hunk.code_window:       graceful-fs: 4.1.11
         mkdirp-promise: 5.0.1
         mz: 2.6.0
         rimraf-then: 1.0.1
       resolution: 109f177704943a3796ce49b0b518da8757955ac2
     /linkify-it/1.2.4:
       dependencies:
         uc.micro: 1.0.3
       resolution: 0773526c317c8fd13bd534ee1d180ff88abf881a
     /load-json-file/1.1.0:
  
hunk.labels: keep keep keep keep replace keep keep keep keep keep
hunk.after_edit:     resolution: ca8c686d6f8f75d1708b9e166c5dafb7c8ba0f04
  
hunk.file_path: shrinkwrap.yaml
hunk.type: replace
file: import loadJsonFile = require('load-json-file')
  import writePkg = require('write-pkg')
  import {DependenciesType} from './getSaveType'
  import {Package} from './types'
  import {PackageSpec} from './resolve'
  
  export default async function save (
    pkgJsonPath: string,
    packageSpecs: ({
      name: string,
      saveSpec: string,
    })[],
    saveType: DependenciesType
  ): Promise<Package> {
    // Read the latest version of package.json to avoid accidental overwriting
    const packageJson = await loadJsonFile(pkgJsonPath)
    packageJson[saveType] = packageJson[saveType] || {}
    packageSpecs.forEach(dependency => {
      packageJson[saveType][dependency.name] = dependency.saveSpec
    })
  
    await writePkg(pkgJsonPath, packageJson)
    return packageJson
  }
  