runtypes
Version:
Runtime validation for static types
11 lines (10 loc) • 323 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const Optional = Object.assign(((...args) => ({
tag: "optional",
underlying: args[0],
...(args.length === 2 ? { default: args[1] } : {}),
})), {
isOptional: (runtype) => runtype.tag === "optional",
});
exports.default = Optional;