summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/libnpx/node_modules/yargs/lib/assign.js
blob: 7d5a3cef249693ae408e9197435bf2a523f724da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
}