Skip to content

Commit

Permalink
fix: address bugs with "uknown-options-as-args"
Browse files Browse the repository at this point in the history
  • Loading branch information
mleguen committed Feb 9, 2020
1 parent 4317f00 commit bc023e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Expand Up @@ -762,11 +762,11 @@ function parse (args, opts) {
}

function hasAnyFlag (key) {
// XXX Switch to [].concat(...Object.values(flags)) once node.js 6 is dropped
var toCheck = [].concat(...Object.keys(flags).map(k => flags[k]))
// XXX Switch to [].concat(Object.values(flags)) once node.js 6 is dropped
var toCheck = [].concat(Object.keys(flags).map(k => flags[k]))

return toCheck.some(function (flag) {
return flag[key]
return Array.isArray(flag) ? flag.includes(key) : flag.hasOwnProperty(key) && flag[key]
})
}

Expand Down

0 comments on commit bc023e3

Please sign in to comment.