Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Commit

Permalink
fix(npa): ensure spec is a valid npa instance
Browse files Browse the repository at this point in the history
Serialized npa objects will get printed funny otherwise, and lack methods
  • Loading branch information
zkat committed Oct 18, 2017
1 parent 79ce949 commit 1757b2b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion extract.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const rimraf = BB.promisify(require('rimraf'))
module.exports = extract
function extract (spec, dest, opts) {
opts = optCheck(opts)
spec = typeof spec === 'string' ? npa(spec, opts.where) : spec
spec = npa(spec, opts.where)
const startTime = Date.now()
if (opts.integrity && opts.cache && !opts.preferOnline) {
opts.log.silly('pacote', `trying ${spec} by hash: ${opts.integrity}`)
Expand Down
2 changes: 1 addition & 1 deletion manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const npa = require('npm-package-arg')
module.exports = manifest
function manifest (spec, opts) {
opts = optCheck(opts)
spec = typeof spec === 'string' ? npa(spec, opts.where) : spec
spec = npa(spec, opts.where)

const label = [
spec.name,
Expand Down
2 changes: 1 addition & 1 deletion prefetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const npa = require('npm-package-arg')
module.exports = prefetch
function prefetch (spec, opts) {
opts = optCheck(opts)
spec = typeof spec === 'string' ? npa(spec, opts.where) : spec
spec = npa(spec, opts.where)
const startTime = Date.now()
if (!opts.cache) {
opts.log.info('prefetch', 'skipping prefetch: no cache provided')
Expand Down

0 comments on commit 1757b2b

Please sign in to comment.