diff options
Diffstat (limited to 'node_modules/pacote/lib/fetchers/registry/pick-registry.js')
-rw-r--r-- | node_modules/pacote/lib/fetchers/registry/pick-registry.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/node_modules/pacote/lib/fetchers/registry/pick-registry.js b/node_modules/pacote/lib/fetchers/registry/pick-registry.js new file mode 100644 index 000000000..f326950da --- /dev/null +++ b/node_modules/pacote/lib/fetchers/registry/pick-registry.js @@ -0,0 +1,17 @@ +'use strict' + +module.exports = pickRegistry +function pickRegistry (spec, opts) { + let registry = spec.scope && opts.scopeTargets[spec.scope] + + if (!registry && opts.scope) { + const prefix = opts.scope[0] === '@' ? '' : '@' + registry = opts.scopeTargets[prefix + opts.scope] + } + + if (!registry) { + registry = opts.registry + } + + return registry +} |