Skip to content

Commit

Permalink
fix: bug in object.noUnknown for nullish values #854 (#855)
Browse files Browse the repository at this point in the history
  • Loading branch information
icflorescu authored Apr 24, 2020
1 parent 16efe88 commit ccb7c7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ inherits(ObjectSchema, MixedSchema, {
exclusive: true,
message: message,
test(value) {
if (value == null) return true;
const unknownKeys = unknown(this.schema, value);
return (
value == null ||
!noAllow ||
unknownKeys.length === 0 ||
this.createError({ params: { unknown: unknownKeys.join(', ') } })
Expand Down

0 comments on commit ccb7c7d

Please sign in to comment.