From c633b5bee44ff275ada23ea69f4badaf866c7fa9 Mon Sep 17 00:00:00 2001 From: Andrew Smiley Date: Tue, 18 Jul 2023 12:50:17 -0400 Subject: [PATCH] fix: Object maxProperties error message references wrong value --- src/errors/errors.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/errors/errors.ts b/src/errors/errors.ts index aa5fe28be..92663dcc8 100644 --- a/src/errors/errors.ts +++ b/src/errors/errors.ts @@ -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(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)