@sinclair/typebox
Advanced tools
@@ -344,3 +344,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'); | ||
@@ -393,2 +393,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})`; | ||
@@ -395,0 +397,0 @@ for (let i = 0; i < schema.items.length; i++) { |
+1
-1
| { | ||
| "name": "@sinclair/typebox", | ||
| "version": "0.29.7", | ||
| "version": "0.29.8", | ||
| "description": "JSONSchema Type Builder with Static Type Resolution for TypeScript", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
470067
0.02%7679
0.03%