Skip to content

Commit

Permalink
refactor: Use Object.as#stead of custom function. (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyfarrell authored and bcoe committed May 5, 2019
1 parent 1404f79 commit c0cd851
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function parse (args, opts) {

// aliases might have transitive relationships, normalize this.
var aliases = combineAliases(opts.alias || {})
var configuration = assign({
var configuration = Object.assign({
'short-option-groups': true,
'camel-case-expansion': true,
'dot-notation': true,
Expand Down Expand Up @@ -856,20 +856,6 @@ function combineAliases (aliases) {
return combined
}

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
}

// this function should only be called when a count is given as an arg
// it is NOT called to set a default value
// thus we can start the count at 1 instead of 0
Expand Down

0 comments on commit c0cd851

Please # to comment.