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