gameStatusUpdate/node_modules/ajv-keywords/dist/definitions/_util.js

19 lines
773 B
JavaScript
Raw Permalink Normal View History

2024-09-18 08:27:46 -07:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.usePattern = exports.metaSchemaRef = void 0;
const codegen_1 = require("ajv/dist/compile/codegen");
const META_SCHEMA_ID = "http://json-schema.org/schema";
function metaSchemaRef({ defaultMeta } = {}) {
return defaultMeta === false ? {} : { $ref: defaultMeta || META_SCHEMA_ID };
}
exports.metaSchemaRef = metaSchemaRef;
function usePattern({ gen, it: { opts } }, pattern, flags = opts.unicodeRegExp ? "u" : "") {
const rx = new RegExp(pattern, flags);
return gen.scopeValue("pattern", {
key: rx.toString(),
ref: rx,
code: (0, codegen_1._) `new RegExp(${pattern}, ${flags})`,
});
}
exports.usePattern = usePattern;
//# sourceMappingURL=_util.js.map