hunk.code_window:   export = anything;
   }
  
hunk.labels: keep keep add
hunk.after_edit: declare module 'link-dir' {
     const anything: any;
     export = anything;
   }
hunk.file_path: typings/local.d.ts
hunk.type: add
file: import getTarballName from './getTarballName'
  import crypto = require('crypto')
  import {PackageSpec, ResolveResult, ResolveOptions} from '.'
  import {createRemoteTarballFetcher} from './fetch'
  
  /**
   * 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 function resolveTarball (spec: PackageSpec, opts: ResolveOptions): Promise<ResolveResult> {
    const name = getTarballName(spec.rawSpec)
  
    return Promise.resolve({
      id: name + '#' + hash(spec.rawSpec),
      fetch: createRemoteTarballFetcher({
        tarball: spec.rawSpec
      }, opts)
    })
  }
  
  function hash (str: string) {
    const hash = crypto.createHash('sha1')
    hash.update(str)
    return hash.digest('hex')
  }
  