Skip to content

Commit

Permalink
fix: restore multiple boolean check when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Eomm committed Aug 20, 2022
1 parent 49028cd commit df0c4fb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,13 @@ const parseArgs = (config = kEmptyObject) => {
}
}

validateBoolean(ObjectHasOwn(optionConfig, 'multiple'), `options.${longOption}.multiple`);
const multipleOption = objectGetOwn(optionConfig, 'multiple');
if (ObjectHasOwn(optionConfig, 'multiple')) {
validateBoolean(multipleOption, `options.${longOption}.multiple`);
}

if (ObjectHasOwn(optionConfig, 'defaultValue')) {
const defaultValue = objectGetOwn(optionConfig, 'defaultValue');
const multipleOption = objectGetOwn(optionConfig, 'multiple');
if (optionType === 'string' && !multipleOption) {
validateString(defaultValue, `options.${longOption}.defaultValue`);
} else if (optionType === 'string' && multipleOption) {
Expand Down

0 comments on commit df0c4fb

Please sign in to comment.