Welcome to mirror list, hosted at ThFree Co, Russian Federation.

pick-registry.js « registry « fetchers « lib « pacote « node_modules - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f326950da42d8d56df4be60ffd5a5d7284e4fb7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
}