Skip to content

Commit

Permalink
exclude defaults bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SamKirkland committed Jan 31, 2022
1 parent 93a0898 commit f552793
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7984,6 +7984,9 @@ function optionalInt(argumentName, rawValue) {
}
exports.optionalInt = optionalInt;
function optionalStringArray(argumentName, rawValue) {
if (rawValue.length === 0) {
return undefined;
}
if (typeof rawValue === "string") {
throw new Error(`${argumentName}: invalid parameter - you provided "${rawValue}". This option expects an list in the EXACT format described in the readme`);
}
Expand Down
4 changes: 4 additions & 0 deletions src/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ export function optionalInt(argumentName: string, rawValue: string): number | un
}

export function optionalStringArray(argumentName: string, rawValue: string[]): string[] | undefined {
if (rawValue.length === 0) {
return undefined;
}

if (typeof rawValue === "string") {
throw new Error(`${argumentName}: invalid parameter - you provided "${rawValue}". This option expects an list in the EXACT format described in the readme`);
}
Expand Down

0 comments on commit f552793

Please sign in to comment.