Skip to content

Commit

Permalink
fix: Object maxProperties error message references wrong value
Browse files Browse the repository at this point in the history
  • Loading branch information
jayalfredprufrock authored Jul 18, 2023
1 parent 2e8818e commit c633b5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/errors/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ export namespace ValueErrors {
yield { type: ValueErrorType.ObjectMinProperties, schema, path, value, message: `Expected object to have at least ${schema.minProperties} properties` }
}
if (IsDefined<number>(schema.maxProperties) && !(globalThis.Object.getOwnPropertyNames(value).length <= schema.maxProperties)) {
yield { type: ValueErrorType.ObjectMaxProperties, schema, path, value, message: `Expected object to have less than ${schema.minProperties} properties` }
yield { type: ValueErrorType.ObjectMaxProperties, schema, path, value, message: `Expected object to have less than ${schema.maxProperties} properties` }
}
const requiredKeys = globalThis.Array.isArray(schema.required) ? schema.required : ([] as string[])
const knownKeys = globalThis.Object.getOwnPropertyNames(schema.properties)
Expand Down

0 comments on commit c633b5b

Please sign in to comment.