Skip to content

Commit

Permalink
fix(api): pacote integration-related fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Apr 9, 2018
1 parent 2e5113a commit a29de4f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,5 @@ const RegFetchConfig = pudding({
module.exports = config
function config (opts) {
opts = opts || {}
return RegFetchConfig(opts, opts.config)
return RegFetchConfig(opts, 'config' in opts && opts.config)
}
8 changes: 1 addition & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@ const getAuth = require('./auth.js')
const fetch = require('make-fetch-happen')
const npa = require('npm-package-arg')
const qs = require('querystring')
const silentLog = require('./silentlog.js')
const url = require('url')

module.exports = regFetch
function regFetch (uri, opts) {
opts = config(Object.assign({
log: silentLog
}, opts))
opts = config(opts)
const registry = (
(opts.get('spec') && pickRegistry(opts.get('spec'), opts)) ||
opts.get('registry') ||
Expand Down Expand Up @@ -97,9 +94,6 @@ module.exports.pickRegistry = pickRegistry
function pickRegistry (spec, opts) {
spec = npa(spec)
opts = config(opts)
if (!spec.registry) {
throw new Error(`${spec} is not a valid registry dependency spec`)
}
let registry = spec.scope &&
opts.get(spec.scope.replace(/^@?/, '@') + ':registry')

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"license": "ISC",
"dependencies": {
"bluebird": "^3.5.1",
"figgy-pudding": "^3.0.0",
"figgy-pudding": "^3.1.0",
"lru-cache": "^4.1.2",
"make-fetch-happen": "^3.0.0",
"npm-package-arg": "^6.0.0",
Expand Down

0 comments on commit a29de4f

Please sign in to comment.