@httpc/kit
Version:
httpc toolbox for building function-based API with minimal code and end-to-end type safety
21 lines (20 loc) • 683 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isOptionalSchema = exports.OptionalSchema = exports.isClass = void 0;
function isClass(func) {
return typeof func === "function" && func.prototype && !Object.getOwnPropertyDescriptor(func, "prototype")?.writable || false;
}
exports.isClass = isClass;
function OptionalSchema(schema) {
return new Optional(schema);
}
exports.OptionalSchema = OptionalSchema;
class Optional {
constructor(schema) {
this.schema = schema;
}
}
function isOptionalSchema(schema) {
return schema && schema instanceof Optional;
}
exports.isOptionalSchema = isOptionalSchema;