fix: the created fetcher should have type {tarball: FetchFunction}

This commit is contained in:
Zoltan Kochan
2018-04-21 23:07:45 +03:00
parent fc50d935bd
commit d5fff35b06
2 changed files with 4 additions and 12 deletions

View File

@@ -1,5 +1,6 @@
dependencies:
'@pnpm/fetcher-base': 1.0.0
'@pnpm/tarball-fetcher': 'link:../__package_previews__/tarball-fetcher/@pnpm/tarball-fetcher'
'@types/mem': 1.1.2
'@types/mz': 0.0.32
'@types/node': 9.6.2
@@ -1876,7 +1877,7 @@ packages:
resolution:
integrity: sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=
registry: 'https://registry.npmjs.org/'
shrinkwrapMinorVersion: 4
shrinkwrapMinorVersion: 5
shrinkwrapVersion: 3
specifiers:
'@pnpm/fetcher-base': ^1.0.0

View File

@@ -1,5 +1,6 @@
import logger from '@pnpm/logger'
import {
FetchFunction,
FetchOptions,
FetchResult,
} from '@pnpm/fetcher-base'
@@ -35,17 +36,7 @@ export default function (
ignoreFile?: IgnoreFunction,
offline?: boolean,
},
): {
tarball: (
resolution: {
integrity?: string,
registry?: string,
tarball: string,
},
target: string,
opts: FetchOptions,
) => Promise<{}>
} {
): { tarball: FetchFunction } {
const download = createDownloader({
alwaysAuth: opts.alwaysAuth || false,
registry: opts.registry,