source: trip-planner-front/node_modules/ajv/dist/vocabularies/validation/const.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 832 bytes
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const codegen_1 = require("../../compile/codegen");
4const util_1 = require("../../compile/util");
5const equal_1 = require("../../runtime/equal");
6const error = {
7 message: "must be equal to constant",
8 params: ({ schemaCode }) => codegen_1._ `{allowedValue: ${schemaCode}}`,
9};
10const def = {
11 keyword: "const",
12 $data: true,
13 error,
14 code(cxt) {
15 const { gen, data, $data, schemaCode, schema } = cxt;
16 if ($data || (schema && typeof schema == "object")) {
17 cxt.fail$data(codegen_1._ `!${util_1.useFunc(gen, equal_1.default)}(${data}, ${schemaCode})`);
18 }
19 else {
20 cxt.fail(codegen_1._ `${schema} !== ${data}`);
21 }
22 },
23};
24exports.default = def;
25//# sourceMappingURL=const.js.map
Note: See TracBrowser for help on using the repository browser.