botbook/node_modules/registry-auth-token/registry-url.js
Rodrigo Rodriguez 6ae15fe3e5 Updated.
2024-09-04 13:13:15 -03:00

7 lines
333 B
JavaScript

const npmConf = require('@pnpm/npm-conf')
module.exports = function getRegistryUrl (scope, npmrc) {
const rc = npmrc ? { config: { get: (key) => npmrc[key] } } : npmConf()
const url = rc.config.get(scope + ':registry') || rc.config.get('registry') || npmConf.defaults.registry
return url.slice(-1) === '/' ? url : url + '/'
}