Skip to content

Commit

Permalink
fix: another edge case for input.args
Browse files Browse the repository at this point in the history
  • Loading branch information
erikburt committed Jan 25, 2024
1 parent 3dac3a5 commit 7302d3b
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/inputs/run-install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,18 @@ function isEntryValid(input: any): boolean {
return false;
}

if (input.args !== undefined && !Array.isArray(input.args)) {
error(`Invalid input for run_install.args. Expected array, but got ${typeof input.args}`)
return false;
}
if (input.args !== undefined) {
if (!Array.isArray(input.args)) {
error(`Invalid input for run_install.args. Expected array, but got ${typeof input.args}`)
return false;
}

const invalidArgs: any[] = input.args.filter((arg: any) => typeof arg !== 'string');
if (input.args !== undefined && invalidArgs.length > 0) {
const invalidArgsMessage = invalidArgs.map((arg: any) => typeof arg).join(', ');
error(`Invalid input for run_install.args. Expected array of strings, but got ${invalidArgsMessage}`)
return false;
const invalidArgs: any[] = input.args.filter((arg: any) => typeof arg !== 'string');
if (invalidArgs.length > 0) {
const invalidArgsMessage = invalidArgs.map((arg: any) => typeof arg).join(', ');
error(`Invalid input for run_install.args. Expected array of strings, but got ${invalidArgsMessage}`)
return false;
}
}

return true;
Expand Down

0 comments on commit 7302d3b

Please sign in to comment.