@sinclair/typebox 0.25.16 → 0.25.17
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
|
@@ -272,7 +272,7 @@ var TypeCompiler;
|
|
|
272
272
|
if (IsNumber(schema.maxLength))
|
|
273
273
|
yield `(${value}.length <= ${schema.maxLength})`;
|
|
274
274
|
if (schema.pattern !== undefined) {
|
|
275
|
-
const local = PushLocal(
|
|
275
|
+
const local = PushLocal(`${new RegExp(schema.pattern)};`);
|
|
276
276
|
yield `(${local}.test(${value}))`;
|
|
277
277
|
}
|
|
278
278
|
if (schema.format !== undefined) {
|