Skip to content

Commit

Permalink
fix: drop lodash.assign (#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Sep 30, 2016
1 parent 16923fe commit ad3146f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
15 changes: 15 additions & 0 deletions lib/assign.js
@@ -0,0 +1,15 @@
// lazy Object.assign logic that only works for merging
// two objects; eventually we should replace this with Object.assign.
module.exports = function assign (defaults, configuration) {
var o = {}
configuration = configuration || {}

Object.keys(defaults).forEach(function (k) {
o[k] = defaults[k]
})
Object.keys(configuration).forEach(function (k) {
o[k] = configuration[k]
})

return o
}
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -15,7 +15,6 @@
"cliui": "^3.2.0",
"decamelize": "^1.1.1",
"get-caller-file": "^1.0.1",
"lodash.assign": "^4.2.0",
"os-locale": "^1.4.0",
"read-pkg-up": "^1.0.1",
"require-directory": "^2.1.1",
Expand Down
2 changes: 1 addition & 1 deletion yargs.js
Expand Up @@ -504,7 +504,7 @@ function Yargs (processArgs, cwd, parentRequire) {
}
self.getGroups = function () {
// combine explicit and preserved groups. explicit groups should be first
return require('lodash.assign')({}, groups, preservedGroups)
return require('./lib/assign')(groups, preservedGroups)
}

// as long as options.envPrefix is not undefined,
Expand Down

0 comments on commit ad3146f

Please sign in to comment.