main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
773 bytes
|
Rev | Line | |
---|
[79a0317] | 1 | "use strict";
|
---|
| 2 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
| 3 | exports.usePattern = exports.metaSchemaRef = void 0;
|
---|
| 4 | const codegen_1 = require("ajv/dist/compile/codegen");
|
---|
| 5 | const META_SCHEMA_ID = "http://json-schema.org/schema";
|
---|
| 6 | function metaSchemaRef({ defaultMeta } = {}) {
|
---|
| 7 | return defaultMeta === false ? {} : { $ref: defaultMeta || META_SCHEMA_ID };
|
---|
| 8 | }
|
---|
| 9 | exports.metaSchemaRef = metaSchemaRef;
|
---|
| 10 | function usePattern({ gen, it: { opts } }, pattern, flags = opts.unicodeRegExp ? "u" : "") {
|
---|
| 11 | const rx = new RegExp(pattern, flags);
|
---|
| 12 | return gen.scopeValue("pattern", {
|
---|
| 13 | key: rx.toString(),
|
---|
| 14 | ref: rx,
|
---|
| 15 | code: (0, codegen_1._) `new RegExp(${pattern}, ${flags})`,
|
---|
| 16 | });
|
---|
| 17 | }
|
---|
| 18 | exports.usePattern = usePattern;
|
---|
| 19 | //# sourceMappingURL=_util.js.map |
---|
Note:
See
TracBrowser
for help on using the repository browser.