UNPKG

@backland/schema

Version:

TypeScript schema declaration and validation library with static type inference

29 lines (28 loc) 726 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UndefinedField = void 0; var _utils = require("@backland/utils"); var _FieldType = require("./FieldType"); class UndefinedField extends _FieldType.FieldType { constructor() { super({ def: undefined, name: 'undefined' }); this.parse = this.applyParser({ parse: input => { if (typeof input !== 'undefined') { throw new Error(`Expected undefined, found ${(0, _utils.getTypeName)(input)}`); } return input; } }); } static create = () => { return new UndefinedField(); }; } exports.UndefinedField = UndefinedField; //# sourceMappingURL=UndefinedField.js.map