diff options
Diffstat (limited to 'deps/npm/node_modules/pacote/lib/fetch.js')
-rw-r--r-- | deps/npm/node_modules/pacote/lib/fetch.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/deps/npm/node_modules/pacote/lib/fetch.js b/deps/npm/node_modules/pacote/lib/fetch.js index 5c45fa21df..36fb6b6d3d 100644 --- a/deps/npm/node_modules/pacote/lib/fetch.js +++ b/deps/npm/node_modules/pacote/lib/fetch.js @@ -3,13 +3,20 @@ const duck = require('protoduck') const Fetcher = duck.define(['spec', 'opts', 'manifest'], { + packument: ['spec', 'opts'], manifest: ['spec', 'opts'], tarball: ['spec', 'opts'], fromManifest: ['manifest', 'spec', 'opts'], clearMemoized () {} -}, {name: 'Fetcher'}) +}, { name: 'Fetcher' }) module.exports = Fetcher +module.exports.packument = packument +function packument (spec, opts) { + const fetcher = getFetcher(spec.type) + return fetcher.packument(spec, opts) +} + module.exports.manifest = manifest function manifest (spec, opts) { const fetcher = getFetcher(spec.type) @@ -40,6 +47,9 @@ function getFetcher (type) { // This is spelled out both to prevent sketchy stuff and to make life // easier for bundlers/preprocessors. switch (type) { + case 'alias': + fetchers[type] = require('./fetchers/alias') + break case 'directory': fetchers[type] = require('./fetchers/directory') break |