@sinclair/typebox
Advanced tools
@@ -345,3 +345,3 @@ "use strict"; | ||
| const [patternKey, patternSchema] = globalThis.Object.entries(schema.patternProperties)[0]; | ||
| const local = PushLocal(`new RegExp(/${patternKey}/)`); | ||
| const local = PushLocal(`${new RegExp(patternKey)}`); | ||
| const check1 = CreateExpression(patternSchema, references, 'value'); | ||
@@ -394,2 +394,4 @@ const check2 = Types.TypeGuard.TSchema(schema.additionalProperties) ? CreateExpression(schema.additionalProperties, references, value) : schema.additionalProperties === false ? 'false' : 'true'; | ||
| return yield `${value}.length === 0`; | ||
| if (!IsNumber(schema.maxItems)) | ||
| throw Error('MaxItems: Not a Number'); | ||
| yield `(${value}.length === ${schema.maxItems})`; | ||
@@ -396,0 +398,0 @@ for (let i = 0; i < schema.items.length; i++) { |
+1
-1
| { | ||
| "name": "@sinclair/typebox", | ||
| "version": "0.28.21", | ||
| "version": "0.28.22", | ||
| "description": "JSONSchema Type Builder with Static Type Resolution for TypeScript", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
462958
0.02%7603
0.03%