hunk.code_window:     dependencies: ResolvedDependencies,
     },
   }
   export type DependencyShrinkwrap = string | {
     dev?: true,
     optional?: true,
     resolution: string | Resolution,
     dependencies?: ResolvedDependencies,
   }
  
hunk.labels: keep keep keep keep add keep keep keep keep keep
hunk.after_edit:   id?: string,
  
hunk.file_path: src/fs/shrinkwrap.ts
hunk.type: add
file: import pLimit = require('p-limit')
  
  type CachedPromises<T> = {
    [name: string]: Promise<T>
  }
  
  export type MemoizedFunc<T> = (key: string, fn: () => Promise<T>) => Promise<T>
  
  /**
   * Save promises for later
   */
  export default function memoize <T>(concurrency?: number): MemoizedFunc<T> {
    const locks: CachedPromises<T> = {}
    const limit = concurrency && pLimit(concurrency)
  
    return function (key: string, fn: () => Promise<T>): Promise<T> {
      if (locks[key]) return locks[key]
      locks[key] = limit && limit(fn) || fn()
      return locks[key]
    }
  }
  