diff options
author | Ramana Venkata <vramana@users.noreply.github.com> | 2017-07-04 04:19:50 +0300 |
---|---|---|
committer | Kat Marchán <kzm@sykosomatic.org> | 2017-07-06 01:11:02 +0300 |
commit | 7d650048c8ed5faa0486492f1eeb698e7383e32f (patch) | |
tree | 8cd3136e62deb0c4c31210704c68d77c7237a922 /lib | |
parent | 9e5a943547b29c8d022192afd9398b3a136a7e5a (diff) |
config: refactor to use Object.assign (#17563)
Object.assign is available in Node >= 4
PR-URL: https://github.com/npm/npm/pull/17563
Credit: @vramana
Reviewed-By: @zkat
Diffstat (limited to 'lib')
-rw-r--r-- | lib/config/cmd-list.js | 4 | ||||
-rw-r--r-- | lib/ls.js | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/lib/config/cmd-list.js b/lib/config/cmd-list.js index b3aba7d91..f2d5fab17 100644 --- a/lib/config/cmd-list.js +++ b/lib/config/cmd-list.js @@ -1,5 +1,3 @@ -var extend = Object.assign || require('util')._extend - // short names for common things var shorthands = { 'un': 'uninstall', @@ -112,7 +110,7 @@ var plumbing = [ 'substack', 'visnup' ] -module.exports.aliases = extend(extend({}, shorthands), affordances) +module.exports.aliases = Object.assign({}, shorthands, affordances) module.exports.shorthands = shorthands module.exports.affordances = affordances module.exports.cmdList = cmdList @@ -14,7 +14,6 @@ var semver = require('semver') var color = require('ansicolors') var npa = require('npm-package-arg') var sortedObject = require('sorted-object') -var extend = Object.assign || require('util')._extend var npm = require('./npm.js') var mutateIntoLogicalTree = require('./install/mutate-into-logical-tree.js') var computeMetadata = require('./install/deps.js').computeMetadata @@ -266,7 +265,7 @@ function unloop (root) { var dep = deps[d] if (dep.missing && !dep.dependencies) return if (dep.path && seen[dep.path]) { - dep = deps[d] = extend({}, dep) + dep = deps[d] = Object.assign({}, dep) dep.dependencies = {} dep._deduped = path.relative(root.path, dep.path).replace(/node_modules\//g, '') return |