source: trip-planner-front/node_modules/ajv/dist/vocabularies/jtd/error.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: 888 bytes
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.typeErrorParams = exports.typeErrorMessage = exports.typeError = void 0;
4const codegen_1 = require("../../compile/codegen");
5function typeError(t) {
6 return {
7 message: (cxt) => typeErrorMessage(cxt, t),
8 params: (cxt) => typeErrorParams(cxt, t),
9 };
10}
11exports.typeError = typeError;
12function typeErrorMessage({ parentSchema }, t) {
13 return (parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.nullable) ? `must be ${t} or null` : `must be ${t}`;
14}
15exports.typeErrorMessage = typeErrorMessage;
16function typeErrorParams({ parentSchema }, t) {
17 return codegen_1._ `{type: ${t}, nullable: ${!!(parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.nullable)}}`;
18}
19exports.typeErrorParams = typeErrorParams;
20//# sourceMappingURL=error.js.map
Note: See TracBrowser for help on using the repository browser.