diff --git a/dist/index.js b/dist/index.js index ecc6103..67bdd70 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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`); } diff --git a/src/parse.ts b/src/parse.ts index 98f45a4..3e73658 100644 --- a/src/parse.ts +++ b/src/parse.ts @@ -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`); }