hunk.code_window:   /pkginfo/0.4.1:
       resolution:
         integrity: sha1-tUGO8EOd5UJfxJlQQtztFPsqhP8=
     /pnpm-registry-mock/1.7.0:
       dependencies:
         cpr: 2.2.0
         rimraf: 2.6.2
         verdaccio: 2.4.0
  
hunk.labels: keep keep keep replace keep keep keep keep
hunk.after_edit:   /pnpm-registry-mock/1.8.0:
  
hunk.file_path: test/shrinkwrap.yaml
hunk.type: replace
file: import path = require('path')
  import pFilter = require('p-filter')
  import {PnpmOptions} from '../types'
  import extendOptions from './extendOptions'
  import getContext from './getContext'
  import {pkgIsUntouched as untouched} from 'package-store'
  import * as dp from 'dependency-path'
  import {streamParser} from 'pnpm-logger'
  
  export default async function (maybeOpts: PnpmOptions) {
    const reporter = maybeOpts && maybeOpts.reporter
    if (reporter) {
      streamParser.on('data', reporter)
    }
    const opts = await extendOptions(maybeOpts)
    const ctx = await getContext(opts)
    if (!ctx.shrinkwrap) return []
  
    const pkgPaths = Object.keys(ctx.shrinkwrap.packages || {})
      .map(id => {
        if (id === '/') return null
        return dp.resolve(ctx.shrinkwrap.registry, id)
      })
      .filter(pkgId => pkgId && !ctx.skipped.has(pkgId))
      .map((pkgPath: string) => path.join(ctx.storePath, pkgPath))
  
    const modified = await pFilter(pkgPaths, async (pkgPath: string) => !await untouched(path.join(pkgPath, 'package')))
  
    if (reporter) {
      streamParser.removeListener('data', reporter)
    }
  
    return modified
  }
  