diff options
Diffstat (limited to 'lib/outdated.js')
-rw-r--r-- | lib/outdated.js | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/lib/outdated.js b/lib/outdated.js index abce6cd29..b16eba0a7 100644 --- a/lib/outdated.js +++ b/lib/outdated.js @@ -34,8 +34,6 @@ const pickManifest = require('npm-pick-manifest') const fetchPackageMetadata = require('./fetch-package-metadata.js') const mutateIntoLogicalTree = require('./install/mutate-into-logical-tree.js') const npm = require('./npm.js') -const npmConfig = require('./config/figgy-config.js') -const figgyPudding = require('figgy-pudding') const { packument } = require('pacote') const long = npm.config.get('long') const isExtraneous = require('./install/is-extraneous.js') @@ -45,26 +43,9 @@ const moduleName = require('./utils/module-name.js') const output = require('./utils/output.js') const ansiTrim = require('./utils/ansi-trim') -const OutdatedConfig = figgyPudding({ - also: {}, - color: {}, - depth: {}, - dev: 'development', - development: {}, - global: {}, - json: {}, - only: {}, - parseable: {}, - prod: 'production', - production: {}, - save: {}, - 'save-dev': {}, - 'save-optional': {} -}) - function uniq (list) { - // we maintain the array because we need an array, not iterator, return - // value. + // we maintain the array because we need an array, + // not iterator, return value var uniqed = [] var seen = new Set() list.forEach(function (item) { @@ -87,11 +68,11 @@ function outdated (args, silent, cb) { cb = silent silent = false } - let opts = OutdatedConfig(npmConfig()) + let opts = npm.flatOptions var dir = path.resolve(npm.dir, '..') // default depth for `outdated` is 0 (cf. `ls`) - if (opts.depth === Infinity) opts = opts.concat({depth: 0}) + if (opts.depth === Infinity) opts = { ...opts, depth: 0 } readPackageTree(dir, andComputeMetadata(function (er, tree) { if (!tree) return cb(er) @@ -372,9 +353,11 @@ function shouldUpdate (args, tree, dep, has, req, depth, pkgpath, opts, cb, type } else if (parsed.type === 'remote') { return doIt('remote', 'remote') } else { - return packument(parsed, opts.concat({ + return packument(parsed, { + ...opts, 'prefer-online': true - })).nodeify(updateDeps) + }) + .then(() => updateDeps()) } function doIt (wanted, latest) { |