diff options
Diffstat (limited to 'deps/npm/lib/config')
-rw-r--r-- | deps/npm/lib/config/defaults.js | 23 | ||||
-rw-r--r-- | deps/npm/lib/config/get-credentials-by-uri.js | 6 | ||||
-rw-r--r-- | deps/npm/lib/config/pacote.js | 2 |
3 files changed, 16 insertions, 15 deletions
diff --git a/deps/npm/lib/config/defaults.js b/deps/npm/lib/config/defaults.js index 46eb6ca511..991a2129f6 100644 --- a/deps/npm/lib/config/defaults.js +++ b/deps/npm/lib/config/defaults.js @@ -110,6 +110,7 @@ Object.defineProperty(exports, 'defaults', {get: function () { 'always-auth': false, also: null, audit: true, + 'audit-level': 'low', 'auth-type': 'legacy', 'bin-links': true, @@ -190,11 +191,12 @@ Object.defineProperty(exports, 'defaults', {get: function () { 'prefer-offline': false, 'prefer-online': false, prefix: globalPrefix, + preid: '', production: process.env.NODE_ENV === 'production', 'progress': !process.env.TRAVIS && !process.env.CI, proxy: null, 'https-proxy': null, - 'no-proxy': null, + 'noproxy': null, 'user-agent': 'npm/{npm-version} ' + 'node/{node-version} ' + '{platform} ' + @@ -256,6 +258,7 @@ exports.types = { 'always-auth': Boolean, also: [null, 'dev', 'development'], audit: Boolean, + 'audit-level': ['low', 'moderate', 'high', 'critical'], 'auth-type': ['legacy', 'sso', 'saml', 'oauth'], 'bin-links': Boolean, browser: [null, String], @@ -305,8 +308,6 @@ exports.types = { key: [null, String], 'legacy-bundling': Boolean, link: Boolean, - // local-address must be listed as an IP for a local network interface - // must be IPv4 due to node bug 'local-address': getLocalAddresses(), loglevel: ['silent', 'error', 'warn', 'notice', 'http', 'timing', 'info', 'verbose', 'silly'], logstream: Stream, @@ -317,7 +318,7 @@ exports.types = { 'metrics-registry': [null, String], 'node-options': [null, String], 'node-version': [null, semver], - 'no-proxy': [null, String, Array], + 'noproxy': [null, String, Array], offline: Boolean, 'onload-script': [null, String], only: [null, 'dev', 'development', 'prod', 'production'], @@ -329,6 +330,7 @@ exports.types = { 'prefer-offline': Boolean, 'prefer-online': Boolean, prefix: path, + preid: String, production: Boolean, progress: Boolean, proxy: [null, false, url], // allow proxy to be disabled explicitly @@ -386,16 +388,9 @@ function getLocalAddresses () { interfaces = {} } - return Object.keys(interfaces).map(function (nic) { - return interfaces[nic].filter(function (addr) { - return addr.family === 'IPv4' - }) - .map(function (addr) { - return addr.address - }) - }).reduce(function (curr, next) { - return curr.concat(next) - }, []).concat(undefined) + return Object.keys(interfaces).map( + nic => interfaces[nic].map(({address}) => address) + ).reduce((curr, next) => curr.concat(next), []).concat(undefined) } exports.shorthands = { diff --git a/deps/npm/lib/config/get-credentials-by-uri.js b/deps/npm/lib/config/get-credentials-by-uri.js index 5e672696b2..21926c6865 100644 --- a/deps/npm/lib/config/get-credentials-by-uri.js +++ b/deps/npm/lib/config/get-credentials-by-uri.js @@ -34,6 +34,12 @@ function getCredentialsByURI (uri) { return c } + if (this.get(nerfed + ':-authtoken')) { + c.token = this.get(nerfed + ':-authtoken') + // the bearer token is enough, don't confuse things + return c + } + // Handle the old-style _auth=<base64> style for the default // registry, if set. var authDef = this.get('_auth') diff --git a/deps/npm/lib/config/pacote.js b/deps/npm/lib/config/pacote.js index b9c651d883..505b69da37 100644 --- a/deps/npm/lib/config/pacote.js +++ b/deps/npm/lib/config/pacote.js @@ -38,7 +38,7 @@ function pacoteOpts (moreOpts) { preferOnline: npm.config.get('prefer-online') || npm.config.get('cache-max') <= 0, projectScope: npm.projectScope, proxy: npm.config.get('https-proxy') || npm.config.get('proxy'), - noProxy: npm.config.get('no-proxy'), + noProxy: npm.config.get('noproxy'), refer: npm.registry.refer, registry: npm.config.get('registry'), retry: { |