Skip to content

Commit

Permalink
fix: refactoring bug of throwOnFailure option
Browse files Browse the repository at this point in the history
  • Loading branch information
tada5hi committed Jul 4, 2023
1 parent 54fb699 commit a555b2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/parameter/fields/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export function parseQueryFields<T extends ObjectLiteral = ObjectLiteral>(
}

if (!isValid) {
if (options.throwOnError) {
if (options.throwOnFailure) {
throw FieldsParseError.keyNotAllowed(fields[j]);
}

Expand Down
2 changes: 1 addition & 1 deletion src/parameter/filters/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export function parseQueryFilters<T extends ObjectLiteral = ObjectLiteral>(
for (let j = 0; j < filter.value.length; j++) {
if (options.validate(filter.key as NestedKeys<T>, filter.value[j])) {
output.push(filter.value[j]);
} else if (options.throwOnError) {
} else if (options.throwOnFailure) {
throw FiltersParseError.keyValueInvalid(fieldDetails.name);
}
}
Expand Down

0 comments on commit a555b2d

Please sign in to comment.