@backland/schema
Version:
TypeScript schema declaration and validation library with static type inference
33 lines (32 loc) • 723 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.NullField = void 0;
var _utils = require("@backland/utils");
var _FieldType = require("./FieldType");
class NullField extends _FieldType.FieldType {
constructor() {
super({
def: undefined,
name: 'null'
});
this.parse = this.applyParser({
parse(input) {
(0, _utils.expectedType)({
value: input
}, 'null');
return input;
},
preParse(input) {
if (input === undefined) return null;
return input;
}
});
}
static create = () => {
return new NullField();
};
}
exports.NullField = NullField;
//# sourceMappingURL=NullField.js.map