Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fleshing out parseArgs to support withValue and Multiples options #9

Merged
merged 8 commits into from
Oct 4, 2021
Prev Previous commit
Next Next commit
chore(parse-args): resolve type checking on withValue to handle false…
…,0,null,nan,'' cases
  • Loading branch information
Jessica Nahulan authored and Jessica Nahulan committed Sep 28, 2021
commit 8892a2bdc3038c5a294bf7e0ef8bf0e6795f3e5e
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const parseArgs = (
if (typeof options !== 'object' || options === null) {
throw new Error('Whoops!')
}
if(options.withValue && !Array.isArray(options.withValue)) {
if(options.withValue !== undefined && !Array.isArray(options.withValue)) {
throw new Error('Whoops! options.withValue should be an array.')
}

Expand Down