2 Object.defineProperty(exports, "__esModule", { value: true });
3 const code_1 = require("../code");
4 const codegen_1 = require("../../compile/codegen");
6 message: ({ schemaCode }) => codegen_1.str `must match pattern "${schemaCode}"`,
7 params: ({ schemaCode }) => codegen_1._ `{pattern: ${schemaCode}}`,
16 const { gen, data, $data, schema, schemaCode } = cxt;
17 const regExp = $data ? codegen_1._ `(new RegExp(${schemaCode}, "u"))` : code_1.usePattern(gen, schema); // TODO regexp should be wrapped in try/catch
18 cxt.fail$data(codegen_1._ `!${regExp}.test(${data})`);
21 exports.default = def;
22 //# sourceMappingURL=pattern.js.map