feat(planning): grille hebdomadaire complète avec API et filtres
- Connexion API via proxy Angular (résolution CORS, base path /api) - Import CSS ng-zorro global pour les modales et composants - Filtres Camion/Show câblés sur l'affichage de la grille - Camions affichés via TrucksService (linkés au show du même créneau) - Panneau de détails : spectacles + camions du jour sélectionné - Modale de création de spectacle stylisée avec fond et centrage - Positionnement précis des events à la minute dans leur créneau - Auto-scroll vers l'heure courante au chargement - Ligne "maintenant" sur la colonne du jour actuel - Régénération des services OpenAPI (nouveaux noms de types) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -26,7 +26,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.coerce = exports.ZodMiniISODuration = exports.ZodMiniISOTime = exports.ZodMiniISODate = exports.ZodMiniISODateTime = exports.iso = exports.locales = exports.NEVER = exports.util = exports.TimePrecision = exports.toJSONSchema = exports.flattenError = exports.formatError = exports.prettifyError = exports.treeifyError = exports.regexes = exports.clone = exports.$brand = exports.$input = exports.$output = exports.config = exports.registry = exports.globalRegistry = exports.core = void 0;
|
||||
exports.coerce = exports.ZodMiniISODuration = exports.ZodMiniISOTime = exports.ZodMiniISODate = exports.ZodMiniISODateTime = exports.iso = exports.locales = exports.NEVER = exports.TimePrecision = exports.toJSONSchema = exports.flattenError = exports.formatError = exports.prettifyError = exports.treeifyError = exports.regexes = exports.clone = exports.function = exports.$brand = exports.$input = exports.$output = exports.config = exports.registry = exports.globalRegistry = exports.core = void 0;
|
||||
exports.core = __importStar(require("../core/index.cjs"));
|
||||
__exportStar(require("./parse.cjs"), exports);
|
||||
__exportStar(require("./schemas.cjs"), exports);
|
||||
@@ -38,6 +38,7 @@ Object.defineProperty(exports, "config", { enumerable: true, get: function () {
|
||||
Object.defineProperty(exports, "$output", { enumerable: true, get: function () { return index_js_1.$output; } });
|
||||
Object.defineProperty(exports, "$input", { enumerable: true, get: function () { return index_js_1.$input; } });
|
||||
Object.defineProperty(exports, "$brand", { enumerable: true, get: function () { return index_js_1.$brand; } });
|
||||
Object.defineProperty(exports, "function", { enumerable: true, get: function () { return index_js_1.function; } });
|
||||
Object.defineProperty(exports, "clone", { enumerable: true, get: function () { return index_js_1.clone; } });
|
||||
Object.defineProperty(exports, "regexes", { enumerable: true, get: function () { return index_js_1.regexes; } });
|
||||
Object.defineProperty(exports, "treeifyError", { enumerable: true, get: function () { return index_js_1.treeifyError; } });
|
||||
@@ -46,7 +47,6 @@ Object.defineProperty(exports, "formatError", { enumerable: true, get: function
|
||||
Object.defineProperty(exports, "flattenError", { enumerable: true, get: function () { return index_js_1.flattenError; } });
|
||||
Object.defineProperty(exports, "toJSONSchema", { enumerable: true, get: function () { return index_js_1.toJSONSchema; } });
|
||||
Object.defineProperty(exports, "TimePrecision", { enumerable: true, get: function () { return index_js_1.TimePrecision; } });
|
||||
Object.defineProperty(exports, "util", { enumerable: true, get: function () { return index_js_1.util; } });
|
||||
Object.defineProperty(exports, "NEVER", { enumerable: true, get: function () { return index_js_1.NEVER; } });
|
||||
exports.locales = __importStar(require("../locales/index.cjs"));
|
||||
/** A special constant with type `never` */
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ export * from "./parse.cjs";
|
||||
export * from "./schemas.cjs";
|
||||
export * from "./checks.cjs";
|
||||
export type { infer, output, input } from "../core/index.cjs";
|
||||
export { globalRegistry, registry, config, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, toJSONSchema, TimePrecision, util, NEVER, } from "../core/index.cjs";
|
||||
export { globalRegistry, registry, config, $output, $input, $brand, function, clone, regexes, treeifyError, prettifyError, formatError, flattenError, toJSONSchema, TimePrecision, NEVER, } from "../core/index.cjs";
|
||||
export * as locales from "../locales/index.cjs";
|
||||
/** A special constant with type `never` */
|
||||
export * as iso from "./iso.cjs";
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ export * from "./parse.js";
|
||||
export * from "./schemas.js";
|
||||
export * from "./checks.js";
|
||||
export type { infer, output, input } from "../core/index.js";
|
||||
export { globalRegistry, registry, config, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, toJSONSchema, TimePrecision, util, NEVER, } from "../core/index.js";
|
||||
export { globalRegistry, registry, config, $output, $input, $brand, function, clone, regexes, treeifyError, prettifyError, formatError, flattenError, toJSONSchema, TimePrecision, NEVER, } from "../core/index.js";
|
||||
export * as locales from "../locales/index.js";
|
||||
/** A special constant with type `never` */
|
||||
export * as iso from "./iso.js";
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ export * as core from "../core/index.js";
|
||||
export * from "./parse.js";
|
||||
export * from "./schemas.js";
|
||||
export * from "./checks.js";
|
||||
export { globalRegistry, registry, config, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, toJSONSchema, TimePrecision, util, NEVER, } from "../core/index.js";
|
||||
export { globalRegistry, registry, config, $output, $input, $brand, function, clone, regexes, treeifyError, prettifyError, formatError, flattenError, toJSONSchema, TimePrecision, NEVER, } from "../core/index.js";
|
||||
export * as locales from "../locales/index.js";
|
||||
/** A special constant with type `never` */
|
||||
// export const NEVER = {} as never;
|
||||
|
||||
+4
-4
@@ -30,28 +30,28 @@ exports.time = time;
|
||||
exports.duration = duration;
|
||||
const core = __importStar(require("../core/index.cjs"));
|
||||
const schemas = __importStar(require("./schemas.cjs"));
|
||||
exports.ZodMiniISODateTime = core.$constructor("ZodMiniISODateTime", (inst, def) => {
|
||||
exports.ZodMiniISODateTime = core.$constructor("$ZodISODateTime", (inst, def) => {
|
||||
core.$ZodISODateTime.init(inst, def);
|
||||
schemas.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function datetime(params) {
|
||||
return core._isoDateTime(exports.ZodMiniISODateTime, params);
|
||||
}
|
||||
exports.ZodMiniISODate = core.$constructor("ZodMiniISODate", (inst, def) => {
|
||||
exports.ZodMiniISODate = core.$constructor("$ZodISODate", (inst, def) => {
|
||||
core.$ZodISODate.init(inst, def);
|
||||
schemas.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function date(params) {
|
||||
return core._isoDate(exports.ZodMiniISODate, params);
|
||||
}
|
||||
exports.ZodMiniISOTime = core.$constructor("ZodMiniISOTime", (inst, def) => {
|
||||
exports.ZodMiniISOTime = core.$constructor("$ZodISOTime", (inst, def) => {
|
||||
core.$ZodISOTime.init(inst, def);
|
||||
schemas.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function time(params) {
|
||||
return core._isoTime(exports.ZodMiniISOTime, params);
|
||||
}
|
||||
exports.ZodMiniISODuration = core.$constructor("ZodMiniISODuration", (inst, def) => {
|
||||
exports.ZodMiniISODuration = core.$constructor("$ZodISODuration", (inst, def) => {
|
||||
core.$ZodISODuration.init(inst, def);
|
||||
schemas.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
|
||||
+4
-4
@@ -1,27 +1,27 @@
|
||||
import * as core from "../core/index.js";
|
||||
import * as schemas from "./schemas.js";
|
||||
export const ZodMiniISODateTime = /*@__PURE__*/ core.$constructor("ZodMiniISODateTime", (inst, def) => {
|
||||
export const ZodMiniISODateTime = /*@__PURE__*/ core.$constructor("$ZodISODateTime", (inst, def) => {
|
||||
core.$ZodISODateTime.init(inst, def);
|
||||
schemas.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function datetime(params) {
|
||||
return core._isoDateTime(ZodMiniISODateTime, params);
|
||||
}
|
||||
export const ZodMiniISODate = /*@__PURE__*/ core.$constructor("ZodMiniISODate", (inst, def) => {
|
||||
export const ZodMiniISODate = /*@__PURE__*/ core.$constructor("$ZodISODate", (inst, def) => {
|
||||
core.$ZodISODate.init(inst, def);
|
||||
schemas.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function date(params) {
|
||||
return core._isoDate(ZodMiniISODate, params);
|
||||
}
|
||||
export const ZodMiniISOTime = /*@__PURE__*/ core.$constructor("ZodMiniISOTime", (inst, def) => {
|
||||
export const ZodMiniISOTime = /*@__PURE__*/ core.$constructor("$ZodISOTime", (inst, def) => {
|
||||
core.$ZodISOTime.init(inst, def);
|
||||
schemas.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function time(params) {
|
||||
return core._isoTime(ZodMiniISOTime, params);
|
||||
}
|
||||
export const ZodMiniISODuration = /*@__PURE__*/ core.$constructor("ZodMiniISODuration", (inst, def) => {
|
||||
export const ZodMiniISODuration = /*@__PURE__*/ core.$constructor("$ZodISODuration", (inst, def) => {
|
||||
core.$ZodISODuration.init(inst, def);
|
||||
schemas.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
|
||||
+1
-9
@@ -1,16 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.safeDecodeAsync = exports.safeEncodeAsync = exports.safeDecode = exports.safeEncode = exports.decodeAsync = exports.encodeAsync = exports.decode = exports.encode = exports.safeParseAsync = exports.parseAsync = exports.safeParse = exports.parse = void 0;
|
||||
exports.safeParseAsync = exports.parseAsync = exports.safeParse = exports.parse = void 0;
|
||||
var index_js_1 = require("../core/index.cjs");
|
||||
Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return index_js_1.parse; } });
|
||||
Object.defineProperty(exports, "safeParse", { enumerable: true, get: function () { return index_js_1.safeParse; } });
|
||||
Object.defineProperty(exports, "parseAsync", { enumerable: true, get: function () { return index_js_1.parseAsync; } });
|
||||
Object.defineProperty(exports, "safeParseAsync", { enumerable: true, get: function () { return index_js_1.safeParseAsync; } });
|
||||
Object.defineProperty(exports, "encode", { enumerable: true, get: function () { return index_js_1.encode; } });
|
||||
Object.defineProperty(exports, "decode", { enumerable: true, get: function () { return index_js_1.decode; } });
|
||||
Object.defineProperty(exports, "encodeAsync", { enumerable: true, get: function () { return index_js_1.encodeAsync; } });
|
||||
Object.defineProperty(exports, "decodeAsync", { enumerable: true, get: function () { return index_js_1.decodeAsync; } });
|
||||
Object.defineProperty(exports, "safeEncode", { enumerable: true, get: function () { return index_js_1.safeEncode; } });
|
||||
Object.defineProperty(exports, "safeDecode", { enumerable: true, get: function () { return index_js_1.safeDecode; } });
|
||||
Object.defineProperty(exports, "safeEncodeAsync", { enumerable: true, get: function () { return index_js_1.safeEncodeAsync; } });
|
||||
Object.defineProperty(exports, "safeDecodeAsync", { enumerable: true, get: function () { return index_js_1.safeDecodeAsync; } });
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
export { parse, safeParse, parseAsync, safeParseAsync, encode, decode, encodeAsync, decodeAsync, safeEncode, safeDecode, safeEncodeAsync, safeDecodeAsync, } from "../core/index.cjs";
|
||||
export { parse, safeParse, parseAsync, safeParseAsync } from "../core/index.cjs";
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
export { parse, safeParse, parseAsync, safeParseAsync, encode, decode, encodeAsync, decodeAsync, safeEncode, safeDecode, safeEncodeAsync, safeDecodeAsync, } from "../core/index.js";
|
||||
export { parse, safeParse, parseAsync, safeParseAsync } from "../core/index.js";
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
export { parse, safeParse, parseAsync, safeParseAsync, encode, decode, encodeAsync, decodeAsync, safeEncode, safeDecode, safeEncodeAsync, safeDecodeAsync, } from "../core/index.js";
|
||||
export { parse, safeParse, parseAsync, safeParseAsync } from "../core/index.js";
|
||||
|
||||
+25
-89
@@ -23,8 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ZodMiniTransform = exports.ZodMiniFile = exports.ZodMiniLiteral = exports.ZodMiniEnum = exports.ZodMiniSet = exports.ZodMiniMap = exports.ZodMiniRecord = exports.ZodMiniTuple = exports.ZodMiniIntersection = exports.ZodMiniDiscriminatedUnion = exports.ZodMiniUnion = exports.ZodMiniObject = exports.ZodMiniArray = exports.ZodMiniDate = exports.ZodMiniVoid = exports.ZodMiniNever = exports.ZodMiniUnknown = exports.ZodMiniAny = exports.ZodMiniNull = exports.ZodMiniUndefined = exports.ZodMiniSymbol = exports.ZodMiniBigIntFormat = exports.ZodMiniBigInt = exports.ZodMiniBoolean = exports.ZodMiniNumberFormat = exports.ZodMiniNumber = exports.ZodMiniCustomStringFormat = exports.ZodMiniJWT = exports.ZodMiniE164 = exports.ZodMiniBase64URL = exports.ZodMiniBase64 = exports.ZodMiniMAC = exports.ZodMiniCIDRv6 = exports.ZodMiniCIDRv4 = exports.ZodMiniIPv6 = exports.ZodMiniIPv4 = exports.ZodMiniKSUID = exports.ZodMiniXID = exports.ZodMiniULID = exports.ZodMiniCUID2 = exports.ZodMiniCUID = exports.ZodMiniNanoID = exports.ZodMiniEmoji = exports.ZodMiniURL = exports.ZodMiniUUID = exports.ZodMiniGUID = exports.ZodMiniEmail = exports.ZodMiniStringFormat = exports.ZodMiniString = exports.ZodMiniType = void 0;
|
||||
exports.ZodMiniFunction = exports.stringbool = exports.meta = exports.describe = exports.ZodMiniCustom = exports.ZodMiniPromise = exports.ZodMiniLazy = exports.ZodMiniTemplateLiteral = exports.ZodMiniReadonly = exports.ZodMiniCodec = exports.ZodMiniPipe = exports.ZodMiniNaN = exports.ZodMiniCatch = exports.ZodMiniSuccess = exports.ZodMiniNonOptional = exports.ZodMiniPrefault = exports.ZodMiniDefault = exports.ZodMiniNullable = exports.ZodMiniOptional = void 0;
|
||||
exports.ZodMiniOptional = exports.ZodMiniTransform = exports.ZodMiniFile = exports.ZodMiniLiteral = exports.ZodMiniEnum = exports.ZodMiniSet = exports.ZodMiniMap = exports.ZodMiniRecord = exports.ZodMiniTuple = exports.ZodMiniIntersection = exports.ZodMiniDiscriminatedUnion = exports.ZodMiniUnion = exports.ZodMiniObject = exports.ZodMiniArray = exports.ZodMiniDate = exports.ZodMiniVoid = exports.ZodMiniNever = exports.ZodMiniUnknown = exports.ZodMiniAny = exports.ZodMiniNull = exports.ZodMiniUndefined = exports.ZodMiniSymbol = exports.ZodMiniBigIntFormat = exports.ZodMiniBigInt = exports.ZodMiniBoolean = exports.ZodMiniNumberFormat = exports.ZodMiniNumber = exports.ZodMiniCustomStringFormat = exports.ZodMiniJWT = exports.ZodMiniE164 = exports.ZodMiniBase64URL = exports.ZodMiniBase64 = exports.ZodMiniCIDRv6 = exports.ZodMiniCIDRv4 = exports.ZodMiniIPv6 = exports.ZodMiniIPv4 = exports.ZodMiniKSUID = exports.ZodMiniXID = exports.ZodMiniULID = exports.ZodMiniCUID2 = exports.ZodMiniCUID = exports.ZodMiniNanoID = exports.ZodMiniEmoji = exports.ZodMiniURL = exports.ZodMiniUUID = exports.ZodMiniGUID = exports.ZodMiniEmail = exports.ZodMiniStringFormat = exports.ZodMiniString = exports.ZodMiniType = void 0;
|
||||
exports.stringbool = exports.ZodMiniCustom = exports.ZodMiniPromise = exports.ZodMiniLazy = exports.ZodMiniTemplateLiteral = exports.ZodMiniReadonly = exports.ZodMiniPipe = exports.ZodMiniNaN = exports.ZodMiniCatch = exports.ZodMiniSuccess = exports.ZodMiniNonOptional = exports.ZodMiniPrefault = exports.ZodMiniDefault = exports.ZodMiniNullable = void 0;
|
||||
exports.string = string;
|
||||
exports.email = email;
|
||||
exports.guid = guid;
|
||||
@@ -33,7 +33,6 @@ exports.uuidv4 = uuidv4;
|
||||
exports.uuidv6 = uuidv6;
|
||||
exports.uuidv7 = uuidv7;
|
||||
exports.url = url;
|
||||
exports.httpUrl = httpUrl;
|
||||
exports.emoji = emoji;
|
||||
exports.nanoid = nanoid;
|
||||
exports.cuid = cuid;
|
||||
@@ -45,15 +44,11 @@ exports.ipv4 = ipv4;
|
||||
exports.ipv6 = ipv6;
|
||||
exports.cidrv4 = cidrv4;
|
||||
exports.cidrv6 = cidrv6;
|
||||
exports.mac = mac;
|
||||
exports.base64 = base64;
|
||||
exports.base64url = base64url;
|
||||
exports.e164 = e164;
|
||||
exports.jwt = jwt;
|
||||
exports.stringFormat = stringFormat;
|
||||
exports.hostname = hostname;
|
||||
exports.hex = hex;
|
||||
exports.hash = hash;
|
||||
exports.number = number;
|
||||
exports.int = int;
|
||||
exports.float32 = float32;
|
||||
@@ -78,7 +73,6 @@ exports.object = object;
|
||||
exports.strictObject = strictObject;
|
||||
exports.looseObject = looseObject;
|
||||
exports.extend = extend;
|
||||
exports.safeExtend = safeExtend;
|
||||
exports.merge = merge;
|
||||
exports.pick = pick;
|
||||
exports.omit = omit;
|
||||
@@ -108,7 +102,6 @@ exports.success = success;
|
||||
exports.catch = _catch;
|
||||
exports.nan = nan;
|
||||
exports.pipe = pipe;
|
||||
exports.codec = codec;
|
||||
exports.readonly = readonly;
|
||||
exports.templateLiteral = templateLiteral;
|
||||
exports.lazy = _lazy;
|
||||
@@ -116,13 +109,8 @@ exports.promise = promise;
|
||||
exports.check = check;
|
||||
exports.custom = custom;
|
||||
exports.refine = refine;
|
||||
exports.superRefine = superRefine;
|
||||
exports.instanceof = _instanceof;
|
||||
exports.json = json;
|
||||
exports._function = _function;
|
||||
exports.function = _function;
|
||||
exports._function = _function;
|
||||
exports.function = _function;
|
||||
const core = __importStar(require("../core/index.cjs"));
|
||||
const index_js_1 = require("../core/index.cjs");
|
||||
const parse = __importStar(require("./parse.cjs"));
|
||||
@@ -131,7 +119,6 @@ exports.ZodMiniType = core.$constructor("ZodMiniType", (inst, def) => {
|
||||
throw new Error("Uninitialized schema in ZodMiniType.");
|
||||
core.$ZodType.init(inst, def);
|
||||
inst.def = def;
|
||||
inst.type = def.type;
|
||||
inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });
|
||||
inst.safeParse = (data, params) => parse.safeParse(inst, data, params);
|
||||
inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });
|
||||
@@ -204,13 +191,6 @@ exports.ZodMiniURL = core.$constructor("ZodMiniURL", (inst, def) => {
|
||||
function url(params) {
|
||||
return core._url(exports.ZodMiniURL, params);
|
||||
}
|
||||
function httpUrl(params) {
|
||||
return core._url(exports.ZodMiniURL, {
|
||||
protocol: /^https?$/,
|
||||
hostname: core.regexes.domain,
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
exports.ZodMiniEmoji = core.$constructor("ZodMiniEmoji", (inst, def) => {
|
||||
core.$ZodEmoji.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
@@ -288,13 +268,6 @@ exports.ZodMiniCIDRv6 = core.$constructor("ZodMiniCIDRv6", (inst, def) => {
|
||||
function cidrv6(params) {
|
||||
return core._cidrv6(exports.ZodMiniCIDRv6, params);
|
||||
}
|
||||
exports.ZodMiniMAC = core.$constructor("ZodMiniMAC", (inst, def) => {
|
||||
core.$ZodMAC.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function mac(params) {
|
||||
return core._mac(exports.ZodMiniMAC, params);
|
||||
}
|
||||
exports.ZodMiniBase64 = core.$constructor("ZodMiniBase64", (inst, def) => {
|
||||
core.$ZodBase64.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
@@ -330,21 +303,6 @@ exports.ZodMiniCustomStringFormat = core.$constructor("ZodMiniCustomStringFormat
|
||||
function stringFormat(format, fnOrRegex, _params = {}) {
|
||||
return core._stringFormat(exports.ZodMiniCustomStringFormat, format, fnOrRegex, _params);
|
||||
}
|
||||
function hostname(_params) {
|
||||
return core._stringFormat(exports.ZodMiniCustomStringFormat, "hostname", core.regexes.hostname, _params);
|
||||
}
|
||||
function hex(_params) {
|
||||
return core._stringFormat(exports.ZodMiniCustomStringFormat, "hex", core.regexes.hex, _params);
|
||||
}
|
||||
function hash(alg, params) {
|
||||
const enc = params?.enc ?? "hex";
|
||||
const format = `${alg}_${enc}`;
|
||||
const regex = core.regexes[format];
|
||||
// check for unrecognized format
|
||||
if (!regex)
|
||||
throw new Error(`Unrecognized hash format: ${format}`);
|
||||
return core._stringFormat(exports.ZodMiniCustomStringFormat, format, regex, params);
|
||||
}
|
||||
exports.ZodMiniNumber = core.$constructor("ZodMiniNumber", (inst, def) => {
|
||||
core.$ZodNumber.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
@@ -472,7 +430,7 @@ function array(element, params) {
|
||||
// .keyof
|
||||
function keyof(schema) {
|
||||
const shape = schema._zod.def.shape;
|
||||
return _enum(Object.keys(shape));
|
||||
return literal(Object.keys(shape));
|
||||
}
|
||||
exports.ZodMiniObject = core.$constructor("ZodMiniObject", (inst, def) => {
|
||||
core.$ZodObject.init(inst, def);
|
||||
@@ -482,7 +440,10 @@ exports.ZodMiniObject = core.$constructor("ZodMiniObject", (inst, def) => {
|
||||
function object(shape, params) {
|
||||
const def = {
|
||||
type: "object",
|
||||
shape: shape ?? {},
|
||||
get shape() {
|
||||
index_js_1.util.assignProp(this, "shape", { ...shape });
|
||||
return this.shape;
|
||||
},
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
};
|
||||
return new exports.ZodMiniObject(def);
|
||||
@@ -491,7 +452,11 @@ function object(shape, params) {
|
||||
function strictObject(shape, params) {
|
||||
return new exports.ZodMiniObject({
|
||||
type: "object",
|
||||
shape,
|
||||
// shape: shape as core.$ZodLooseShape,
|
||||
get shape() {
|
||||
index_js_1.util.assignProp(this, "shape", { ...shape });
|
||||
return this.shape;
|
||||
},
|
||||
catchall: never(),
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
});
|
||||
@@ -500,7 +465,14 @@ function strictObject(shape, params) {
|
||||
function looseObject(shape, params) {
|
||||
return new exports.ZodMiniObject({
|
||||
type: "object",
|
||||
shape,
|
||||
// shape: shape as core.$ZodLooseShape,
|
||||
get shape() {
|
||||
index_js_1.util.assignProp(this, "shape", { ...shape });
|
||||
return this.shape;
|
||||
},
|
||||
// get optional() {
|
||||
// return util.optionalKeys(shape);
|
||||
// },
|
||||
catchall: unknown(),
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
});
|
||||
@@ -509,9 +481,6 @@ function looseObject(shape, params) {
|
||||
function extend(schema, shape) {
|
||||
return index_js_1.util.extend(schema, shape);
|
||||
}
|
||||
function safeExtend(schema, shape) {
|
||||
return index_js_1.util.safeExtend(schema, shape);
|
||||
}
|
||||
function merge(schema, shape) {
|
||||
return index_js_1.util.extend(schema, shape);
|
||||
}
|
||||
@@ -593,11 +562,9 @@ function record(keyType, valueType, params) {
|
||||
});
|
||||
}
|
||||
function partialRecord(keyType, valueType, params) {
|
||||
const k = core.clone(keyType);
|
||||
k._zod.values = undefined;
|
||||
return new exports.ZodMiniRecord({
|
||||
type: "record",
|
||||
keyType: k,
|
||||
keyType: union([keyType, never()]),
|
||||
valueType: valueType,
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
});
|
||||
@@ -628,7 +595,6 @@ function set(valueType, params) {
|
||||
exports.ZodMiniEnum = core.$constructor("ZodMiniEnum", (inst, def) => {
|
||||
core.$ZodEnum.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
inst.options = Object.values(def.entries);
|
||||
});
|
||||
function _enum(values, params) {
|
||||
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
||||
@@ -713,7 +679,7 @@ function _default(innerType, defaultValue) {
|
||||
type: "default",
|
||||
innerType: innerType,
|
||||
get defaultValue() {
|
||||
return typeof defaultValue === "function" ? defaultValue() : index_js_1.util.shallowClone(defaultValue);
|
||||
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -726,7 +692,7 @@ function prefault(innerType, defaultValue) {
|
||||
type: "prefault",
|
||||
innerType: innerType,
|
||||
get defaultValue() {
|
||||
return typeof defaultValue === "function" ? defaultValue() : index_js_1.util.shallowClone(defaultValue);
|
||||
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -780,19 +746,6 @@ function pipe(in_, out) {
|
||||
out: out,
|
||||
});
|
||||
}
|
||||
exports.ZodMiniCodec = core.$constructor("ZodMiniCodec", (inst, def) => {
|
||||
exports.ZodMiniPipe.init(inst, def);
|
||||
core.$ZodCodec.init(inst, def);
|
||||
});
|
||||
function codec(in_, out, params) {
|
||||
return new exports.ZodMiniCodec({
|
||||
type: "pipe",
|
||||
in: in_,
|
||||
out: out,
|
||||
transform: params.decode,
|
||||
reverseTransform: params.encode,
|
||||
});
|
||||
}
|
||||
exports.ZodMiniReadonly = core.$constructor("ZodMiniReadonly", (inst, def) => {
|
||||
core.$ZodReadonly.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
@@ -859,13 +812,6 @@ function custom(fn, _params) {
|
||||
function refine(fn, _params = {}) {
|
||||
return core._refine(exports.ZodMiniCustom, fn, _params);
|
||||
}
|
||||
// superRefine
|
||||
function superRefine(fn) {
|
||||
return core._superRefine(fn);
|
||||
}
|
||||
// Re-export describe and meta from core
|
||||
exports.describe = core.describe;
|
||||
exports.meta = core.meta;
|
||||
// instanceof
|
||||
class Class {
|
||||
constructor(..._args) { }
|
||||
@@ -879,9 +825,10 @@ function _instanceof(cls, params = {
|
||||
}
|
||||
// stringbool
|
||||
const stringbool = (...args) => core._stringbool({
|
||||
Codec: exports.ZodMiniCodec,
|
||||
Pipe: exports.ZodMiniPipe,
|
||||
Boolean: exports.ZodMiniBoolean,
|
||||
String: exports.ZodMiniString,
|
||||
Transform: exports.ZodMiniTransform,
|
||||
}, ...args);
|
||||
exports.stringbool = stringbool;
|
||||
function json() {
|
||||
@@ -890,14 +837,3 @@ function json() {
|
||||
});
|
||||
return jsonSchema;
|
||||
}
|
||||
exports.ZodMiniFunction = core.$constructor("ZodMiniFunction", (inst, def) => {
|
||||
core.$ZodFunction.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function _function(params) {
|
||||
return new exports.ZodMiniFunction({
|
||||
type: "function",
|
||||
input: Array.isArray(params?.input) ? tuple(params?.input) : (params?.input ?? array(unknown())),
|
||||
output: params?.output ?? unknown(),
|
||||
});
|
||||
}
|
||||
|
||||
+5
-62
@@ -2,7 +2,6 @@ import * as core from "../core/index.cjs";
|
||||
import { util } from "../core/index.cjs";
|
||||
type SomeType = core.SomeType;
|
||||
export interface ZodMiniType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {
|
||||
type: Internals["def"]["type"];
|
||||
check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
|
||||
clone(def?: Internals["def"], params?: {
|
||||
parent: boolean;
|
||||
@@ -47,7 +46,6 @@ export interface ZodMiniURL extends _ZodMiniString<core.$ZodURLInternals> {
|
||||
}
|
||||
export declare const ZodMiniURL: core.$constructor<ZodMiniURL>;
|
||||
export declare function url(params?: string | core.$ZodURLParams): ZodMiniURL;
|
||||
export declare function httpUrl(params?: string | Omit<core.$ZodURLParams, "protocol" | "hostname">): ZodMiniURL;
|
||||
export interface ZodMiniEmoji extends _ZodMiniString<core.$ZodEmojiInternals> {
|
||||
}
|
||||
export declare const ZodMiniEmoji: core.$constructor<ZodMiniEmoji>;
|
||||
@@ -92,10 +90,6 @@ export interface ZodMiniCIDRv6 extends _ZodMiniString<core.$ZodCIDRv6Internals>
|
||||
}
|
||||
export declare const ZodMiniCIDRv6: core.$constructor<ZodMiniCIDRv6>;
|
||||
export declare function cidrv6(params?: string | core.$ZodCIDRv6Params): ZodMiniCIDRv6;
|
||||
export interface ZodMiniMAC extends _ZodMiniString<core.$ZodMACInternals> {
|
||||
}
|
||||
export declare const ZodMiniMAC: core.$constructor<ZodMiniMAC>;
|
||||
export declare function mac(params?: string | core.$ZodMACParams): ZodMiniMAC;
|
||||
export interface ZodMiniBase64 extends _ZodMiniString<core.$ZodBase64Internals> {
|
||||
}
|
||||
export declare const ZodMiniBase64: core.$constructor<ZodMiniBase64>;
|
||||
@@ -117,11 +111,6 @@ export interface ZodMiniCustomStringFormat<Format extends string = string> exten
|
||||
}
|
||||
export declare const ZodMiniCustomStringFormat: core.$constructor<ZodMiniCustomStringFormat>;
|
||||
export declare function stringFormat<Format extends string>(format: Format, fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp, _params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<Format>;
|
||||
export declare function hostname(_params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<"hostname">;
|
||||
export declare function hex(_params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<"hex">;
|
||||
export declare function hash<Alg extends util.HashAlgorithm, Enc extends util.HashEncoding = "hex">(alg: Alg, params?: {
|
||||
enc?: Enc;
|
||||
} & core.$ZodStringFormatParams): ZodMiniCustomStringFormat<`${Alg}_${Enc}`>;
|
||||
interface _ZodMiniNumber<T extends core.$ZodNumberInternals<unknown> = core.$ZodNumberInternals<unknown>> extends _ZodMiniType<T>, core.$ZodNumber<T["input"]> {
|
||||
_zod: T;
|
||||
}
|
||||
@@ -189,7 +178,7 @@ export interface ZodMiniArray<T extends SomeType = core.$ZodType> extends _ZodMi
|
||||
}
|
||||
export declare const ZodMiniArray: core.$constructor<ZodMiniArray>;
|
||||
export declare function array<T extends SomeType>(element: T, params?: string | core.$ZodArrayParams): ZodMiniArray<T>;
|
||||
export declare function keyof<T extends ZodMiniObject>(schema: T): ZodMiniEnum<util.KeysEnum<T["shape"]>>;
|
||||
export declare function keyof<T extends ZodMiniObject>(schema: T): ZodMiniLiteral<Exclude<keyof T["shape"], symbol>>;
|
||||
export interface ZodMiniObject<
|
||||
/** @ts-ignore Cast variance */
|
||||
out Shape extends core.$ZodShape = core.$ZodShape, out Config extends core.$ZodObjectConfig = core.$strip> extends ZodMiniType<any, any, core.$ZodObjectInternals<Shape, Config>>, core.$ZodObject<Shape, Config> {
|
||||
@@ -200,10 +189,6 @@ export declare function object<T extends core.$ZodLooseShape = Record<never, Som
|
||||
export declare function strictObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T, core.$strict>;
|
||||
export declare function looseObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T, core.$loose>;
|
||||
export declare function extend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: U): ZodMiniObject<util.Extend<T["shape"], U>, T["_zod"]["config"]>;
|
||||
export type SafeExtendShape<Base extends core.$ZodShape, Ext extends core.$ZodLooseShape> = {
|
||||
[K in keyof Ext]: K extends keyof Base ? core.output<Ext[K]> extends core.output<Base[K]> ? core.input<Ext[K]> extends core.input<Base[K]> ? Ext[K] : never : never : Ext[K];
|
||||
};
|
||||
export declare function safeExtend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: SafeExtendShape<T["shape"], U>): ZodMiniObject<util.Extend<T["shape"], U>, T["_zod"]["config"]>;
|
||||
/** @deprecated Identical to `z.extend(A, B)` */
|
||||
export declare function merge<T extends ZodMiniObject, U extends ZodMiniObject>(a: T, b: U): ZodMiniObject<util.Extend<T["shape"], U["shape"]>, T["_zod"]["config"]>;
|
||||
export declare function pick<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M): ZodMiniObject<util.Flatten<Pick<T["shape"], keyof T["shape"] & keyof M>>, T["_zod"]["config"]>;
|
||||
@@ -230,11 +215,11 @@ export interface ZodMiniUnion<T extends readonly SomeType[] = readonly core.$Zod
|
||||
}
|
||||
export declare const ZodMiniUnion: core.$constructor<ZodMiniUnion>;
|
||||
export declare function union<const T extends readonly SomeType[]>(options: T, params?: string | core.$ZodUnionParams): ZodMiniUnion<T>;
|
||||
export interface ZodMiniDiscriminatedUnion<Options extends readonly SomeType[] = readonly core.$ZodType[], Disc extends string = string> extends ZodMiniUnion<Options> {
|
||||
_zod: core.$ZodDiscriminatedUnionInternals<Options, Disc>;
|
||||
export interface ZodMiniDiscriminatedUnion<Options extends readonly SomeType[] = readonly core.$ZodType[]> extends ZodMiniUnion<Options> {
|
||||
_zod: core.$ZodDiscriminatedUnionInternals<Options>;
|
||||
}
|
||||
export declare const ZodMiniDiscriminatedUnion: core.$constructor<ZodMiniDiscriminatedUnion>;
|
||||
export declare function discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]], Disc extends string>(discriminator: Disc, options: Types, params?: string | core.$ZodDiscriminatedUnionParams): ZodMiniDiscriminatedUnion<Types, Disc>;
|
||||
export declare function discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]]>(discriminator: string, options: Types, params?: string | core.$ZodDiscriminatedUnionParams): ZodMiniDiscriminatedUnion<Types>;
|
||||
export interface ZodMiniIntersection<A extends SomeType = core.$ZodType, B extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodIntersectionInternals<A, B>> {
|
||||
}
|
||||
export declare const ZodMiniIntersection: core.$constructor<ZodMiniIntersection>;
|
||||
@@ -259,7 +244,6 @@ export interface ZodMiniSet<T extends SomeType = core.$ZodType> extends _ZodMini
|
||||
export declare const ZodMiniSet: core.$constructor<ZodMiniSet>;
|
||||
export declare function set<Value extends SomeType>(valueType: Value, params?: string | core.$ZodSetParams): ZodMiniSet<Value>;
|
||||
export interface ZodMiniEnum<T extends util.EnumLike = util.EnumLike> extends _ZodMiniType<core.$ZodEnumInternals<T>> {
|
||||
options: Array<T[keyof T]>;
|
||||
}
|
||||
export declare const ZodMiniEnum: core.$constructor<ZodMiniEnum>;
|
||||
declare function _enum<const T extends readonly string[]>(values: T, params?: string | core.$ZodEnumParams): ZodMiniEnum<util.ToEnum<T[number]>>;
|
||||
@@ -324,15 +308,6 @@ export interface ZodMiniPipe<A extends SomeType = core.$ZodType, B extends SomeT
|
||||
}
|
||||
export declare const ZodMiniPipe: core.$constructor<ZodMiniPipe>;
|
||||
export declare function pipe<const A extends SomeType, B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>>(in_: A, out: B | core.$ZodType<unknown, core.output<A>>): ZodMiniPipe<A, B>;
|
||||
export interface ZodMiniCodec<A extends SomeType = core.$ZodType, B extends SomeType = core.$ZodType> extends ZodMiniPipe<A, B>, core.$ZodCodec<A, B> {
|
||||
_zod: core.$ZodCodecInternals<A, B>;
|
||||
def: core.$ZodCodecDef<A, B>;
|
||||
}
|
||||
export declare const ZodMiniCodec: core.$constructor<ZodMiniCodec>;
|
||||
export declare function codec<const A extends SomeType, B extends core.SomeType = core.$ZodType>(in_: A, out: B, params: {
|
||||
decode: (value: core.output<A>, payload: core.ParsePayload<core.output<A>>) => core.util.MaybeAsync<core.input<B>>;
|
||||
encode: (value: core.input<B>, payload: core.ParsePayload<core.input<B>>) => core.util.MaybeAsync<core.output<A>>;
|
||||
}): ZodMiniCodec<A, B>;
|
||||
export interface ZodMiniReadonly<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodReadonlyInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniReadonly: core.$constructor<ZodMiniReadonly>;
|
||||
@@ -356,15 +331,12 @@ export declare const ZodMiniCustom: core.$constructor<ZodMiniCustom>;
|
||||
export declare function check<O = unknown>(fn: core.CheckFn<O>, params?: string | core.$ZodCustomParams): core.$ZodCheck<O>;
|
||||
export declare function custom<O = unknown, I = O>(fn?: (data: O) => unknown, _params?: string | core.$ZodCustomParams | undefined): ZodMiniCustom<O, I>;
|
||||
export declare function refine<T>(fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>, _params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
|
||||
export declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>): core.$ZodCheck<T>;
|
||||
export declare const describe: typeof core.describe;
|
||||
export declare const meta: typeof core.meta;
|
||||
declare abstract class Class {
|
||||
constructor(..._args: any[]);
|
||||
}
|
||||
declare function _instanceof<T extends typeof Class>(cls: T, params?: core.$ZodCustomParams): ZodMiniCustom<InstanceType<T>, InstanceType<T>>;
|
||||
export { _instanceof as instanceof };
|
||||
export declare const stringbool: (_params?: string | core.$ZodStringBoolParams) => ZodMiniCodec<ZodMiniString, ZodMiniBoolean>;
|
||||
export declare const stringbool: (_params?: string | core.$ZodStringBoolParams) => ZodMiniPipe<ZodMiniPipe<ZodMiniString, ZodMiniTransform<boolean, string>>, ZodMiniBoolean>;
|
||||
type _ZodMiniJSONSchema = ZodMiniUnion<[
|
||||
ZodMiniString,
|
||||
ZodMiniNumber,
|
||||
@@ -382,32 +354,3 @@ export interface ZodMiniJSONSchema extends _ZodMiniJSONSchema {
|
||||
_zod: ZodMiniJSONSchemaInternals;
|
||||
}
|
||||
export declare function json(): ZodMiniJSONSchema;
|
||||
export interface ZodMiniFunction<Args extends core.$ZodFunctionIn = core.$ZodFunctionIn, Returns extends core.$ZodFunctionOut = core.$ZodFunctionOut> extends _ZodMiniType<core.$ZodFunctionInternals<Args, Returns>>, core.$ZodFunction<Args, Returns> {
|
||||
_def: core.$ZodFunctionDef<Args, Returns>;
|
||||
_input: core.$InferInnerFunctionType<Args, Returns>;
|
||||
_output: core.$InferOuterFunctionType<Args, Returns>;
|
||||
input<const Items extends util.TupleItems, const Rest extends core.$ZodFunctionOut = core.$ZodFunctionOut>(args: Items, rest?: Rest): ZodMiniFunction<ZodMiniTuple<Items, Rest>, Returns>;
|
||||
input<NewArgs extends core.$ZodFunctionIn>(args: NewArgs): ZodMiniFunction<NewArgs, Returns>;
|
||||
input(...args: any[]): ZodMiniFunction<any, Returns>;
|
||||
output<NewReturns extends core.$ZodFunctionOut>(output: NewReturns): ZodMiniFunction<Args, NewReturns>;
|
||||
}
|
||||
export declare const ZodMiniFunction: core.$constructor<ZodMiniFunction>;
|
||||
export declare function _function(): ZodMiniFunction;
|
||||
export declare function _function<const In extends Array<SomeType> = Array<SomeType>>(params: {
|
||||
input: In;
|
||||
}): ZodMiniFunction<ZodMiniTuple<In, null>, core.$ZodFunctionOut>;
|
||||
export declare function _function<const In extends Array<SomeType> = Array<SomeType>, const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut>(params: {
|
||||
input: In;
|
||||
output: Out;
|
||||
}): ZodMiniFunction<ZodMiniTuple<In, null>, Out>;
|
||||
export declare function _function<const In extends core.$ZodFunctionIn = core.$ZodFunctionIn>(params: {
|
||||
input: In;
|
||||
}): ZodMiniFunction<In, core.$ZodFunctionOut>;
|
||||
export declare function _function<const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut>(params: {
|
||||
output: Out;
|
||||
}): ZodMiniFunction<core.$ZodFunctionIn, Out>;
|
||||
export declare function _function<In extends core.$ZodFunctionIn = core.$ZodFunctionIn, Out extends core.$ZodFunctionOut = core.$ZodFunctionOut>(params?: {
|
||||
input: In;
|
||||
output: Out;
|
||||
}): ZodMiniFunction<In, Out>;
|
||||
export { _function as function };
|
||||
|
||||
+5
-62
@@ -2,7 +2,6 @@ import * as core from "../core/index.js";
|
||||
import { util } from "../core/index.js";
|
||||
type SomeType = core.SomeType;
|
||||
export interface ZodMiniType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {
|
||||
type: Internals["def"]["type"];
|
||||
check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
|
||||
clone(def?: Internals["def"], params?: {
|
||||
parent: boolean;
|
||||
@@ -47,7 +46,6 @@ export interface ZodMiniURL extends _ZodMiniString<core.$ZodURLInternals> {
|
||||
}
|
||||
export declare const ZodMiniURL: core.$constructor<ZodMiniURL>;
|
||||
export declare function url(params?: string | core.$ZodURLParams): ZodMiniURL;
|
||||
export declare function httpUrl(params?: string | Omit<core.$ZodURLParams, "protocol" | "hostname">): ZodMiniURL;
|
||||
export interface ZodMiniEmoji extends _ZodMiniString<core.$ZodEmojiInternals> {
|
||||
}
|
||||
export declare const ZodMiniEmoji: core.$constructor<ZodMiniEmoji>;
|
||||
@@ -92,10 +90,6 @@ export interface ZodMiniCIDRv6 extends _ZodMiniString<core.$ZodCIDRv6Internals>
|
||||
}
|
||||
export declare const ZodMiniCIDRv6: core.$constructor<ZodMiniCIDRv6>;
|
||||
export declare function cidrv6(params?: string | core.$ZodCIDRv6Params): ZodMiniCIDRv6;
|
||||
export interface ZodMiniMAC extends _ZodMiniString<core.$ZodMACInternals> {
|
||||
}
|
||||
export declare const ZodMiniMAC: core.$constructor<ZodMiniMAC>;
|
||||
export declare function mac(params?: string | core.$ZodMACParams): ZodMiniMAC;
|
||||
export interface ZodMiniBase64 extends _ZodMiniString<core.$ZodBase64Internals> {
|
||||
}
|
||||
export declare const ZodMiniBase64: core.$constructor<ZodMiniBase64>;
|
||||
@@ -117,11 +111,6 @@ export interface ZodMiniCustomStringFormat<Format extends string = string> exten
|
||||
}
|
||||
export declare const ZodMiniCustomStringFormat: core.$constructor<ZodMiniCustomStringFormat>;
|
||||
export declare function stringFormat<Format extends string>(format: Format, fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp, _params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<Format>;
|
||||
export declare function hostname(_params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<"hostname">;
|
||||
export declare function hex(_params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<"hex">;
|
||||
export declare function hash<Alg extends util.HashAlgorithm, Enc extends util.HashEncoding = "hex">(alg: Alg, params?: {
|
||||
enc?: Enc;
|
||||
} & core.$ZodStringFormatParams): ZodMiniCustomStringFormat<`${Alg}_${Enc}`>;
|
||||
interface _ZodMiniNumber<T extends core.$ZodNumberInternals<unknown> = core.$ZodNumberInternals<unknown>> extends _ZodMiniType<T>, core.$ZodNumber<T["input"]> {
|
||||
_zod: T;
|
||||
}
|
||||
@@ -189,7 +178,7 @@ export interface ZodMiniArray<T extends SomeType = core.$ZodType> extends _ZodMi
|
||||
}
|
||||
export declare const ZodMiniArray: core.$constructor<ZodMiniArray>;
|
||||
export declare function array<T extends SomeType>(element: T, params?: string | core.$ZodArrayParams): ZodMiniArray<T>;
|
||||
export declare function keyof<T extends ZodMiniObject>(schema: T): ZodMiniEnum<util.KeysEnum<T["shape"]>>;
|
||||
export declare function keyof<T extends ZodMiniObject>(schema: T): ZodMiniLiteral<Exclude<keyof T["shape"], symbol>>;
|
||||
export interface ZodMiniObject<
|
||||
/** @ts-ignore Cast variance */
|
||||
out Shape extends core.$ZodShape = core.$ZodShape, out Config extends core.$ZodObjectConfig = core.$strip> extends ZodMiniType<any, any, core.$ZodObjectInternals<Shape, Config>>, core.$ZodObject<Shape, Config> {
|
||||
@@ -200,10 +189,6 @@ export declare function object<T extends core.$ZodLooseShape = Record<never, Som
|
||||
export declare function strictObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T, core.$strict>;
|
||||
export declare function looseObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T, core.$loose>;
|
||||
export declare function extend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: U): ZodMiniObject<util.Extend<T["shape"], U>, T["_zod"]["config"]>;
|
||||
export type SafeExtendShape<Base extends core.$ZodShape, Ext extends core.$ZodLooseShape> = {
|
||||
[K in keyof Ext]: K extends keyof Base ? core.output<Ext[K]> extends core.output<Base[K]> ? core.input<Ext[K]> extends core.input<Base[K]> ? Ext[K] : never : never : Ext[K];
|
||||
};
|
||||
export declare function safeExtend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: SafeExtendShape<T["shape"], U>): ZodMiniObject<util.Extend<T["shape"], U>, T["_zod"]["config"]>;
|
||||
/** @deprecated Identical to `z.extend(A, B)` */
|
||||
export declare function merge<T extends ZodMiniObject, U extends ZodMiniObject>(a: T, b: U): ZodMiniObject<util.Extend<T["shape"], U["shape"]>, T["_zod"]["config"]>;
|
||||
export declare function pick<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M): ZodMiniObject<util.Flatten<Pick<T["shape"], keyof T["shape"] & keyof M>>, T["_zod"]["config"]>;
|
||||
@@ -230,11 +215,11 @@ export interface ZodMiniUnion<T extends readonly SomeType[] = readonly core.$Zod
|
||||
}
|
||||
export declare const ZodMiniUnion: core.$constructor<ZodMiniUnion>;
|
||||
export declare function union<const T extends readonly SomeType[]>(options: T, params?: string | core.$ZodUnionParams): ZodMiniUnion<T>;
|
||||
export interface ZodMiniDiscriminatedUnion<Options extends readonly SomeType[] = readonly core.$ZodType[], Disc extends string = string> extends ZodMiniUnion<Options> {
|
||||
_zod: core.$ZodDiscriminatedUnionInternals<Options, Disc>;
|
||||
export interface ZodMiniDiscriminatedUnion<Options extends readonly SomeType[] = readonly core.$ZodType[]> extends ZodMiniUnion<Options> {
|
||||
_zod: core.$ZodDiscriminatedUnionInternals<Options>;
|
||||
}
|
||||
export declare const ZodMiniDiscriminatedUnion: core.$constructor<ZodMiniDiscriminatedUnion>;
|
||||
export declare function discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]], Disc extends string>(discriminator: Disc, options: Types, params?: string | core.$ZodDiscriminatedUnionParams): ZodMiniDiscriminatedUnion<Types, Disc>;
|
||||
export declare function discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]]>(discriminator: string, options: Types, params?: string | core.$ZodDiscriminatedUnionParams): ZodMiniDiscriminatedUnion<Types>;
|
||||
export interface ZodMiniIntersection<A extends SomeType = core.$ZodType, B extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodIntersectionInternals<A, B>> {
|
||||
}
|
||||
export declare const ZodMiniIntersection: core.$constructor<ZodMiniIntersection>;
|
||||
@@ -259,7 +244,6 @@ export interface ZodMiniSet<T extends SomeType = core.$ZodType> extends _ZodMini
|
||||
export declare const ZodMiniSet: core.$constructor<ZodMiniSet>;
|
||||
export declare function set<Value extends SomeType>(valueType: Value, params?: string | core.$ZodSetParams): ZodMiniSet<Value>;
|
||||
export interface ZodMiniEnum<T extends util.EnumLike = util.EnumLike> extends _ZodMiniType<core.$ZodEnumInternals<T>> {
|
||||
options: Array<T[keyof T]>;
|
||||
}
|
||||
export declare const ZodMiniEnum: core.$constructor<ZodMiniEnum>;
|
||||
declare function _enum<const T extends readonly string[]>(values: T, params?: string | core.$ZodEnumParams): ZodMiniEnum<util.ToEnum<T[number]>>;
|
||||
@@ -324,15 +308,6 @@ export interface ZodMiniPipe<A extends SomeType = core.$ZodType, B extends SomeT
|
||||
}
|
||||
export declare const ZodMiniPipe: core.$constructor<ZodMiniPipe>;
|
||||
export declare function pipe<const A extends SomeType, B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>>(in_: A, out: B | core.$ZodType<unknown, core.output<A>>): ZodMiniPipe<A, B>;
|
||||
export interface ZodMiniCodec<A extends SomeType = core.$ZodType, B extends SomeType = core.$ZodType> extends ZodMiniPipe<A, B>, core.$ZodCodec<A, B> {
|
||||
_zod: core.$ZodCodecInternals<A, B>;
|
||||
def: core.$ZodCodecDef<A, B>;
|
||||
}
|
||||
export declare const ZodMiniCodec: core.$constructor<ZodMiniCodec>;
|
||||
export declare function codec<const A extends SomeType, B extends core.SomeType = core.$ZodType>(in_: A, out: B, params: {
|
||||
decode: (value: core.output<A>, payload: core.ParsePayload<core.output<A>>) => core.util.MaybeAsync<core.input<B>>;
|
||||
encode: (value: core.input<B>, payload: core.ParsePayload<core.input<B>>) => core.util.MaybeAsync<core.output<A>>;
|
||||
}): ZodMiniCodec<A, B>;
|
||||
export interface ZodMiniReadonly<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodReadonlyInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniReadonly: core.$constructor<ZodMiniReadonly>;
|
||||
@@ -356,15 +331,12 @@ export declare const ZodMiniCustom: core.$constructor<ZodMiniCustom>;
|
||||
export declare function check<O = unknown>(fn: core.CheckFn<O>, params?: string | core.$ZodCustomParams): core.$ZodCheck<O>;
|
||||
export declare function custom<O = unknown, I = O>(fn?: (data: O) => unknown, _params?: string | core.$ZodCustomParams | undefined): ZodMiniCustom<O, I>;
|
||||
export declare function refine<T>(fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>, _params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
|
||||
export declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>): core.$ZodCheck<T>;
|
||||
export declare const describe: typeof core.describe;
|
||||
export declare const meta: typeof core.meta;
|
||||
declare abstract class Class {
|
||||
constructor(..._args: any[]);
|
||||
}
|
||||
declare function _instanceof<T extends typeof Class>(cls: T, params?: core.$ZodCustomParams): ZodMiniCustom<InstanceType<T>, InstanceType<T>>;
|
||||
export { _instanceof as instanceof };
|
||||
export declare const stringbool: (_params?: string | core.$ZodStringBoolParams) => ZodMiniCodec<ZodMiniString, ZodMiniBoolean>;
|
||||
export declare const stringbool: (_params?: string | core.$ZodStringBoolParams) => ZodMiniPipe<ZodMiniPipe<ZodMiniString, ZodMiniTransform<boolean, string>>, ZodMiniBoolean>;
|
||||
type _ZodMiniJSONSchema = ZodMiniUnion<[
|
||||
ZodMiniString,
|
||||
ZodMiniNumber,
|
||||
@@ -382,32 +354,3 @@ export interface ZodMiniJSONSchema extends _ZodMiniJSONSchema {
|
||||
_zod: ZodMiniJSONSchemaInternals;
|
||||
}
|
||||
export declare function json(): ZodMiniJSONSchema;
|
||||
export interface ZodMiniFunction<Args extends core.$ZodFunctionIn = core.$ZodFunctionIn, Returns extends core.$ZodFunctionOut = core.$ZodFunctionOut> extends _ZodMiniType<core.$ZodFunctionInternals<Args, Returns>>, core.$ZodFunction<Args, Returns> {
|
||||
_def: core.$ZodFunctionDef<Args, Returns>;
|
||||
_input: core.$InferInnerFunctionType<Args, Returns>;
|
||||
_output: core.$InferOuterFunctionType<Args, Returns>;
|
||||
input<const Items extends util.TupleItems, const Rest extends core.$ZodFunctionOut = core.$ZodFunctionOut>(args: Items, rest?: Rest): ZodMiniFunction<ZodMiniTuple<Items, Rest>, Returns>;
|
||||
input<NewArgs extends core.$ZodFunctionIn>(args: NewArgs): ZodMiniFunction<NewArgs, Returns>;
|
||||
input(...args: any[]): ZodMiniFunction<any, Returns>;
|
||||
output<NewReturns extends core.$ZodFunctionOut>(output: NewReturns): ZodMiniFunction<Args, NewReturns>;
|
||||
}
|
||||
export declare const ZodMiniFunction: core.$constructor<ZodMiniFunction>;
|
||||
export declare function _function(): ZodMiniFunction;
|
||||
export declare function _function<const In extends Array<SomeType> = Array<SomeType>>(params: {
|
||||
input: In;
|
||||
}): ZodMiniFunction<ZodMiniTuple<In, null>, core.$ZodFunctionOut>;
|
||||
export declare function _function<const In extends Array<SomeType> = Array<SomeType>, const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut>(params: {
|
||||
input: In;
|
||||
output: Out;
|
||||
}): ZodMiniFunction<ZodMiniTuple<In, null>, Out>;
|
||||
export declare function _function<const In extends core.$ZodFunctionIn = core.$ZodFunctionIn>(params: {
|
||||
input: In;
|
||||
}): ZodMiniFunction<In, core.$ZodFunctionOut>;
|
||||
export declare function _function<const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut>(params: {
|
||||
output: Out;
|
||||
}): ZodMiniFunction<core.$ZodFunctionIn, Out>;
|
||||
export declare function _function<In extends core.$ZodFunctionIn = core.$ZodFunctionIn, Out extends core.$ZodFunctionOut = core.$ZodFunctionOut>(params?: {
|
||||
input: In;
|
||||
output: Out;
|
||||
}): ZodMiniFunction<In, Out>;
|
||||
export { _function as function };
|
||||
|
||||
+23
-76
@@ -6,7 +6,6 @@ export const ZodMiniType = /*@__PURE__*/ core.$constructor("ZodMiniType", (inst,
|
||||
throw new Error("Uninitialized schema in ZodMiniType.");
|
||||
core.$ZodType.init(inst, def);
|
||||
inst.def = def;
|
||||
inst.type = def.type;
|
||||
inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });
|
||||
inst.safeParse = (data, params) => parse.safeParse(inst, data, params);
|
||||
inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });
|
||||
@@ -79,13 +78,6 @@ export const ZodMiniURL = /*@__PURE__*/ core.$constructor("ZodMiniURL", (inst, d
|
||||
export function url(params) {
|
||||
return core._url(ZodMiniURL, params);
|
||||
}
|
||||
export function httpUrl(params) {
|
||||
return core._url(ZodMiniURL, {
|
||||
protocol: /^https?$/,
|
||||
hostname: core.regexes.domain,
|
||||
...util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
export const ZodMiniEmoji = /*@__PURE__*/ core.$constructor("ZodMiniEmoji", (inst, def) => {
|
||||
core.$ZodEmoji.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
@@ -163,13 +155,6 @@ export const ZodMiniCIDRv6 = /*@__PURE__*/ core.$constructor("ZodMiniCIDRv6", (i
|
||||
export function cidrv6(params) {
|
||||
return core._cidrv6(ZodMiniCIDRv6, params);
|
||||
}
|
||||
export const ZodMiniMAC = /*@__PURE__*/ core.$constructor("ZodMiniMAC", (inst, def) => {
|
||||
core.$ZodMAC.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function mac(params) {
|
||||
return core._mac(ZodMiniMAC, params);
|
||||
}
|
||||
export const ZodMiniBase64 = /*@__PURE__*/ core.$constructor("ZodMiniBase64", (inst, def) => {
|
||||
core.$ZodBase64.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
@@ -205,21 +190,6 @@ export const ZodMiniCustomStringFormat = /*@__PURE__*/ core.$constructor("ZodMin
|
||||
export function stringFormat(format, fnOrRegex, _params = {}) {
|
||||
return core._stringFormat(ZodMiniCustomStringFormat, format, fnOrRegex, _params);
|
||||
}
|
||||
export function hostname(_params) {
|
||||
return core._stringFormat(ZodMiniCustomStringFormat, "hostname", core.regexes.hostname, _params);
|
||||
}
|
||||
export function hex(_params) {
|
||||
return core._stringFormat(ZodMiniCustomStringFormat, "hex", core.regexes.hex, _params);
|
||||
}
|
||||
export function hash(alg, params) {
|
||||
const enc = params?.enc ?? "hex";
|
||||
const format = `${alg}_${enc}`;
|
||||
const regex = core.regexes[format];
|
||||
// check for unrecognized format
|
||||
if (!regex)
|
||||
throw new Error(`Unrecognized hash format: ${format}`);
|
||||
return core._stringFormat(ZodMiniCustomStringFormat, format, regex, params);
|
||||
}
|
||||
export const ZodMiniNumber = /*@__PURE__*/ core.$constructor("ZodMiniNumber", (inst, def) => {
|
||||
core.$ZodNumber.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
@@ -350,7 +320,7 @@ export function array(element, params) {
|
||||
// .keyof
|
||||
export function keyof(schema) {
|
||||
const shape = schema._zod.def.shape;
|
||||
return _enum(Object.keys(shape));
|
||||
return literal(Object.keys(shape));
|
||||
}
|
||||
export const ZodMiniObject = /*@__PURE__*/ core.$constructor("ZodMiniObject", (inst, def) => {
|
||||
core.$ZodObject.init(inst, def);
|
||||
@@ -360,7 +330,10 @@ export const ZodMiniObject = /*@__PURE__*/ core.$constructor("ZodMiniObject", (i
|
||||
export function object(shape, params) {
|
||||
const def = {
|
||||
type: "object",
|
||||
shape: shape ?? {},
|
||||
get shape() {
|
||||
util.assignProp(this, "shape", { ...shape });
|
||||
return this.shape;
|
||||
},
|
||||
...util.normalizeParams(params),
|
||||
};
|
||||
return new ZodMiniObject(def);
|
||||
@@ -369,7 +342,11 @@ export function object(shape, params) {
|
||||
export function strictObject(shape, params) {
|
||||
return new ZodMiniObject({
|
||||
type: "object",
|
||||
shape,
|
||||
// shape: shape as core.$ZodLooseShape,
|
||||
get shape() {
|
||||
util.assignProp(this, "shape", { ...shape });
|
||||
return this.shape;
|
||||
},
|
||||
catchall: never(),
|
||||
...util.normalizeParams(params),
|
||||
});
|
||||
@@ -378,7 +355,14 @@ export function strictObject(shape, params) {
|
||||
export function looseObject(shape, params) {
|
||||
return new ZodMiniObject({
|
||||
type: "object",
|
||||
shape,
|
||||
// shape: shape as core.$ZodLooseShape,
|
||||
get shape() {
|
||||
util.assignProp(this, "shape", { ...shape });
|
||||
return this.shape;
|
||||
},
|
||||
// get optional() {
|
||||
// return util.optionalKeys(shape);
|
||||
// },
|
||||
catchall: unknown(),
|
||||
...util.normalizeParams(params),
|
||||
});
|
||||
@@ -387,9 +371,6 @@ export function looseObject(shape, params) {
|
||||
export function extend(schema, shape) {
|
||||
return util.extend(schema, shape);
|
||||
}
|
||||
export function safeExtend(schema, shape) {
|
||||
return util.safeExtend(schema, shape);
|
||||
}
|
||||
export function merge(schema, shape) {
|
||||
return util.extend(schema, shape);
|
||||
}
|
||||
@@ -471,11 +452,9 @@ export function record(keyType, valueType, params) {
|
||||
});
|
||||
}
|
||||
export function partialRecord(keyType, valueType, params) {
|
||||
const k = core.clone(keyType);
|
||||
k._zod.values = undefined;
|
||||
return new ZodMiniRecord({
|
||||
type: "record",
|
||||
keyType: k,
|
||||
keyType: union([keyType, never()]),
|
||||
valueType: valueType,
|
||||
...util.normalizeParams(params),
|
||||
});
|
||||
@@ -506,7 +485,6 @@ export function set(valueType, params) {
|
||||
export const ZodMiniEnum = /*@__PURE__*/ core.$constructor("ZodMiniEnum", (inst, def) => {
|
||||
core.$ZodEnum.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
inst.options = Object.values(def.entries);
|
||||
});
|
||||
function _enum(values, params) {
|
||||
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
||||
@@ -592,7 +570,7 @@ export function _default(innerType, defaultValue) {
|
||||
type: "default",
|
||||
innerType: innerType,
|
||||
get defaultValue() {
|
||||
return typeof defaultValue === "function" ? defaultValue() : util.shallowClone(defaultValue);
|
||||
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -605,7 +583,7 @@ export function prefault(innerType, defaultValue) {
|
||||
type: "prefault",
|
||||
innerType: innerType,
|
||||
get defaultValue() {
|
||||
return typeof defaultValue === "function" ? defaultValue() : util.shallowClone(defaultValue);
|
||||
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -660,19 +638,6 @@ export function pipe(in_, out) {
|
||||
out: out,
|
||||
});
|
||||
}
|
||||
export const ZodMiniCodec = /*@__PURE__*/ core.$constructor("ZodMiniCodec", (inst, def) => {
|
||||
ZodMiniPipe.init(inst, def);
|
||||
core.$ZodCodec.init(inst, def);
|
||||
});
|
||||
export function codec(in_, out, params) {
|
||||
return new ZodMiniCodec({
|
||||
type: "pipe",
|
||||
in: in_,
|
||||
out: out,
|
||||
transform: params.decode,
|
||||
reverseTransform: params.encode,
|
||||
});
|
||||
}
|
||||
export const ZodMiniReadonly = /*@__PURE__*/ core.$constructor("ZodMiniReadonly", (inst, def) => {
|
||||
core.$ZodReadonly.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
@@ -740,13 +705,6 @@ export function custom(fn, _params) {
|
||||
export function refine(fn, _params = {}) {
|
||||
return core._refine(ZodMiniCustom, fn, _params);
|
||||
}
|
||||
// superRefine
|
||||
export function superRefine(fn) {
|
||||
return core._superRefine(fn);
|
||||
}
|
||||
// Re-export describe and meta from core
|
||||
export const describe = core.describe;
|
||||
export const meta = core.meta;
|
||||
// instanceof
|
||||
class Class {
|
||||
constructor(..._args) { }
|
||||
@@ -761,9 +719,10 @@ function _instanceof(cls, params = {
|
||||
export { _instanceof as instanceof };
|
||||
// stringbool
|
||||
export const stringbool = (...args) => core._stringbool({
|
||||
Codec: ZodMiniCodec,
|
||||
Pipe: ZodMiniPipe,
|
||||
Boolean: ZodMiniBoolean,
|
||||
String: ZodMiniString,
|
||||
Transform: ZodMiniTransform,
|
||||
}, ...args);
|
||||
export function json() {
|
||||
const jsonSchema = _lazy(() => {
|
||||
@@ -771,15 +730,3 @@ export function json() {
|
||||
});
|
||||
return jsonSchema;
|
||||
}
|
||||
export const ZodMiniFunction = /*@__PURE__*/ core.$constructor("ZodMiniFunction", (inst, def) => {
|
||||
core.$ZodFunction.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function _function(params) {
|
||||
return new ZodMiniFunction({
|
||||
type: "function",
|
||||
input: Array.isArray(params?.input) ? tuple(params?.input) : (params?.input ?? array(unknown())),
|
||||
output: params?.output ?? unknown(),
|
||||
});
|
||||
}
|
||||
export { _function as function };
|
||||
|
||||
Reference in New Issue
Block a user