exclude defaults bug fix

This commit is contained in:
SamKirkland 2022-01-31 00:44:08 -06:00
parent 93a0898871
commit f55279346a
2 changed files with 7 additions and 0 deletions

3
dist/index.js vendored
View File

@ -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`);
}

View File

@ -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`);
}