Skip to content

Commit

Permalink
fix: Dont run criteria if never flag is set.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Sep 21, 2021
1 parent ac456bc commit 822f8da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion optimal/src/createSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ function validate<T>(
validators.forEach((test) => {
if (
(test.skipIfNull && value === null) ||
(test.skipIfOptional && !state.required && value === state.defaultValue)
(test.skipIfOptional && !state.required && value === state.defaultValue) ||
state.never
) {
return;
}
Expand Down

0 comments on commit 822f8da

Please sign in to comment.