Skip to content

Commit

Permalink
Fix --verbose argument sanitation
Browse files Browse the repository at this point in the history
  • Loading branch information
kelson42 committed Mar 26, 2023
1 parent 30e669c commit 915c1f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sanitize-argument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function sanitize_all(argv: any) {
sanitize_articlesList_addNamespaces(articleList, addNamespaces)

// sanitizing verbose
sanitize_verbose(verbose)
sanitize_verbose(verbose[0], verbose[1]);

// sanitizing speed
sanitize_speed(_speed)
Expand Down Expand Up @@ -87,8 +87,8 @@ export function sanitizeStringMaxLength(text: string, key: string, length: numbe
}
}

export function sanitize_verbose(verbose: logger.LogLevel | true) {
if (verbose && verbose !== true && !logger.logLevels.includes(verbose)) {
export function sanitize_verbose(verbose: boolean=false, log_level: any) {
if (verbose && log_level != true && !logger.logLevels.includes(log_level)) {
throw new Error('verbose should be empty or one of [info, log, warn, error, quiet].')
}
}
Expand Down

0 comments on commit 915c1f2

Please sign in to comment.