@sinclair/typebox 0.28.1 → 0.28.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiler/compiler.js +1 -1
- package/package.json +1 -1
package/compiler/compiler.js
CHANGED
|
@@ -342,7 +342,7 @@ var TypeCompiler;
|
|
|
342
342
|
yield `Object.getOwnPropertyNames(${value}).length <= ${schema.maxProperties}`;
|
|
343
343
|
const [patternKey, patternSchema] = globalThis.Object.entries(schema.patternProperties)[0];
|
|
344
344
|
const local = PushLocal(`new RegExp(/${patternKey}/)`);
|
|
345
|
-
const check1 = CreateExpression(patternSchema, references, value);
|
|
345
|
+
const check1 = CreateExpression(patternSchema, references, 'value');
|
|
346
346
|
const check2 = Types.TypeGuard.TSchema(schema.additionalProperties) ? CreateExpression(schema.additionalProperties, references, value) : schema.additionalProperties === false ? 'false' : 'true';
|
|
347
347
|
const expression = `(${local}.test(key) ? ${check1} : ${check2})`;
|
|
348
348
|
yield `(Object.entries(${value}).every(([key, value]) => ${expression}))`;
|