full site update
This commit is contained in:
34
node_modules/zod/v4/mini/checks.cjs
generated
vendored
Normal file
34
node_modules/zod/v4/mini/checks.cjs
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.toUpperCase = exports.toLowerCase = exports.trim = exports.normalize = exports.overwrite = exports.mime = exports.property = exports.endsWith = exports.startsWith = exports.includes = exports.uppercase = exports.lowercase = exports.regex = exports.length = exports.minLength = exports.maxLength = exports.size = exports.minSize = exports.maxSize = exports.multipleOf = exports.nonnegative = exports.nonpositive = exports.negative = exports.positive = exports.minimum = exports.gte = exports.gt = exports.maximum = exports.lte = exports.lt = void 0;
|
||||
var index_js_1 = require("../core/index.cjs");
|
||||
Object.defineProperty(exports, "lt", { enumerable: true, get: function () { return index_js_1._lt; } });
|
||||
Object.defineProperty(exports, "lte", { enumerable: true, get: function () { return index_js_1._lte; } });
|
||||
Object.defineProperty(exports, "maximum", { enumerable: true, get: function () { return index_js_1._lte; } });
|
||||
Object.defineProperty(exports, "gt", { enumerable: true, get: function () { return index_js_1._gt; } });
|
||||
Object.defineProperty(exports, "gte", { enumerable: true, get: function () { return index_js_1._gte; } });
|
||||
Object.defineProperty(exports, "minimum", { enumerable: true, get: function () { return index_js_1._gte; } });
|
||||
Object.defineProperty(exports, "positive", { enumerable: true, get: function () { return index_js_1._positive; } });
|
||||
Object.defineProperty(exports, "negative", { enumerable: true, get: function () { return index_js_1._negative; } });
|
||||
Object.defineProperty(exports, "nonpositive", { enumerable: true, get: function () { return index_js_1._nonpositive; } });
|
||||
Object.defineProperty(exports, "nonnegative", { enumerable: true, get: function () { return index_js_1._nonnegative; } });
|
||||
Object.defineProperty(exports, "multipleOf", { enumerable: true, get: function () { return index_js_1._multipleOf; } });
|
||||
Object.defineProperty(exports, "maxSize", { enumerable: true, get: function () { return index_js_1._maxSize; } });
|
||||
Object.defineProperty(exports, "minSize", { enumerable: true, get: function () { return index_js_1._minSize; } });
|
||||
Object.defineProperty(exports, "size", { enumerable: true, get: function () { return index_js_1._size; } });
|
||||
Object.defineProperty(exports, "maxLength", { enumerable: true, get: function () { return index_js_1._maxLength; } });
|
||||
Object.defineProperty(exports, "minLength", { enumerable: true, get: function () { return index_js_1._minLength; } });
|
||||
Object.defineProperty(exports, "length", { enumerable: true, get: function () { return index_js_1._length; } });
|
||||
Object.defineProperty(exports, "regex", { enumerable: true, get: function () { return index_js_1._regex; } });
|
||||
Object.defineProperty(exports, "lowercase", { enumerable: true, get: function () { return index_js_1._lowercase; } });
|
||||
Object.defineProperty(exports, "uppercase", { enumerable: true, get: function () { return index_js_1._uppercase; } });
|
||||
Object.defineProperty(exports, "includes", { enumerable: true, get: function () { return index_js_1._includes; } });
|
||||
Object.defineProperty(exports, "startsWith", { enumerable: true, get: function () { return index_js_1._startsWith; } });
|
||||
Object.defineProperty(exports, "endsWith", { enumerable: true, get: function () { return index_js_1._endsWith; } });
|
||||
Object.defineProperty(exports, "property", { enumerable: true, get: function () { return index_js_1._property; } });
|
||||
Object.defineProperty(exports, "mime", { enumerable: true, get: function () { return index_js_1._mime; } });
|
||||
Object.defineProperty(exports, "overwrite", { enumerable: true, get: function () { return index_js_1._overwrite; } });
|
||||
Object.defineProperty(exports, "normalize", { enumerable: true, get: function () { return index_js_1._normalize; } });
|
||||
Object.defineProperty(exports, "trim", { enumerable: true, get: function () { return index_js_1._trim; } });
|
||||
Object.defineProperty(exports, "toLowerCase", { enumerable: true, get: function () { return index_js_1._toLowerCase; } });
|
||||
Object.defineProperty(exports, "toUpperCase", { enumerable: true, get: function () { return index_js_1._toUpperCase; } });
|
1
node_modules/zod/v4/mini/checks.d.cts
generated
vendored
Normal file
1
node_modules/zod/v4/mini/checks.d.cts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { _lt as lt, _lte as lte, _lte as maximum, _gt as gt, _gte as gte, _gte as minimum, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, } from "../core/index.cjs";
|
1
node_modules/zod/v4/mini/checks.d.ts
generated
vendored
Normal file
1
node_modules/zod/v4/mini/checks.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { _lt as lt, _lte as lte, _lte as maximum, _gt as gt, _gte as gte, _gte as minimum, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, } from "../core/index.js";
|
1
node_modules/zod/v4/mini/checks.js
generated
vendored
Normal file
1
node_modules/zod/v4/mini/checks.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { _lt as lt, _lte as lte, _lte as maximum, _gt as gt, _gte as gte, _gte as minimum, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, } from "../core/index.js";
|
47
node_modules/zod/v4/mini/coerce.cjs
generated
vendored
Normal file
47
node_modules/zod/v4/mini/coerce.cjs
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.string = string;
|
||||
exports.number = number;
|
||||
exports.boolean = boolean;
|
||||
exports.bigint = bigint;
|
||||
exports.date = date;
|
||||
const core = __importStar(require("../core/index.cjs"));
|
||||
const schemas = __importStar(require("./schemas.cjs"));
|
||||
function string(params) {
|
||||
return core._coercedString(schemas.ZodMiniString, params);
|
||||
}
|
||||
function number(params) {
|
||||
return core._coercedNumber(schemas.ZodMiniNumber, params);
|
||||
}
|
||||
function boolean(params) {
|
||||
return core._coercedBoolean(schemas.ZodMiniBoolean, params);
|
||||
}
|
||||
function bigint(params) {
|
||||
return core._coercedBigint(schemas.ZodMiniBigInt, params);
|
||||
}
|
||||
function date(params) {
|
||||
return core._coercedDate(schemas.ZodMiniDate, params);
|
||||
}
|
7
node_modules/zod/v4/mini/coerce.d.cts
generated
vendored
Normal file
7
node_modules/zod/v4/mini/coerce.d.cts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import * as core from "../core/index.cjs";
|
||||
import * as schemas from "./schemas.cjs";
|
||||
export declare function string<T = unknown>(params?: string | core.$ZodStringParams): schemas.ZodMiniString<T>;
|
||||
export declare function number<T = unknown>(params?: string | core.$ZodNumberParams): schemas.ZodMiniNumber<T>;
|
||||
export declare function boolean<T = unknown>(params?: string | core.$ZodBooleanParams): schemas.ZodMiniBoolean<T>;
|
||||
export declare function bigint<T = unknown>(params?: string | core.$ZodBigIntParams): schemas.ZodMiniBigInt<T>;
|
||||
export declare function date<T = unknown>(params?: string | core.$ZodDateParams): schemas.ZodMiniDate<T>;
|
7
node_modules/zod/v4/mini/coerce.d.ts
generated
vendored
Normal file
7
node_modules/zod/v4/mini/coerce.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import * as core from "../core/index.js";
|
||||
import * as schemas from "./schemas.js";
|
||||
export declare function string<T = unknown>(params?: string | core.$ZodStringParams): schemas.ZodMiniString<T>;
|
||||
export declare function number<T = unknown>(params?: string | core.$ZodNumberParams): schemas.ZodMiniNumber<T>;
|
||||
export declare function boolean<T = unknown>(params?: string | core.$ZodBooleanParams): schemas.ZodMiniBoolean<T>;
|
||||
export declare function bigint<T = unknown>(params?: string | core.$ZodBigIntParams): schemas.ZodMiniBigInt<T>;
|
||||
export declare function date<T = unknown>(params?: string | core.$ZodDateParams): schemas.ZodMiniDate<T>;
|
17
node_modules/zod/v4/mini/coerce.js
generated
vendored
Normal file
17
node_modules/zod/v4/mini/coerce.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import * as core from "../core/index.js";
|
||||
import * as schemas from "./schemas.js";
|
||||
export function string(params) {
|
||||
return core._coercedString(schemas.ZodMiniString, params);
|
||||
}
|
||||
export function number(params) {
|
||||
return core._coercedNumber(schemas.ZodMiniNumber, params);
|
||||
}
|
||||
export function boolean(params) {
|
||||
return core._coercedBoolean(schemas.ZodMiniBoolean, params);
|
||||
}
|
||||
export function bigint(params) {
|
||||
return core._coercedBigint(schemas.ZodMiniBigInt, params);
|
||||
}
|
||||
export function date(params) {
|
||||
return core._coercedDate(schemas.ZodMiniDate, params);
|
||||
}
|
62
node_modules/zod/v4/mini/external.cjs
generated
vendored
Normal file
62
node_modules/zod/v4/mini/external.cjs
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
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.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);
|
||||
__exportStar(require("./checks.cjs"), exports);
|
||||
var index_js_1 = require("../core/index.cjs");
|
||||
Object.defineProperty(exports, "globalRegistry", { enumerable: true, get: function () { return index_js_1.globalRegistry; } });
|
||||
Object.defineProperty(exports, "registry", { enumerable: true, get: function () { return index_js_1.registry; } });
|
||||
Object.defineProperty(exports, "config", { enumerable: true, get: function () { return index_js_1.config; } });
|
||||
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; } });
|
||||
Object.defineProperty(exports, "prettifyError", { enumerable: true, get: function () { return index_js_1.prettifyError; } });
|
||||
Object.defineProperty(exports, "formatError", { enumerable: true, get: function () { return index_js_1.formatError; } });
|
||||
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, "NEVER", { enumerable: true, get: function () { return index_js_1.NEVER; } });
|
||||
exports.locales = __importStar(require("../locales/index.cjs"));
|
||||
/** A special constant with type `never` */
|
||||
// export const NEVER = {} as never;
|
||||
// iso
|
||||
exports.iso = __importStar(require("./iso.cjs"));
|
||||
var iso_js_1 = require("./iso.cjs");
|
||||
Object.defineProperty(exports, "ZodMiniISODateTime", { enumerable: true, get: function () { return iso_js_1.ZodMiniISODateTime; } });
|
||||
Object.defineProperty(exports, "ZodMiniISODate", { enumerable: true, get: function () { return iso_js_1.ZodMiniISODate; } });
|
||||
Object.defineProperty(exports, "ZodMiniISOTime", { enumerable: true, get: function () { return iso_js_1.ZodMiniISOTime; } });
|
||||
Object.defineProperty(exports, "ZodMiniISODuration", { enumerable: true, get: function () { return iso_js_1.ZodMiniISODuration; } });
|
||||
// coerce
|
||||
exports.coerce = __importStar(require("./coerce.cjs"));
|
11
node_modules/zod/v4/mini/external.d.cts
generated
vendored
Normal file
11
node_modules/zod/v4/mini/external.d.cts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
export * as core from "../core/index.cjs";
|
||||
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, 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";
|
||||
export { ZodMiniISODateTime, ZodMiniISODate, ZodMiniISOTime, ZodMiniISODuration, } from "./iso.cjs";
|
||||
export * as coerce from "./coerce.cjs";
|
11
node_modules/zod/v4/mini/external.d.ts
generated
vendored
Normal file
11
node_modules/zod/v4/mini/external.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
export * as core from "../core/index.js";
|
||||
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, 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";
|
||||
export { ZodMiniISODateTime, ZodMiniISODate, ZodMiniISOTime, ZodMiniISODuration, } from "./iso.js";
|
||||
export * as coerce from "./coerce.js";
|
13
node_modules/zod/v4/mini/external.js
generated
vendored
Normal file
13
node_modules/zod/v4/mini/external.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
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, 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;
|
||||
// iso
|
||||
export * as iso from "./iso.js";
|
||||
export { ZodMiniISODateTime, ZodMiniISODate, ZodMiniISOTime, ZodMiniISODuration, } from "./iso.js";
|
||||
// coerce
|
||||
export * as coerce from "./coerce.js";
|
32
node_modules/zod/v4/mini/index.cjs
generated
vendored
Normal file
32
node_modules/zod/v4/mini/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
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.z = void 0;
|
||||
const z = __importStar(require("./external.cjs"));
|
||||
exports.z = z;
|
||||
__exportStar(require("./external.cjs"), exports);
|
3
node_modules/zod/v4/mini/index.d.cts
generated
vendored
Normal file
3
node_modules/zod/v4/mini/index.d.cts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import * as z from "./external.cjs";
|
||||
export * from "./external.cjs";
|
||||
export { z };
|
3
node_modules/zod/v4/mini/index.d.ts
generated
vendored
Normal file
3
node_modules/zod/v4/mini/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import * as z from "./external.js";
|
||||
export * from "./external.js";
|
||||
export { z };
|
3
node_modules/zod/v4/mini/index.js
generated
vendored
Normal file
3
node_modules/zod/v4/mini/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import * as z from "./external.js";
|
||||
export * from "./external.js";
|
||||
export { z };
|
60
node_modules/zod/v4/mini/iso.cjs
generated
vendored
Normal file
60
node_modules/zod/v4/mini/iso.cjs
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ZodMiniISODuration = exports.ZodMiniISOTime = exports.ZodMiniISODate = exports.ZodMiniISODateTime = void 0;
|
||||
exports.datetime = datetime;
|
||||
exports.date = date;
|
||||
exports.time = time;
|
||||
exports.duration = duration;
|
||||
const core = __importStar(require("../core/index.cjs"));
|
||||
const schemas = __importStar(require("./schemas.cjs"));
|
||||
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("$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("$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("$ZodISODuration", (inst, def) => {
|
||||
core.$ZodISODuration.init(inst, def);
|
||||
schemas.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function duration(params) {
|
||||
return core._isoDuration(exports.ZodMiniISODuration, params);
|
||||
}
|
22
node_modules/zod/v4/mini/iso.d.cts
generated
vendored
Normal file
22
node_modules/zod/v4/mini/iso.d.cts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import * as core from "../core/index.cjs";
|
||||
import * as schemas from "./schemas.cjs";
|
||||
export interface ZodMiniISODateTime extends schemas.ZodMiniStringFormat<"datetime"> {
|
||||
_zod: core.$ZodISODateTimeInternals;
|
||||
}
|
||||
export declare const ZodMiniISODateTime: core.$constructor<ZodMiniISODateTime>;
|
||||
export declare function datetime(params?: string | core.$ZodISODateTimeParams): ZodMiniISODateTime;
|
||||
export interface ZodMiniISODate extends schemas.ZodMiniStringFormat<"date"> {
|
||||
_zod: core.$ZodISODateInternals;
|
||||
}
|
||||
export declare const ZodMiniISODate: core.$constructor<ZodMiniISODate>;
|
||||
export declare function date(params?: string | core.$ZodISODateParams): ZodMiniISODate;
|
||||
export interface ZodMiniISOTime extends schemas.ZodMiniStringFormat<"time"> {
|
||||
_zod: core.$ZodISOTimeInternals;
|
||||
}
|
||||
export declare const ZodMiniISOTime: core.$constructor<ZodMiniISOTime>;
|
||||
export declare function time(params?: string | core.$ZodISOTimeParams): ZodMiniISOTime;
|
||||
export interface ZodMiniISODuration extends schemas.ZodMiniStringFormat<"duration"> {
|
||||
_zod: core.$ZodISODurationInternals;
|
||||
}
|
||||
export declare const ZodMiniISODuration: core.$constructor<ZodMiniISODuration>;
|
||||
export declare function duration(params?: string | core.$ZodISODurationParams): ZodMiniISODuration;
|
22
node_modules/zod/v4/mini/iso.d.ts
generated
vendored
Normal file
22
node_modules/zod/v4/mini/iso.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import * as core from "../core/index.js";
|
||||
import * as schemas from "./schemas.js";
|
||||
export interface ZodMiniISODateTime extends schemas.ZodMiniStringFormat<"datetime"> {
|
||||
_zod: core.$ZodISODateTimeInternals;
|
||||
}
|
||||
export declare const ZodMiniISODateTime: core.$constructor<ZodMiniISODateTime>;
|
||||
export declare function datetime(params?: string | core.$ZodISODateTimeParams): ZodMiniISODateTime;
|
||||
export interface ZodMiniISODate extends schemas.ZodMiniStringFormat<"date"> {
|
||||
_zod: core.$ZodISODateInternals;
|
||||
}
|
||||
export declare const ZodMiniISODate: core.$constructor<ZodMiniISODate>;
|
||||
export declare function date(params?: string | core.$ZodISODateParams): ZodMiniISODate;
|
||||
export interface ZodMiniISOTime extends schemas.ZodMiniStringFormat<"time"> {
|
||||
_zod: core.$ZodISOTimeInternals;
|
||||
}
|
||||
export declare const ZodMiniISOTime: core.$constructor<ZodMiniISOTime>;
|
||||
export declare function time(params?: string | core.$ZodISOTimeParams): ZodMiniISOTime;
|
||||
export interface ZodMiniISODuration extends schemas.ZodMiniStringFormat<"duration"> {
|
||||
_zod: core.$ZodISODurationInternals;
|
||||
}
|
||||
export declare const ZodMiniISODuration: core.$constructor<ZodMiniISODuration>;
|
||||
export declare function duration(params?: string | core.$ZodISODurationParams): ZodMiniISODuration;
|
30
node_modules/zod/v4/mini/iso.js
generated
vendored
Normal file
30
node_modules/zod/v4/mini/iso.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import * as core from "../core/index.js";
|
||||
import * as schemas from "./schemas.js";
|
||||
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("$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("$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("$ZodISODuration", (inst, def) => {
|
||||
core.$ZodISODuration.init(inst, def);
|
||||
schemas.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function duration(params) {
|
||||
return core._isoDuration(ZodMiniISODuration, params);
|
||||
}
|
8
node_modules/zod/v4/mini/parse.cjs
generated
vendored
Normal file
8
node_modules/zod/v4/mini/parse.cjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
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; } });
|
1
node_modules/zod/v4/mini/parse.d.cts
generated
vendored
Normal file
1
node_modules/zod/v4/mini/parse.d.cts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { parse, safeParse, parseAsync, safeParseAsync } from "../core/index.cjs";
|
1
node_modules/zod/v4/mini/parse.d.ts
generated
vendored
Normal file
1
node_modules/zod/v4/mini/parse.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { parse, safeParse, parseAsync, safeParseAsync } from "../core/index.js";
|
1
node_modules/zod/v4/mini/parse.js
generated
vendored
Normal file
1
node_modules/zod/v4/mini/parse.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { parse, safeParse, parseAsync, safeParseAsync } from "../core/index.js";
|
839
node_modules/zod/v4/mini/schemas.cjs
generated
vendored
Normal file
839
node_modules/zod/v4/mini/schemas.cjs
generated
vendored
Normal file
@@ -0,0 +1,839 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
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;
|
||||
exports.uuid = uuid;
|
||||
exports.uuidv4 = uuidv4;
|
||||
exports.uuidv6 = uuidv6;
|
||||
exports.uuidv7 = uuidv7;
|
||||
exports.url = url;
|
||||
exports.emoji = emoji;
|
||||
exports.nanoid = nanoid;
|
||||
exports.cuid = cuid;
|
||||
exports.cuid2 = cuid2;
|
||||
exports.ulid = ulid;
|
||||
exports.xid = xid;
|
||||
exports.ksuid = ksuid;
|
||||
exports.ipv4 = ipv4;
|
||||
exports.ipv6 = ipv6;
|
||||
exports.cidrv4 = cidrv4;
|
||||
exports.cidrv6 = cidrv6;
|
||||
exports.base64 = base64;
|
||||
exports.base64url = base64url;
|
||||
exports.e164 = e164;
|
||||
exports.jwt = jwt;
|
||||
exports.stringFormat = stringFormat;
|
||||
exports.number = number;
|
||||
exports.int = int;
|
||||
exports.float32 = float32;
|
||||
exports.float64 = float64;
|
||||
exports.int32 = int32;
|
||||
exports.uint32 = uint32;
|
||||
exports.boolean = boolean;
|
||||
exports.bigint = bigint;
|
||||
exports.int64 = int64;
|
||||
exports.uint64 = uint64;
|
||||
exports.symbol = symbol;
|
||||
exports.undefined = _undefined;
|
||||
exports.null = _null;
|
||||
exports.any = any;
|
||||
exports.unknown = unknown;
|
||||
exports.never = never;
|
||||
exports.void = _void;
|
||||
exports.date = date;
|
||||
exports.array = array;
|
||||
exports.keyof = keyof;
|
||||
exports.object = object;
|
||||
exports.strictObject = strictObject;
|
||||
exports.looseObject = looseObject;
|
||||
exports.extend = extend;
|
||||
exports.merge = merge;
|
||||
exports.pick = pick;
|
||||
exports.omit = omit;
|
||||
exports.partial = partial;
|
||||
exports.required = required;
|
||||
exports.catchall = catchall;
|
||||
exports.union = union;
|
||||
exports.discriminatedUnion = discriminatedUnion;
|
||||
exports.intersection = intersection;
|
||||
exports.tuple = tuple;
|
||||
exports.record = record;
|
||||
exports.partialRecord = partialRecord;
|
||||
exports.map = map;
|
||||
exports.set = set;
|
||||
exports.enum = _enum;
|
||||
exports.nativeEnum = nativeEnum;
|
||||
exports.literal = literal;
|
||||
exports.file = file;
|
||||
exports.transform = transform;
|
||||
exports.optional = optional;
|
||||
exports.nullable = nullable;
|
||||
exports.nullish = nullish;
|
||||
exports._default = _default;
|
||||
exports.prefault = prefault;
|
||||
exports.nonoptional = nonoptional;
|
||||
exports.success = success;
|
||||
exports.catch = _catch;
|
||||
exports.nan = nan;
|
||||
exports.pipe = pipe;
|
||||
exports.readonly = readonly;
|
||||
exports.templateLiteral = templateLiteral;
|
||||
exports.lazy = _lazy;
|
||||
exports.promise = promise;
|
||||
exports.check = check;
|
||||
exports.custom = custom;
|
||||
exports.refine = refine;
|
||||
exports.instanceof = _instanceof;
|
||||
exports.json = json;
|
||||
const core = __importStar(require("../core/index.cjs"));
|
||||
const index_js_1 = require("../core/index.cjs");
|
||||
const parse = __importStar(require("./parse.cjs"));
|
||||
exports.ZodMiniType = core.$constructor("ZodMiniType", (inst, def) => {
|
||||
if (!inst._zod)
|
||||
throw new Error("Uninitialized schema in ZodMiniType.");
|
||||
core.$ZodType.init(inst, def);
|
||||
inst.def = def;
|
||||
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 });
|
||||
inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);
|
||||
inst.check = (...checks) => {
|
||||
return inst.clone({
|
||||
...def,
|
||||
checks: [
|
||||
...(def.checks ?? []),
|
||||
...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch),
|
||||
],
|
||||
}
|
||||
// { parent: true }
|
||||
);
|
||||
};
|
||||
inst.clone = (_def, params) => core.clone(inst, _def, params);
|
||||
inst.brand = () => inst;
|
||||
inst.register = ((reg, meta) => {
|
||||
reg.add(inst, meta);
|
||||
return inst;
|
||||
});
|
||||
});
|
||||
exports.ZodMiniString = core.$constructor("ZodMiniString", (inst, def) => {
|
||||
core.$ZodString.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function string(params) {
|
||||
return core._string(exports.ZodMiniString, params);
|
||||
}
|
||||
exports.ZodMiniStringFormat = core.$constructor("ZodMiniStringFormat", (inst, def) => {
|
||||
core.$ZodStringFormat.init(inst, def);
|
||||
exports.ZodMiniString.init(inst, def);
|
||||
});
|
||||
exports.ZodMiniEmail = core.$constructor("ZodMiniEmail", (inst, def) => {
|
||||
core.$ZodEmail.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function email(params) {
|
||||
return core._email(exports.ZodMiniEmail, params);
|
||||
}
|
||||
exports.ZodMiniGUID = core.$constructor("ZodMiniGUID", (inst, def) => {
|
||||
core.$ZodGUID.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function guid(params) {
|
||||
return core._guid(exports.ZodMiniGUID, params);
|
||||
}
|
||||
exports.ZodMiniUUID = core.$constructor("ZodMiniUUID", (inst, def) => {
|
||||
core.$ZodUUID.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function uuid(params) {
|
||||
return core._uuid(exports.ZodMiniUUID, params);
|
||||
}
|
||||
function uuidv4(params) {
|
||||
return core._uuidv4(exports.ZodMiniUUID, params);
|
||||
}
|
||||
// ZodMiniUUIDv6
|
||||
function uuidv6(params) {
|
||||
return core._uuidv6(exports.ZodMiniUUID, params);
|
||||
}
|
||||
// ZodMiniUUIDv7
|
||||
function uuidv7(params) {
|
||||
return core._uuidv7(exports.ZodMiniUUID, params);
|
||||
}
|
||||
exports.ZodMiniURL = core.$constructor("ZodMiniURL", (inst, def) => {
|
||||
core.$ZodURL.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function url(params) {
|
||||
return core._url(exports.ZodMiniURL, params);
|
||||
}
|
||||
exports.ZodMiniEmoji = core.$constructor("ZodMiniEmoji", (inst, def) => {
|
||||
core.$ZodEmoji.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function emoji(params) {
|
||||
return core._emoji(exports.ZodMiniEmoji, params);
|
||||
}
|
||||
exports.ZodMiniNanoID = core.$constructor("ZodMiniNanoID", (inst, def) => {
|
||||
core.$ZodNanoID.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function nanoid(params) {
|
||||
return core._nanoid(exports.ZodMiniNanoID, params);
|
||||
}
|
||||
exports.ZodMiniCUID = core.$constructor("ZodMiniCUID", (inst, def) => {
|
||||
core.$ZodCUID.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function cuid(params) {
|
||||
return core._cuid(exports.ZodMiniCUID, params);
|
||||
}
|
||||
exports.ZodMiniCUID2 = core.$constructor("ZodMiniCUID2", (inst, def) => {
|
||||
core.$ZodCUID2.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function cuid2(params) {
|
||||
return core._cuid2(exports.ZodMiniCUID2, params);
|
||||
}
|
||||
exports.ZodMiniULID = core.$constructor("ZodMiniULID", (inst, def) => {
|
||||
core.$ZodULID.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function ulid(params) {
|
||||
return core._ulid(exports.ZodMiniULID, params);
|
||||
}
|
||||
exports.ZodMiniXID = core.$constructor("ZodMiniXID", (inst, def) => {
|
||||
core.$ZodXID.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function xid(params) {
|
||||
return core._xid(exports.ZodMiniXID, params);
|
||||
}
|
||||
exports.ZodMiniKSUID = core.$constructor("ZodMiniKSUID", (inst, def) => {
|
||||
core.$ZodKSUID.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function ksuid(params) {
|
||||
return core._ksuid(exports.ZodMiniKSUID, params);
|
||||
}
|
||||
exports.ZodMiniIPv4 = core.$constructor("ZodMiniIPv4", (inst, def) => {
|
||||
core.$ZodIPv4.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function ipv4(params) {
|
||||
return core._ipv4(exports.ZodMiniIPv4, params);
|
||||
}
|
||||
exports.ZodMiniIPv6 = core.$constructor("ZodMiniIPv6", (inst, def) => {
|
||||
core.$ZodIPv6.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function ipv6(params) {
|
||||
return core._ipv6(exports.ZodMiniIPv6, params);
|
||||
}
|
||||
exports.ZodMiniCIDRv4 = core.$constructor("ZodMiniCIDRv4", (inst, def) => {
|
||||
core.$ZodCIDRv4.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function cidrv4(params) {
|
||||
return core._cidrv4(exports.ZodMiniCIDRv4, params);
|
||||
}
|
||||
exports.ZodMiniCIDRv6 = core.$constructor("ZodMiniCIDRv6", (inst, def) => {
|
||||
core.$ZodCIDRv6.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function cidrv6(params) {
|
||||
return core._cidrv6(exports.ZodMiniCIDRv6, params);
|
||||
}
|
||||
exports.ZodMiniBase64 = core.$constructor("ZodMiniBase64", (inst, def) => {
|
||||
core.$ZodBase64.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function base64(params) {
|
||||
return core._base64(exports.ZodMiniBase64, params);
|
||||
}
|
||||
exports.ZodMiniBase64URL = core.$constructor("ZodMiniBase64URL", (inst, def) => {
|
||||
core.$ZodBase64URL.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function base64url(params) {
|
||||
return core._base64url(exports.ZodMiniBase64URL, params);
|
||||
}
|
||||
exports.ZodMiniE164 = core.$constructor("ZodMiniE164", (inst, def) => {
|
||||
core.$ZodE164.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function e164(params) {
|
||||
return core._e164(exports.ZodMiniE164, params);
|
||||
}
|
||||
exports.ZodMiniJWT = core.$constructor("ZodMiniJWT", (inst, def) => {
|
||||
core.$ZodJWT.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function jwt(params) {
|
||||
return core._jwt(exports.ZodMiniJWT, params);
|
||||
}
|
||||
exports.ZodMiniCustomStringFormat = core.$constructor("ZodMiniCustomStringFormat", (inst, def) => {
|
||||
core.$ZodCustomStringFormat.init(inst, def);
|
||||
exports.ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
function stringFormat(format, fnOrRegex, _params = {}) {
|
||||
return core._stringFormat(exports.ZodMiniCustomStringFormat, format, fnOrRegex, _params);
|
||||
}
|
||||
exports.ZodMiniNumber = core.$constructor("ZodMiniNumber", (inst, def) => {
|
||||
core.$ZodNumber.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function number(params) {
|
||||
return core._number(exports.ZodMiniNumber, params);
|
||||
}
|
||||
exports.ZodMiniNumberFormat = core.$constructor("ZodMiniNumberFormat", (inst, def) => {
|
||||
core.$ZodNumberFormat.init(inst, def);
|
||||
exports.ZodMiniNumber.init(inst, def);
|
||||
});
|
||||
// int
|
||||
function int(params) {
|
||||
return core._int(exports.ZodMiniNumberFormat, params);
|
||||
}
|
||||
// float32
|
||||
function float32(params) {
|
||||
return core._float32(exports.ZodMiniNumberFormat, params);
|
||||
}
|
||||
// float64
|
||||
function float64(params) {
|
||||
return core._float64(exports.ZodMiniNumberFormat, params);
|
||||
}
|
||||
// int32
|
||||
function int32(params) {
|
||||
return core._int32(exports.ZodMiniNumberFormat, params);
|
||||
}
|
||||
// uint32
|
||||
function uint32(params) {
|
||||
return core._uint32(exports.ZodMiniNumberFormat, params);
|
||||
}
|
||||
exports.ZodMiniBoolean = core.$constructor("ZodMiniBoolean", (inst, def) => {
|
||||
core.$ZodBoolean.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function boolean(params) {
|
||||
return core._boolean(exports.ZodMiniBoolean, params);
|
||||
}
|
||||
exports.ZodMiniBigInt = core.$constructor("ZodMiniBigInt", (inst, def) => {
|
||||
core.$ZodBigInt.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function bigint(params) {
|
||||
return core._bigint(exports.ZodMiniBigInt, params);
|
||||
}
|
||||
exports.ZodMiniBigIntFormat = core.$constructor("ZodMiniBigIntFormat", (inst, def) => {
|
||||
core.$ZodBigIntFormat.init(inst, def);
|
||||
exports.ZodMiniBigInt.init(inst, def);
|
||||
});
|
||||
// int64
|
||||
function int64(params) {
|
||||
return core._int64(exports.ZodMiniBigIntFormat, params);
|
||||
}
|
||||
// uint64
|
||||
function uint64(params) {
|
||||
return core._uint64(exports.ZodMiniBigIntFormat, params);
|
||||
}
|
||||
exports.ZodMiniSymbol = core.$constructor("ZodMiniSymbol", (inst, def) => {
|
||||
core.$ZodSymbol.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function symbol(params) {
|
||||
return core._symbol(exports.ZodMiniSymbol, params);
|
||||
}
|
||||
exports.ZodMiniUndefined = core.$constructor("ZodMiniUndefined", (inst, def) => {
|
||||
core.$ZodUndefined.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function _undefined(params) {
|
||||
return core._undefined(exports.ZodMiniUndefined, params);
|
||||
}
|
||||
exports.ZodMiniNull = core.$constructor("ZodMiniNull", (inst, def) => {
|
||||
core.$ZodNull.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function _null(params) {
|
||||
return core._null(exports.ZodMiniNull, params);
|
||||
}
|
||||
exports.ZodMiniAny = core.$constructor("ZodMiniAny", (inst, def) => {
|
||||
core.$ZodAny.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function any() {
|
||||
return core._any(exports.ZodMiniAny);
|
||||
}
|
||||
exports.ZodMiniUnknown = core.$constructor("ZodMiniUnknown", (inst, def) => {
|
||||
core.$ZodUnknown.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function unknown() {
|
||||
return core._unknown(exports.ZodMiniUnknown);
|
||||
}
|
||||
exports.ZodMiniNever = core.$constructor("ZodMiniNever", (inst, def) => {
|
||||
core.$ZodNever.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function never(params) {
|
||||
return core._never(exports.ZodMiniNever, params);
|
||||
}
|
||||
exports.ZodMiniVoid = core.$constructor("ZodMiniVoid", (inst, def) => {
|
||||
core.$ZodVoid.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function _void(params) {
|
||||
return core._void(exports.ZodMiniVoid, params);
|
||||
}
|
||||
exports.ZodMiniDate = core.$constructor("ZodMiniDate", (inst, def) => {
|
||||
core.$ZodDate.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function date(params) {
|
||||
return core._date(exports.ZodMiniDate, params);
|
||||
}
|
||||
exports.ZodMiniArray = core.$constructor("ZodMiniArray", (inst, def) => {
|
||||
core.$ZodArray.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function array(element, params) {
|
||||
return new exports.ZodMiniArray({
|
||||
type: "array",
|
||||
element: element,
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
// .keyof
|
||||
function keyof(schema) {
|
||||
const shape = schema._zod.def.shape;
|
||||
return literal(Object.keys(shape));
|
||||
}
|
||||
exports.ZodMiniObject = core.$constructor("ZodMiniObject", (inst, def) => {
|
||||
core.$ZodObject.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
index_js_1.util.defineLazy(inst, "shape", () => def.shape);
|
||||
});
|
||||
function object(shape, params) {
|
||||
const def = {
|
||||
type: "object",
|
||||
get shape() {
|
||||
index_js_1.util.assignProp(this, "shape", { ...shape });
|
||||
return this.shape;
|
||||
},
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
};
|
||||
return new exports.ZodMiniObject(def);
|
||||
}
|
||||
// strictObject
|
||||
function strictObject(shape, params) {
|
||||
return new exports.ZodMiniObject({
|
||||
type: "object",
|
||||
// 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),
|
||||
});
|
||||
}
|
||||
// looseObject
|
||||
function looseObject(shape, params) {
|
||||
return new exports.ZodMiniObject({
|
||||
type: "object",
|
||||
// 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),
|
||||
});
|
||||
}
|
||||
// object methods
|
||||
function extend(schema, shape) {
|
||||
return index_js_1.util.extend(schema, shape);
|
||||
}
|
||||
function merge(schema, shape) {
|
||||
return index_js_1.util.extend(schema, shape);
|
||||
}
|
||||
function pick(schema, mask) {
|
||||
return index_js_1.util.pick(schema, mask);
|
||||
}
|
||||
// .omit
|
||||
function omit(schema, mask) {
|
||||
return index_js_1.util.omit(schema, mask);
|
||||
}
|
||||
function partial(schema, mask) {
|
||||
return index_js_1.util.partial(exports.ZodMiniOptional, schema, mask);
|
||||
}
|
||||
function required(schema, mask) {
|
||||
return index_js_1.util.required(exports.ZodMiniNonOptional, schema, mask);
|
||||
}
|
||||
function catchall(inst, catchall) {
|
||||
return inst.clone({ ...inst._zod.def, catchall: catchall });
|
||||
}
|
||||
exports.ZodMiniUnion = core.$constructor("ZodMiniUnion", (inst, def) => {
|
||||
core.$ZodUnion.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function union(options, params) {
|
||||
return new exports.ZodMiniUnion({
|
||||
type: "union",
|
||||
options: options,
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
exports.ZodMiniDiscriminatedUnion = core.$constructor("ZodMiniDiscriminatedUnion", (inst, def) => {
|
||||
core.$ZodDiscriminatedUnion.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function discriminatedUnion(discriminator, options, params) {
|
||||
return new exports.ZodMiniDiscriminatedUnion({
|
||||
type: "union",
|
||||
options,
|
||||
discriminator,
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
exports.ZodMiniIntersection = core.$constructor("ZodMiniIntersection", (inst, def) => {
|
||||
core.$ZodIntersection.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function intersection(left, right) {
|
||||
return new exports.ZodMiniIntersection({
|
||||
type: "intersection",
|
||||
left: left,
|
||||
right: right,
|
||||
});
|
||||
}
|
||||
exports.ZodMiniTuple = core.$constructor("ZodMiniTuple", (inst, def) => {
|
||||
core.$ZodTuple.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function tuple(items, _paramsOrRest, _params) {
|
||||
const hasRest = _paramsOrRest instanceof core.$ZodType;
|
||||
const params = hasRest ? _params : _paramsOrRest;
|
||||
const rest = hasRest ? _paramsOrRest : null;
|
||||
return new exports.ZodMiniTuple({
|
||||
type: "tuple",
|
||||
items: items,
|
||||
rest,
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
exports.ZodMiniRecord = core.$constructor("ZodMiniRecord", (inst, def) => {
|
||||
core.$ZodRecord.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function record(keyType, valueType, params) {
|
||||
return new exports.ZodMiniRecord({
|
||||
type: "record",
|
||||
keyType,
|
||||
valueType: valueType,
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
function partialRecord(keyType, valueType, params) {
|
||||
return new exports.ZodMiniRecord({
|
||||
type: "record",
|
||||
keyType: union([keyType, never()]),
|
||||
valueType: valueType,
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
exports.ZodMiniMap = core.$constructor("ZodMiniMap", (inst, def) => {
|
||||
core.$ZodMap.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function map(keyType, valueType, params) {
|
||||
return new exports.ZodMiniMap({
|
||||
type: "map",
|
||||
keyType: keyType,
|
||||
valueType: valueType,
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
exports.ZodMiniSet = core.$constructor("ZodMiniSet", (inst, def) => {
|
||||
core.$ZodSet.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function set(valueType, params) {
|
||||
return new exports.ZodMiniSet({
|
||||
type: "set",
|
||||
valueType: valueType,
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
exports.ZodMiniEnum = core.$constructor("ZodMiniEnum", (inst, def) => {
|
||||
core.$ZodEnum.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function _enum(values, params) {
|
||||
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
||||
return new exports.ZodMiniEnum({
|
||||
type: "enum",
|
||||
entries,
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
|
||||
*
|
||||
* ```ts
|
||||
* enum Colors { red, green, blue }
|
||||
* z.enum(Colors);
|
||||
* ```
|
||||
*/
|
||||
function nativeEnum(entries, params) {
|
||||
return new exports.ZodMiniEnum({
|
||||
type: "enum",
|
||||
entries,
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
exports.ZodMiniLiteral = core.$constructor("ZodMiniLiteral", (inst, def) => {
|
||||
core.$ZodLiteral.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function literal(value, params) {
|
||||
return new exports.ZodMiniLiteral({
|
||||
type: "literal",
|
||||
values: Array.isArray(value) ? value : [value],
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
exports.ZodMiniFile = core.$constructor("ZodMiniFile", (inst, def) => {
|
||||
core.$ZodFile.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function file(params) {
|
||||
return core._file(exports.ZodMiniFile, params);
|
||||
}
|
||||
exports.ZodMiniTransform = core.$constructor("ZodMiniTransform", (inst, def) => {
|
||||
core.$ZodTransform.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function transform(fn) {
|
||||
return new exports.ZodMiniTransform({
|
||||
type: "transform",
|
||||
transform: fn,
|
||||
});
|
||||
}
|
||||
exports.ZodMiniOptional = core.$constructor("ZodMiniOptional", (inst, def) => {
|
||||
core.$ZodOptional.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function optional(innerType) {
|
||||
return new exports.ZodMiniOptional({
|
||||
type: "optional",
|
||||
innerType: innerType,
|
||||
});
|
||||
}
|
||||
exports.ZodMiniNullable = core.$constructor("ZodMiniNullable", (inst, def) => {
|
||||
core.$ZodNullable.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function nullable(innerType) {
|
||||
return new exports.ZodMiniNullable({
|
||||
type: "nullable",
|
||||
innerType: innerType,
|
||||
});
|
||||
}
|
||||
// nullish
|
||||
function nullish(innerType) {
|
||||
return optional(nullable(innerType));
|
||||
}
|
||||
exports.ZodMiniDefault = core.$constructor("ZodMiniDefault", (inst, def) => {
|
||||
core.$ZodDefault.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function _default(innerType, defaultValue) {
|
||||
return new exports.ZodMiniDefault({
|
||||
type: "default",
|
||||
innerType: innerType,
|
||||
get defaultValue() {
|
||||
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
||||
},
|
||||
});
|
||||
}
|
||||
exports.ZodMiniPrefault = core.$constructor("ZodMiniPrefault", (inst, def) => {
|
||||
core.$ZodPrefault.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function prefault(innerType, defaultValue) {
|
||||
return new exports.ZodMiniPrefault({
|
||||
type: "prefault",
|
||||
innerType: innerType,
|
||||
get defaultValue() {
|
||||
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
||||
},
|
||||
});
|
||||
}
|
||||
exports.ZodMiniNonOptional = core.$constructor("ZodMiniNonOptional", (inst, def) => {
|
||||
core.$ZodNonOptional.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function nonoptional(innerType, params) {
|
||||
return new exports.ZodMiniNonOptional({
|
||||
type: "nonoptional",
|
||||
innerType: innerType,
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
exports.ZodMiniSuccess = core.$constructor("ZodMiniSuccess", (inst, def) => {
|
||||
core.$ZodSuccess.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function success(innerType) {
|
||||
return new exports.ZodMiniSuccess({
|
||||
type: "success",
|
||||
innerType: innerType,
|
||||
});
|
||||
}
|
||||
exports.ZodMiniCatch = core.$constructor("ZodMiniCatch", (inst, def) => {
|
||||
core.$ZodCatch.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function _catch(innerType, catchValue) {
|
||||
return new exports.ZodMiniCatch({
|
||||
type: "catch",
|
||||
innerType: innerType,
|
||||
catchValue: (typeof catchValue === "function" ? catchValue : () => catchValue),
|
||||
});
|
||||
}
|
||||
exports.ZodMiniNaN = core.$constructor("ZodMiniNaN", (inst, def) => {
|
||||
core.$ZodNaN.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function nan(params) {
|
||||
return core._nan(exports.ZodMiniNaN, params);
|
||||
}
|
||||
exports.ZodMiniPipe = core.$constructor("ZodMiniPipe", (inst, def) => {
|
||||
core.$ZodPipe.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function pipe(in_, out) {
|
||||
return new exports.ZodMiniPipe({
|
||||
type: "pipe",
|
||||
in: in_,
|
||||
out: out,
|
||||
});
|
||||
}
|
||||
exports.ZodMiniReadonly = core.$constructor("ZodMiniReadonly", (inst, def) => {
|
||||
core.$ZodReadonly.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function readonly(innerType) {
|
||||
return new exports.ZodMiniReadonly({
|
||||
type: "readonly",
|
||||
innerType: innerType,
|
||||
});
|
||||
}
|
||||
exports.ZodMiniTemplateLiteral = core.$constructor("ZodMiniTemplateLiteral", (inst, def) => {
|
||||
core.$ZodTemplateLiteral.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function templateLiteral(parts, params) {
|
||||
return new exports.ZodMiniTemplateLiteral({
|
||||
type: "template_literal",
|
||||
parts,
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
exports.ZodMiniLazy = core.$constructor("ZodMiniLazy", (inst, def) => {
|
||||
core.$ZodLazy.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
// export function lazy<T extends object>(getter: () => T): T {
|
||||
// return util.createTransparentProxy<T>(getter);
|
||||
// }
|
||||
function _lazy(getter) {
|
||||
return new exports.ZodMiniLazy({
|
||||
type: "lazy",
|
||||
getter: getter,
|
||||
});
|
||||
}
|
||||
exports.ZodMiniPromise = core.$constructor("ZodMiniPromise", (inst, def) => {
|
||||
core.$ZodPromise.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
function promise(innerType) {
|
||||
return new exports.ZodMiniPromise({
|
||||
type: "promise",
|
||||
innerType: innerType,
|
||||
});
|
||||
}
|
||||
exports.ZodMiniCustom = core.$constructor("ZodMiniCustom", (inst, def) => {
|
||||
core.$ZodCustom.init(inst, def);
|
||||
exports.ZodMiniType.init(inst, def);
|
||||
});
|
||||
// custom checks
|
||||
function check(fn, params) {
|
||||
const ch = new core.$ZodCheck({
|
||||
check: "custom",
|
||||
...index_js_1.util.normalizeParams(params),
|
||||
});
|
||||
ch._zod.check = fn;
|
||||
return ch;
|
||||
}
|
||||
// ZodCustom
|
||||
// custom schema
|
||||
function custom(fn, _params) {
|
||||
return core._custom(exports.ZodMiniCustom, fn ?? (() => true), _params);
|
||||
}
|
||||
// refine
|
||||
function refine(fn, _params = {}) {
|
||||
return core._refine(exports.ZodMiniCustom, fn, _params);
|
||||
}
|
||||
// instanceof
|
||||
class Class {
|
||||
constructor(..._args) { }
|
||||
}
|
||||
function _instanceof(cls, params = {
|
||||
error: `Input not instance of ${cls.name}`,
|
||||
}) {
|
||||
const inst = custom((data) => data instanceof cls, params);
|
||||
inst._zod.bag.Class = cls;
|
||||
return inst;
|
||||
}
|
||||
// stringbool
|
||||
const stringbool = (...args) => core._stringbool({
|
||||
Pipe: exports.ZodMiniPipe,
|
||||
Boolean: exports.ZodMiniBoolean,
|
||||
String: exports.ZodMiniString,
|
||||
Transform: exports.ZodMiniTransform,
|
||||
}, ...args);
|
||||
exports.stringbool = stringbool;
|
||||
function json() {
|
||||
const jsonSchema = _lazy(() => {
|
||||
return union([string(), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);
|
||||
});
|
||||
return jsonSchema;
|
||||
}
|
356
node_modules/zod/v4/mini/schemas.d.cts
generated
vendored
Normal file
356
node_modules/zod/v4/mini/schemas.d.cts
generated
vendored
Normal file
@@ -0,0 +1,356 @@
|
||||
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> {
|
||||
check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
|
||||
clone(def?: Internals["def"], params?: {
|
||||
parent: boolean;
|
||||
}): this;
|
||||
register<R extends core.$ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [core.$replace<R["_meta"], this>?] : [core.$replace<R["_meta"], this>] : ["Incompatible schema"]): this;
|
||||
brand<T extends PropertyKey = PropertyKey>(value?: T): PropertyKey extends T ? this : this & Record<"_zod", Record<"output", core.output<this> & core.$brand<T>>>;
|
||||
def: Internals["def"];
|
||||
parse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
|
||||
safeParse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): util.SafeParseResult<core.output<this>>;
|
||||
parseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
|
||||
safeParseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<util.SafeParseResult<core.output<this>>>;
|
||||
}
|
||||
interface _ZodMiniType<out Internals extends core.$ZodTypeInternals = core.$ZodTypeInternals> extends ZodMiniType<any, any, Internals> {
|
||||
}
|
||||
export declare const ZodMiniType: core.$constructor<ZodMiniType>;
|
||||
export interface _ZodMiniString<T extends core.$ZodStringInternals<unknown> = core.$ZodStringInternals<unknown>> extends _ZodMiniType<T>, core.$ZodString<T["input"]> {
|
||||
_zod: T;
|
||||
}
|
||||
export interface ZodMiniString<Input = unknown> extends _ZodMiniString<core.$ZodStringInternals<Input>>, core.$ZodString<Input> {
|
||||
}
|
||||
export declare const ZodMiniString: core.$constructor<ZodMiniString>;
|
||||
export declare function string(params?: string | core.$ZodStringParams): ZodMiniString<string>;
|
||||
export interface ZodMiniStringFormat<Format extends string = string> extends _ZodMiniString<core.$ZodStringFormatInternals<Format>>, core.$ZodStringFormat<Format> {
|
||||
}
|
||||
export declare const ZodMiniStringFormat: core.$constructor<ZodMiniStringFormat>;
|
||||
export interface ZodMiniEmail extends _ZodMiniString<core.$ZodEmailInternals> {
|
||||
}
|
||||
export declare const ZodMiniEmail: core.$constructor<ZodMiniEmail>;
|
||||
export declare function email(params?: string | core.$ZodEmailParams): ZodMiniEmail;
|
||||
export interface ZodMiniGUID extends _ZodMiniString<core.$ZodGUIDInternals> {
|
||||
}
|
||||
export declare const ZodMiniGUID: core.$constructor<ZodMiniGUID>;
|
||||
export declare function guid(params?: string | core.$ZodGUIDParams): ZodMiniGUID;
|
||||
export interface ZodMiniUUID extends _ZodMiniString<core.$ZodUUIDInternals> {
|
||||
}
|
||||
export declare const ZodMiniUUID: core.$constructor<ZodMiniUUID>;
|
||||
export declare function uuid(params?: string | core.$ZodUUIDParams): ZodMiniUUID;
|
||||
export declare function uuidv4(params?: string | core.$ZodUUIDv4Params): ZodMiniUUID;
|
||||
export declare function uuidv6(params?: string | core.$ZodUUIDv6Params): ZodMiniUUID;
|
||||
export declare function uuidv7(params?: string | core.$ZodUUIDv7Params): ZodMiniUUID;
|
||||
export interface ZodMiniURL extends _ZodMiniString<core.$ZodURLInternals> {
|
||||
}
|
||||
export declare const ZodMiniURL: core.$constructor<ZodMiniURL>;
|
||||
export declare function url(params?: string | core.$ZodURLParams): ZodMiniURL;
|
||||
export interface ZodMiniEmoji extends _ZodMiniString<core.$ZodEmojiInternals> {
|
||||
}
|
||||
export declare const ZodMiniEmoji: core.$constructor<ZodMiniEmoji>;
|
||||
export declare function emoji(params?: string | core.$ZodEmojiParams): ZodMiniEmoji;
|
||||
export interface ZodMiniNanoID extends _ZodMiniString<core.$ZodNanoIDInternals> {
|
||||
}
|
||||
export declare const ZodMiniNanoID: core.$constructor<ZodMiniNanoID>;
|
||||
export declare function nanoid(params?: string | core.$ZodNanoIDParams): ZodMiniNanoID;
|
||||
export interface ZodMiniCUID extends _ZodMiniString<core.$ZodCUIDInternals> {
|
||||
}
|
||||
export declare const ZodMiniCUID: core.$constructor<ZodMiniCUID>;
|
||||
export declare function cuid(params?: string | core.$ZodCUIDParams): ZodMiniCUID;
|
||||
export interface ZodMiniCUID2 extends _ZodMiniString<core.$ZodCUID2Internals> {
|
||||
}
|
||||
export declare const ZodMiniCUID2: core.$constructor<ZodMiniCUID2>;
|
||||
export declare function cuid2(params?: string | core.$ZodCUID2Params): ZodMiniCUID2;
|
||||
export interface ZodMiniULID extends _ZodMiniString<core.$ZodULIDInternals> {
|
||||
}
|
||||
export declare const ZodMiniULID: core.$constructor<ZodMiniULID>;
|
||||
export declare function ulid(params?: string | core.$ZodULIDParams): ZodMiniULID;
|
||||
export interface ZodMiniXID extends _ZodMiniString<core.$ZodXIDInternals> {
|
||||
}
|
||||
export declare const ZodMiniXID: core.$constructor<ZodMiniXID>;
|
||||
export declare function xid(params?: string | core.$ZodXIDParams): ZodMiniXID;
|
||||
export interface ZodMiniKSUID extends _ZodMiniString<core.$ZodKSUIDInternals> {
|
||||
}
|
||||
export declare const ZodMiniKSUID: core.$constructor<ZodMiniKSUID>;
|
||||
export declare function ksuid(params?: string | core.$ZodKSUIDParams): ZodMiniKSUID;
|
||||
export interface ZodMiniIPv4 extends _ZodMiniString<core.$ZodIPv4Internals> {
|
||||
}
|
||||
export declare const ZodMiniIPv4: core.$constructor<ZodMiniIPv4>;
|
||||
export declare function ipv4(params?: string | core.$ZodIPv4Params): ZodMiniIPv4;
|
||||
export interface ZodMiniIPv6 extends _ZodMiniString<core.$ZodIPv6Internals> {
|
||||
}
|
||||
export declare const ZodMiniIPv6: core.$constructor<ZodMiniIPv6>;
|
||||
export declare function ipv6(params?: string | core.$ZodIPv6Params): ZodMiniIPv6;
|
||||
export interface ZodMiniCIDRv4 extends _ZodMiniString<core.$ZodCIDRv4Internals> {
|
||||
}
|
||||
export declare const ZodMiniCIDRv4: core.$constructor<ZodMiniCIDRv4>;
|
||||
export declare function cidrv4(params?: string | core.$ZodCIDRv4Params): ZodMiniCIDRv4;
|
||||
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 ZodMiniBase64 extends _ZodMiniString<core.$ZodBase64Internals> {
|
||||
}
|
||||
export declare const ZodMiniBase64: core.$constructor<ZodMiniBase64>;
|
||||
export declare function base64(params?: string | core.$ZodBase64Params): ZodMiniBase64;
|
||||
export interface ZodMiniBase64URL extends _ZodMiniString<core.$ZodBase64URLInternals> {
|
||||
}
|
||||
export declare const ZodMiniBase64URL: core.$constructor<ZodMiniBase64URL>;
|
||||
export declare function base64url(params?: string | core.$ZodBase64URLParams): ZodMiniBase64URL;
|
||||
export interface ZodMiniE164 extends _ZodMiniString<core.$ZodE164Internals> {
|
||||
}
|
||||
export declare const ZodMiniE164: core.$constructor<ZodMiniE164>;
|
||||
export declare function e164(params?: string | core.$ZodE164Params): ZodMiniE164;
|
||||
export interface ZodMiniJWT extends _ZodMiniString<core.$ZodJWTInternals> {
|
||||
}
|
||||
export declare const ZodMiniJWT: core.$constructor<ZodMiniJWT>;
|
||||
export declare function jwt(params?: string | core.$ZodJWTParams): ZodMiniJWT;
|
||||
export interface ZodMiniCustomStringFormat<Format extends string = string> extends ZodMiniStringFormat<Format>, core.$ZodCustomStringFormat<Format> {
|
||||
_zod: core.$ZodCustomStringFormatInternals<Format>;
|
||||
}
|
||||
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>;
|
||||
interface _ZodMiniNumber<T extends core.$ZodNumberInternals<unknown> = core.$ZodNumberInternals<unknown>> extends _ZodMiniType<T>, core.$ZodNumber<T["input"]> {
|
||||
_zod: T;
|
||||
}
|
||||
export interface ZodMiniNumber<Input = unknown> extends _ZodMiniNumber<core.$ZodNumberInternals<Input>>, core.$ZodNumber<Input> {
|
||||
}
|
||||
export declare const ZodMiniNumber: core.$constructor<ZodMiniNumber>;
|
||||
export declare function number(params?: string | core.$ZodNumberParams): ZodMiniNumber<number>;
|
||||
export interface ZodMiniNumberFormat extends _ZodMiniNumber<core.$ZodNumberFormatInternals>, core.$ZodNumberFormat {
|
||||
}
|
||||
export declare const ZodMiniNumberFormat: core.$constructor<ZodMiniNumberFormat>;
|
||||
export declare function int(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniNumberFormat;
|
||||
export declare function float32(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniNumberFormat;
|
||||
export declare function float64(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniNumberFormat;
|
||||
export declare function int32(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniNumberFormat;
|
||||
export declare function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniNumberFormat;
|
||||
export interface ZodMiniBoolean<T = unknown> extends _ZodMiniType<core.$ZodBooleanInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniBoolean: core.$constructor<ZodMiniBoolean>;
|
||||
export declare function boolean(params?: string | core.$ZodBooleanParams): ZodMiniBoolean<boolean>;
|
||||
export interface ZodMiniBigInt<T = unknown> extends _ZodMiniType<core.$ZodBigIntInternals<T>>, core.$ZodBigInt<T> {
|
||||
}
|
||||
export declare const ZodMiniBigInt: core.$constructor<ZodMiniBigInt>;
|
||||
export declare function bigint(params?: string | core.$ZodBigIntParams): ZodMiniBigInt<bigint>;
|
||||
export interface ZodMiniBigIntFormat extends _ZodMiniType<core.$ZodBigIntFormatInternals> {
|
||||
}
|
||||
export declare const ZodMiniBigIntFormat: core.$constructor<ZodMiniBigIntFormat>;
|
||||
export declare function int64(params?: string | core.$ZodBigIntFormatParams): ZodMiniBigIntFormat;
|
||||
export declare function uint64(params?: string | core.$ZodBigIntFormatParams): ZodMiniBigIntFormat;
|
||||
export interface ZodMiniSymbol extends _ZodMiniType<core.$ZodSymbolInternals> {
|
||||
}
|
||||
export declare const ZodMiniSymbol: core.$constructor<ZodMiniSymbol>;
|
||||
export declare function symbol(params?: string | core.$ZodSymbolParams): ZodMiniSymbol;
|
||||
export interface ZodMiniUndefined extends _ZodMiniType<core.$ZodUndefinedInternals> {
|
||||
}
|
||||
export declare const ZodMiniUndefined: core.$constructor<ZodMiniUndefined>;
|
||||
declare function _undefined(params?: string | core.$ZodUndefinedParams): ZodMiniUndefined;
|
||||
export { _undefined as undefined };
|
||||
export interface ZodMiniNull extends _ZodMiniType<core.$ZodNullInternals> {
|
||||
}
|
||||
export declare const ZodMiniNull: core.$constructor<ZodMiniNull>;
|
||||
declare function _null(params?: string | core.$ZodNullParams): ZodMiniNull;
|
||||
export { _null as null };
|
||||
export interface ZodMiniAny extends _ZodMiniType<core.$ZodAnyInternals> {
|
||||
}
|
||||
export declare const ZodMiniAny: core.$constructor<ZodMiniAny>;
|
||||
export declare function any(): ZodMiniAny;
|
||||
export interface ZodMiniUnknown extends _ZodMiniType<core.$ZodUnknownInternals> {
|
||||
}
|
||||
export declare const ZodMiniUnknown: core.$constructor<ZodMiniUnknown>;
|
||||
export declare function unknown(): ZodMiniUnknown;
|
||||
export interface ZodMiniNever extends _ZodMiniType<core.$ZodNeverInternals> {
|
||||
}
|
||||
export declare const ZodMiniNever: core.$constructor<ZodMiniNever>;
|
||||
export declare function never(params?: string | core.$ZodNeverParams): ZodMiniNever;
|
||||
export interface ZodMiniVoid extends _ZodMiniType<core.$ZodVoidInternals> {
|
||||
}
|
||||
export declare const ZodMiniVoid: core.$constructor<ZodMiniVoid>;
|
||||
declare function _void(params?: string | core.$ZodVoidParams): ZodMiniVoid;
|
||||
export { _void as void };
|
||||
export interface ZodMiniDate<T = unknown> extends _ZodMiniType<core.$ZodDateInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniDate: core.$constructor<ZodMiniDate>;
|
||||
export declare function date(params?: string | core.$ZodDateParams): ZodMiniDate<Date>;
|
||||
export interface ZodMiniArray<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodArrayInternals<T>>, core.$ZodArray<T> {
|
||||
}
|
||||
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): 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> {
|
||||
shape: Shape;
|
||||
}
|
||||
export declare const ZodMiniObject: core.$constructor<ZodMiniObject>;
|
||||
export declare function object<T extends core.$ZodLooseShape = Record<never, SomeType>>(shape?: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T, core.$strip>;
|
||||
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"]>;
|
||||
/** @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"]>;
|
||||
export declare function omit<T extends ZodMiniObject, const M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M): ZodMiniObject<util.Flatten<Omit<T["shape"], keyof M>>, T["_zod"]["config"]>;
|
||||
export declare function partial<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
|
||||
[k in keyof T["shape"]]: ZodMiniOptional<T["shape"][k]>;
|
||||
}, T["_zod"]["config"]>;
|
||||
export declare function partial<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M): ZodMiniObject<{
|
||||
[k in keyof T["shape"]]: k extends keyof M ? ZodMiniOptional<T["shape"][k]> : T["shape"][k];
|
||||
}, T["_zod"]["config"]>;
|
||||
export type RequiredInterfaceShape<Shape extends core.$ZodLooseShape, Keys extends PropertyKey = keyof Shape> = util.Identity<{
|
||||
[k in keyof Shape as k extends Keys ? k : never]: ZodMiniNonOptional<Shape[k]>;
|
||||
} & {
|
||||
[k in keyof Shape as k extends Keys ? never : k]: Shape[k];
|
||||
}>;
|
||||
export declare function required<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
|
||||
[k in keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
|
||||
}, T["_zod"]["config"]>;
|
||||
export declare function required<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M): ZodMiniObject<util.Extend<T["shape"], {
|
||||
[k in keyof M & keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
|
||||
}>, T["_zod"]["config"]>;
|
||||
export declare function catchall<T extends ZodMiniObject, U extends SomeType>(inst: T, catchall: U): ZodMiniObject<T["shape"], core.$catchall<U>>;
|
||||
export interface ZodMiniUnion<T extends readonly SomeType[] = readonly core.$ZodType[]> extends _ZodMiniType<core.$ZodUnionInternals<T>> {
|
||||
}
|
||||
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[]> 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[]]>(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>;
|
||||
export declare function intersection<T extends SomeType, U extends SomeType>(left: T, right: U): ZodMiniIntersection<T, U>;
|
||||
export interface ZodMiniTuple<T extends util.TupleItems = readonly core.$ZodType[], Rest extends SomeType | null = core.$ZodType | null> extends _ZodMiniType<core.$ZodTupleInternals<T, Rest>> {
|
||||
}
|
||||
export declare const ZodMiniTuple: core.$constructor<ZodMiniTuple>;
|
||||
export declare function tuple<const T extends readonly [SomeType, ...SomeType[]]>(items: T, params?: string | core.$ZodTupleParams): ZodMiniTuple<T, null>;
|
||||
export declare function tuple<const T extends readonly [SomeType, ...SomeType[]], Rest extends SomeType>(items: T, rest: Rest, params?: string | core.$ZodTupleParams): ZodMiniTuple<T, Rest>;
|
||||
export declare function tuple(items: [], params?: string | core.$ZodTupleParams): ZodMiniTuple<[], null>;
|
||||
export interface ZodMiniRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodRecordInternals<Key, Value>> {
|
||||
}
|
||||
export declare const ZodMiniRecord: core.$constructor<ZodMiniRecord>;
|
||||
export declare function record<Key extends core.$ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodMiniRecord<Key, Value>;
|
||||
export declare function partialRecord<Key extends core.$ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodMiniRecord<Key & core.$partial, Value>;
|
||||
export interface ZodMiniMap<Key extends SomeType = core.$ZodType, Value extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodMapInternals<Key, Value>> {
|
||||
}
|
||||
export declare const ZodMiniMap: core.$constructor<ZodMiniMap>;
|
||||
export declare function map<Key extends SomeType, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodMapParams): ZodMiniMap<Key, Value>;
|
||||
export interface ZodMiniSet<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodSetInternals<T>> {
|
||||
}
|
||||
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>> {
|
||||
}
|
||||
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]>>;
|
||||
declare function _enum<T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodMiniEnum<T>;
|
||||
export { _enum as enum };
|
||||
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
|
||||
*
|
||||
* ```ts
|
||||
* enum Colors { red, green, blue }
|
||||
* z.enum(Colors);
|
||||
* ```
|
||||
*/
|
||||
export declare function nativeEnum<T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodMiniEnum<T>;
|
||||
export interface ZodMiniLiteral<T extends util.Literal = util.Literal> extends _ZodMiniType<core.$ZodLiteralInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniLiteral: core.$constructor<ZodMiniLiteral>;
|
||||
export declare function literal<const T extends ReadonlyArray<util.Literal>>(value: T, params?: string | core.$ZodLiteralParams): ZodMiniLiteral<T[number]>;
|
||||
export declare function literal<const T extends util.Literal>(value: T, params?: string | core.$ZodLiteralParams): ZodMiniLiteral<T>;
|
||||
export interface ZodMiniFile extends _ZodMiniType<core.$ZodFileInternals> {
|
||||
}
|
||||
export declare const ZodMiniFile: core.$constructor<ZodMiniFile>;
|
||||
export declare function file(params?: string | core.$ZodFileParams): ZodMiniFile;
|
||||
export interface ZodMiniTransform<O = unknown, I = unknown> extends _ZodMiniType<core.$ZodTransformInternals<O, I>> {
|
||||
}
|
||||
export declare const ZodMiniTransform: core.$constructor<ZodMiniTransform>;
|
||||
export declare function transform<I = unknown, O = I>(fn: (input: I, ctx: core.ParsePayload) => O): ZodMiniTransform<Awaited<O>, I>;
|
||||
export interface ZodMiniOptional<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodOptionalInternals<T>>, core.$ZodOptional<T> {
|
||||
}
|
||||
export declare const ZodMiniOptional: core.$constructor<ZodMiniOptional>;
|
||||
export declare function optional<T extends SomeType>(innerType: T): ZodMiniOptional<T>;
|
||||
export interface ZodMiniNullable<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodNullableInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniNullable: core.$constructor<ZodMiniNullable>;
|
||||
export declare function nullable<T extends SomeType>(innerType: T): ZodMiniNullable<T>;
|
||||
export declare function nullish<T extends SomeType>(innerType: T): ZodMiniOptional<ZodMiniNullable<T>>;
|
||||
export interface ZodMiniDefault<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodDefaultInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniDefault: core.$constructor<ZodMiniDefault>;
|
||||
export declare function _default<T extends SomeType>(innerType: T, defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>)): ZodMiniDefault<T>;
|
||||
export interface ZodMiniPrefault<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodPrefaultInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniPrefault: core.$constructor<ZodMiniPrefault>;
|
||||
export declare function prefault<T extends SomeType>(innerType: T, defaultValue: util.NoUndefined<core.input<T>> | (() => util.NoUndefined<core.input<T>>)): ZodMiniPrefault<T>;
|
||||
export interface ZodMiniNonOptional<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodNonOptionalInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniNonOptional: core.$constructor<ZodMiniNonOptional>;
|
||||
export declare function nonoptional<T extends SomeType>(innerType: T, params?: string | core.$ZodNonOptionalParams): ZodMiniNonOptional<T>;
|
||||
export interface ZodMiniSuccess<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodSuccessInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniSuccess: core.$constructor<ZodMiniSuccess>;
|
||||
export declare function success<T extends SomeType>(innerType: T): ZodMiniSuccess<T>;
|
||||
export interface ZodMiniCatch<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodCatchInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniCatch: core.$constructor<ZodMiniCatch>;
|
||||
declare function _catch<T extends SomeType>(innerType: T, catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>)): ZodMiniCatch<T>;
|
||||
export { _catch as catch };
|
||||
export interface ZodMiniNaN extends _ZodMiniType<core.$ZodNaNInternals> {
|
||||
}
|
||||
export declare const ZodMiniNaN: core.$constructor<ZodMiniNaN>;
|
||||
export declare function nan(params?: string | core.$ZodNaNParams): ZodMiniNaN;
|
||||
export interface ZodMiniPipe<A extends SomeType = core.$ZodType, B extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodPipeInternals<A, B>> {
|
||||
}
|
||||
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 ZodMiniReadonly<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodReadonlyInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniReadonly: core.$constructor<ZodMiniReadonly>;
|
||||
export declare function readonly<T extends SomeType>(innerType: T): ZodMiniReadonly<T>;
|
||||
export interface ZodMiniTemplateLiteral<Template extends string = string> extends _ZodMiniType<core.$ZodTemplateLiteralInternals<Template>> {
|
||||
}
|
||||
export declare const ZodMiniTemplateLiteral: core.$constructor<ZodMiniTemplateLiteral>;
|
||||
export declare function templateLiteral<const Parts extends core.$ZodTemplateLiteralPart[]>(parts: Parts, params?: string | core.$ZodTemplateLiteralParams): ZodMiniTemplateLiteral<core.$PartsToTemplateLiteral<Parts>>;
|
||||
export interface ZodMiniLazy<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodLazyInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniLazy: core.$constructor<ZodMiniLazy>;
|
||||
declare function _lazy<T extends SomeType>(getter: () => T): ZodMiniLazy<T>;
|
||||
export { _lazy as lazy };
|
||||
export interface ZodMiniPromise<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodPromiseInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniPromise: core.$constructor<ZodMiniPromise>;
|
||||
export declare function promise<T extends SomeType>(innerType: T): ZodMiniPromise<T>;
|
||||
export interface ZodMiniCustom<O = unknown, I = unknown> extends _ZodMiniType<core.$ZodCustomInternals<O, I>> {
|
||||
}
|
||||
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>;
|
||||
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) => ZodMiniPipe<ZodMiniPipe<ZodMiniString, ZodMiniTransform<boolean, string>>, ZodMiniBoolean>;
|
||||
type _ZodMiniJSONSchema = ZodMiniUnion<[
|
||||
ZodMiniString,
|
||||
ZodMiniNumber,
|
||||
ZodMiniBoolean,
|
||||
ZodMiniNull,
|
||||
ZodMiniArray<ZodMiniJSONSchema>,
|
||||
ZodMiniRecord<ZodMiniString<string>, ZodMiniJSONSchema>
|
||||
]>;
|
||||
type _ZodMiniJSONSchemaInternals = _ZodMiniJSONSchema["_zod"];
|
||||
export interface ZodMiniJSONSchemaInternals extends _ZodMiniJSONSchemaInternals {
|
||||
output: util.JSONType;
|
||||
input: util.JSONType;
|
||||
}
|
||||
export interface ZodMiniJSONSchema extends _ZodMiniJSONSchema {
|
||||
_zod: ZodMiniJSONSchemaInternals;
|
||||
}
|
||||
export declare function json(): ZodMiniJSONSchema;
|
356
node_modules/zod/v4/mini/schemas.d.ts
generated
vendored
Normal file
356
node_modules/zod/v4/mini/schemas.d.ts
generated
vendored
Normal file
@@ -0,0 +1,356 @@
|
||||
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> {
|
||||
check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
|
||||
clone(def?: Internals["def"], params?: {
|
||||
parent: boolean;
|
||||
}): this;
|
||||
register<R extends core.$ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [core.$replace<R["_meta"], this>?] : [core.$replace<R["_meta"], this>] : ["Incompatible schema"]): this;
|
||||
brand<T extends PropertyKey = PropertyKey>(value?: T): PropertyKey extends T ? this : this & Record<"_zod", Record<"output", core.output<this> & core.$brand<T>>>;
|
||||
def: Internals["def"];
|
||||
parse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
|
||||
safeParse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): util.SafeParseResult<core.output<this>>;
|
||||
parseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
|
||||
safeParseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<util.SafeParseResult<core.output<this>>>;
|
||||
}
|
||||
interface _ZodMiniType<out Internals extends core.$ZodTypeInternals = core.$ZodTypeInternals> extends ZodMiniType<any, any, Internals> {
|
||||
}
|
||||
export declare const ZodMiniType: core.$constructor<ZodMiniType>;
|
||||
export interface _ZodMiniString<T extends core.$ZodStringInternals<unknown> = core.$ZodStringInternals<unknown>> extends _ZodMiniType<T>, core.$ZodString<T["input"]> {
|
||||
_zod: T;
|
||||
}
|
||||
export interface ZodMiniString<Input = unknown> extends _ZodMiniString<core.$ZodStringInternals<Input>>, core.$ZodString<Input> {
|
||||
}
|
||||
export declare const ZodMiniString: core.$constructor<ZodMiniString>;
|
||||
export declare function string(params?: string | core.$ZodStringParams): ZodMiniString<string>;
|
||||
export interface ZodMiniStringFormat<Format extends string = string> extends _ZodMiniString<core.$ZodStringFormatInternals<Format>>, core.$ZodStringFormat<Format> {
|
||||
}
|
||||
export declare const ZodMiniStringFormat: core.$constructor<ZodMiniStringFormat>;
|
||||
export interface ZodMiniEmail extends _ZodMiniString<core.$ZodEmailInternals> {
|
||||
}
|
||||
export declare const ZodMiniEmail: core.$constructor<ZodMiniEmail>;
|
||||
export declare function email(params?: string | core.$ZodEmailParams): ZodMiniEmail;
|
||||
export interface ZodMiniGUID extends _ZodMiniString<core.$ZodGUIDInternals> {
|
||||
}
|
||||
export declare const ZodMiniGUID: core.$constructor<ZodMiniGUID>;
|
||||
export declare function guid(params?: string | core.$ZodGUIDParams): ZodMiniGUID;
|
||||
export interface ZodMiniUUID extends _ZodMiniString<core.$ZodUUIDInternals> {
|
||||
}
|
||||
export declare const ZodMiniUUID: core.$constructor<ZodMiniUUID>;
|
||||
export declare function uuid(params?: string | core.$ZodUUIDParams): ZodMiniUUID;
|
||||
export declare function uuidv4(params?: string | core.$ZodUUIDv4Params): ZodMiniUUID;
|
||||
export declare function uuidv6(params?: string | core.$ZodUUIDv6Params): ZodMiniUUID;
|
||||
export declare function uuidv7(params?: string | core.$ZodUUIDv7Params): ZodMiniUUID;
|
||||
export interface ZodMiniURL extends _ZodMiniString<core.$ZodURLInternals> {
|
||||
}
|
||||
export declare const ZodMiniURL: core.$constructor<ZodMiniURL>;
|
||||
export declare function url(params?: string | core.$ZodURLParams): ZodMiniURL;
|
||||
export interface ZodMiniEmoji extends _ZodMiniString<core.$ZodEmojiInternals> {
|
||||
}
|
||||
export declare const ZodMiniEmoji: core.$constructor<ZodMiniEmoji>;
|
||||
export declare function emoji(params?: string | core.$ZodEmojiParams): ZodMiniEmoji;
|
||||
export interface ZodMiniNanoID extends _ZodMiniString<core.$ZodNanoIDInternals> {
|
||||
}
|
||||
export declare const ZodMiniNanoID: core.$constructor<ZodMiniNanoID>;
|
||||
export declare function nanoid(params?: string | core.$ZodNanoIDParams): ZodMiniNanoID;
|
||||
export interface ZodMiniCUID extends _ZodMiniString<core.$ZodCUIDInternals> {
|
||||
}
|
||||
export declare const ZodMiniCUID: core.$constructor<ZodMiniCUID>;
|
||||
export declare function cuid(params?: string | core.$ZodCUIDParams): ZodMiniCUID;
|
||||
export interface ZodMiniCUID2 extends _ZodMiniString<core.$ZodCUID2Internals> {
|
||||
}
|
||||
export declare const ZodMiniCUID2: core.$constructor<ZodMiniCUID2>;
|
||||
export declare function cuid2(params?: string | core.$ZodCUID2Params): ZodMiniCUID2;
|
||||
export interface ZodMiniULID extends _ZodMiniString<core.$ZodULIDInternals> {
|
||||
}
|
||||
export declare const ZodMiniULID: core.$constructor<ZodMiniULID>;
|
||||
export declare function ulid(params?: string | core.$ZodULIDParams): ZodMiniULID;
|
||||
export interface ZodMiniXID extends _ZodMiniString<core.$ZodXIDInternals> {
|
||||
}
|
||||
export declare const ZodMiniXID: core.$constructor<ZodMiniXID>;
|
||||
export declare function xid(params?: string | core.$ZodXIDParams): ZodMiniXID;
|
||||
export interface ZodMiniKSUID extends _ZodMiniString<core.$ZodKSUIDInternals> {
|
||||
}
|
||||
export declare const ZodMiniKSUID: core.$constructor<ZodMiniKSUID>;
|
||||
export declare function ksuid(params?: string | core.$ZodKSUIDParams): ZodMiniKSUID;
|
||||
export interface ZodMiniIPv4 extends _ZodMiniString<core.$ZodIPv4Internals> {
|
||||
}
|
||||
export declare const ZodMiniIPv4: core.$constructor<ZodMiniIPv4>;
|
||||
export declare function ipv4(params?: string | core.$ZodIPv4Params): ZodMiniIPv4;
|
||||
export interface ZodMiniIPv6 extends _ZodMiniString<core.$ZodIPv6Internals> {
|
||||
}
|
||||
export declare const ZodMiniIPv6: core.$constructor<ZodMiniIPv6>;
|
||||
export declare function ipv6(params?: string | core.$ZodIPv6Params): ZodMiniIPv6;
|
||||
export interface ZodMiniCIDRv4 extends _ZodMiniString<core.$ZodCIDRv4Internals> {
|
||||
}
|
||||
export declare const ZodMiniCIDRv4: core.$constructor<ZodMiniCIDRv4>;
|
||||
export declare function cidrv4(params?: string | core.$ZodCIDRv4Params): ZodMiniCIDRv4;
|
||||
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 ZodMiniBase64 extends _ZodMiniString<core.$ZodBase64Internals> {
|
||||
}
|
||||
export declare const ZodMiniBase64: core.$constructor<ZodMiniBase64>;
|
||||
export declare function base64(params?: string | core.$ZodBase64Params): ZodMiniBase64;
|
||||
export interface ZodMiniBase64URL extends _ZodMiniString<core.$ZodBase64URLInternals> {
|
||||
}
|
||||
export declare const ZodMiniBase64URL: core.$constructor<ZodMiniBase64URL>;
|
||||
export declare function base64url(params?: string | core.$ZodBase64URLParams): ZodMiniBase64URL;
|
||||
export interface ZodMiniE164 extends _ZodMiniString<core.$ZodE164Internals> {
|
||||
}
|
||||
export declare const ZodMiniE164: core.$constructor<ZodMiniE164>;
|
||||
export declare function e164(params?: string | core.$ZodE164Params): ZodMiniE164;
|
||||
export interface ZodMiniJWT extends _ZodMiniString<core.$ZodJWTInternals> {
|
||||
}
|
||||
export declare const ZodMiniJWT: core.$constructor<ZodMiniJWT>;
|
||||
export declare function jwt(params?: string | core.$ZodJWTParams): ZodMiniJWT;
|
||||
export interface ZodMiniCustomStringFormat<Format extends string = string> extends ZodMiniStringFormat<Format>, core.$ZodCustomStringFormat<Format> {
|
||||
_zod: core.$ZodCustomStringFormatInternals<Format>;
|
||||
}
|
||||
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>;
|
||||
interface _ZodMiniNumber<T extends core.$ZodNumberInternals<unknown> = core.$ZodNumberInternals<unknown>> extends _ZodMiniType<T>, core.$ZodNumber<T["input"]> {
|
||||
_zod: T;
|
||||
}
|
||||
export interface ZodMiniNumber<Input = unknown> extends _ZodMiniNumber<core.$ZodNumberInternals<Input>>, core.$ZodNumber<Input> {
|
||||
}
|
||||
export declare const ZodMiniNumber: core.$constructor<ZodMiniNumber>;
|
||||
export declare function number(params?: string | core.$ZodNumberParams): ZodMiniNumber<number>;
|
||||
export interface ZodMiniNumberFormat extends _ZodMiniNumber<core.$ZodNumberFormatInternals>, core.$ZodNumberFormat {
|
||||
}
|
||||
export declare const ZodMiniNumberFormat: core.$constructor<ZodMiniNumberFormat>;
|
||||
export declare function int(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniNumberFormat;
|
||||
export declare function float32(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniNumberFormat;
|
||||
export declare function float64(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniNumberFormat;
|
||||
export declare function int32(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniNumberFormat;
|
||||
export declare function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniNumberFormat;
|
||||
export interface ZodMiniBoolean<T = unknown> extends _ZodMiniType<core.$ZodBooleanInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniBoolean: core.$constructor<ZodMiniBoolean>;
|
||||
export declare function boolean(params?: string | core.$ZodBooleanParams): ZodMiniBoolean<boolean>;
|
||||
export interface ZodMiniBigInt<T = unknown> extends _ZodMiniType<core.$ZodBigIntInternals<T>>, core.$ZodBigInt<T> {
|
||||
}
|
||||
export declare const ZodMiniBigInt: core.$constructor<ZodMiniBigInt>;
|
||||
export declare function bigint(params?: string | core.$ZodBigIntParams): ZodMiniBigInt<bigint>;
|
||||
export interface ZodMiniBigIntFormat extends _ZodMiniType<core.$ZodBigIntFormatInternals> {
|
||||
}
|
||||
export declare const ZodMiniBigIntFormat: core.$constructor<ZodMiniBigIntFormat>;
|
||||
export declare function int64(params?: string | core.$ZodBigIntFormatParams): ZodMiniBigIntFormat;
|
||||
export declare function uint64(params?: string | core.$ZodBigIntFormatParams): ZodMiniBigIntFormat;
|
||||
export interface ZodMiniSymbol extends _ZodMiniType<core.$ZodSymbolInternals> {
|
||||
}
|
||||
export declare const ZodMiniSymbol: core.$constructor<ZodMiniSymbol>;
|
||||
export declare function symbol(params?: string | core.$ZodSymbolParams): ZodMiniSymbol;
|
||||
export interface ZodMiniUndefined extends _ZodMiniType<core.$ZodUndefinedInternals> {
|
||||
}
|
||||
export declare const ZodMiniUndefined: core.$constructor<ZodMiniUndefined>;
|
||||
declare function _undefined(params?: string | core.$ZodUndefinedParams): ZodMiniUndefined;
|
||||
export { _undefined as undefined };
|
||||
export interface ZodMiniNull extends _ZodMiniType<core.$ZodNullInternals> {
|
||||
}
|
||||
export declare const ZodMiniNull: core.$constructor<ZodMiniNull>;
|
||||
declare function _null(params?: string | core.$ZodNullParams): ZodMiniNull;
|
||||
export { _null as null };
|
||||
export interface ZodMiniAny extends _ZodMiniType<core.$ZodAnyInternals> {
|
||||
}
|
||||
export declare const ZodMiniAny: core.$constructor<ZodMiniAny>;
|
||||
export declare function any(): ZodMiniAny;
|
||||
export interface ZodMiniUnknown extends _ZodMiniType<core.$ZodUnknownInternals> {
|
||||
}
|
||||
export declare const ZodMiniUnknown: core.$constructor<ZodMiniUnknown>;
|
||||
export declare function unknown(): ZodMiniUnknown;
|
||||
export interface ZodMiniNever extends _ZodMiniType<core.$ZodNeverInternals> {
|
||||
}
|
||||
export declare const ZodMiniNever: core.$constructor<ZodMiniNever>;
|
||||
export declare function never(params?: string | core.$ZodNeverParams): ZodMiniNever;
|
||||
export interface ZodMiniVoid extends _ZodMiniType<core.$ZodVoidInternals> {
|
||||
}
|
||||
export declare const ZodMiniVoid: core.$constructor<ZodMiniVoid>;
|
||||
declare function _void(params?: string | core.$ZodVoidParams): ZodMiniVoid;
|
||||
export { _void as void };
|
||||
export interface ZodMiniDate<T = unknown> extends _ZodMiniType<core.$ZodDateInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniDate: core.$constructor<ZodMiniDate>;
|
||||
export declare function date(params?: string | core.$ZodDateParams): ZodMiniDate<Date>;
|
||||
export interface ZodMiniArray<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodArrayInternals<T>>, core.$ZodArray<T> {
|
||||
}
|
||||
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): 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> {
|
||||
shape: Shape;
|
||||
}
|
||||
export declare const ZodMiniObject: core.$constructor<ZodMiniObject>;
|
||||
export declare function object<T extends core.$ZodLooseShape = Record<never, SomeType>>(shape?: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T, core.$strip>;
|
||||
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"]>;
|
||||
/** @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"]>;
|
||||
export declare function omit<T extends ZodMiniObject, const M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M): ZodMiniObject<util.Flatten<Omit<T["shape"], keyof M>>, T["_zod"]["config"]>;
|
||||
export declare function partial<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
|
||||
[k in keyof T["shape"]]: ZodMiniOptional<T["shape"][k]>;
|
||||
}, T["_zod"]["config"]>;
|
||||
export declare function partial<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M): ZodMiniObject<{
|
||||
[k in keyof T["shape"]]: k extends keyof M ? ZodMiniOptional<T["shape"][k]> : T["shape"][k];
|
||||
}, T["_zod"]["config"]>;
|
||||
export type RequiredInterfaceShape<Shape extends core.$ZodLooseShape, Keys extends PropertyKey = keyof Shape> = util.Identity<{
|
||||
[k in keyof Shape as k extends Keys ? k : never]: ZodMiniNonOptional<Shape[k]>;
|
||||
} & {
|
||||
[k in keyof Shape as k extends Keys ? never : k]: Shape[k];
|
||||
}>;
|
||||
export declare function required<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
|
||||
[k in keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
|
||||
}, T["_zod"]["config"]>;
|
||||
export declare function required<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M): ZodMiniObject<util.Extend<T["shape"], {
|
||||
[k in keyof M & keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
|
||||
}>, T["_zod"]["config"]>;
|
||||
export declare function catchall<T extends ZodMiniObject, U extends SomeType>(inst: T, catchall: U): ZodMiniObject<T["shape"], core.$catchall<U>>;
|
||||
export interface ZodMiniUnion<T extends readonly SomeType[] = readonly core.$ZodType[]> extends _ZodMiniType<core.$ZodUnionInternals<T>> {
|
||||
}
|
||||
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[]> 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[]]>(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>;
|
||||
export declare function intersection<T extends SomeType, U extends SomeType>(left: T, right: U): ZodMiniIntersection<T, U>;
|
||||
export interface ZodMiniTuple<T extends util.TupleItems = readonly core.$ZodType[], Rest extends SomeType | null = core.$ZodType | null> extends _ZodMiniType<core.$ZodTupleInternals<T, Rest>> {
|
||||
}
|
||||
export declare const ZodMiniTuple: core.$constructor<ZodMiniTuple>;
|
||||
export declare function tuple<const T extends readonly [SomeType, ...SomeType[]]>(items: T, params?: string | core.$ZodTupleParams): ZodMiniTuple<T, null>;
|
||||
export declare function tuple<const T extends readonly [SomeType, ...SomeType[]], Rest extends SomeType>(items: T, rest: Rest, params?: string | core.$ZodTupleParams): ZodMiniTuple<T, Rest>;
|
||||
export declare function tuple(items: [], params?: string | core.$ZodTupleParams): ZodMiniTuple<[], null>;
|
||||
export interface ZodMiniRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodRecordInternals<Key, Value>> {
|
||||
}
|
||||
export declare const ZodMiniRecord: core.$constructor<ZodMiniRecord>;
|
||||
export declare function record<Key extends core.$ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodMiniRecord<Key, Value>;
|
||||
export declare function partialRecord<Key extends core.$ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodMiniRecord<Key & core.$partial, Value>;
|
||||
export interface ZodMiniMap<Key extends SomeType = core.$ZodType, Value extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodMapInternals<Key, Value>> {
|
||||
}
|
||||
export declare const ZodMiniMap: core.$constructor<ZodMiniMap>;
|
||||
export declare function map<Key extends SomeType, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodMapParams): ZodMiniMap<Key, Value>;
|
||||
export interface ZodMiniSet<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodSetInternals<T>> {
|
||||
}
|
||||
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>> {
|
||||
}
|
||||
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]>>;
|
||||
declare function _enum<T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodMiniEnum<T>;
|
||||
export { _enum as enum };
|
||||
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
|
||||
*
|
||||
* ```ts
|
||||
* enum Colors { red, green, blue }
|
||||
* z.enum(Colors);
|
||||
* ```
|
||||
*/
|
||||
export declare function nativeEnum<T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodMiniEnum<T>;
|
||||
export interface ZodMiniLiteral<T extends util.Literal = util.Literal> extends _ZodMiniType<core.$ZodLiteralInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniLiteral: core.$constructor<ZodMiniLiteral>;
|
||||
export declare function literal<const T extends ReadonlyArray<util.Literal>>(value: T, params?: string | core.$ZodLiteralParams): ZodMiniLiteral<T[number]>;
|
||||
export declare function literal<const T extends util.Literal>(value: T, params?: string | core.$ZodLiteralParams): ZodMiniLiteral<T>;
|
||||
export interface ZodMiniFile extends _ZodMiniType<core.$ZodFileInternals> {
|
||||
}
|
||||
export declare const ZodMiniFile: core.$constructor<ZodMiniFile>;
|
||||
export declare function file(params?: string | core.$ZodFileParams): ZodMiniFile;
|
||||
export interface ZodMiniTransform<O = unknown, I = unknown> extends _ZodMiniType<core.$ZodTransformInternals<O, I>> {
|
||||
}
|
||||
export declare const ZodMiniTransform: core.$constructor<ZodMiniTransform>;
|
||||
export declare function transform<I = unknown, O = I>(fn: (input: I, ctx: core.ParsePayload) => O): ZodMiniTransform<Awaited<O>, I>;
|
||||
export interface ZodMiniOptional<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodOptionalInternals<T>>, core.$ZodOptional<T> {
|
||||
}
|
||||
export declare const ZodMiniOptional: core.$constructor<ZodMiniOptional>;
|
||||
export declare function optional<T extends SomeType>(innerType: T): ZodMiniOptional<T>;
|
||||
export interface ZodMiniNullable<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodNullableInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniNullable: core.$constructor<ZodMiniNullable>;
|
||||
export declare function nullable<T extends SomeType>(innerType: T): ZodMiniNullable<T>;
|
||||
export declare function nullish<T extends SomeType>(innerType: T): ZodMiniOptional<ZodMiniNullable<T>>;
|
||||
export interface ZodMiniDefault<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodDefaultInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniDefault: core.$constructor<ZodMiniDefault>;
|
||||
export declare function _default<T extends SomeType>(innerType: T, defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>)): ZodMiniDefault<T>;
|
||||
export interface ZodMiniPrefault<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodPrefaultInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniPrefault: core.$constructor<ZodMiniPrefault>;
|
||||
export declare function prefault<T extends SomeType>(innerType: T, defaultValue: util.NoUndefined<core.input<T>> | (() => util.NoUndefined<core.input<T>>)): ZodMiniPrefault<T>;
|
||||
export interface ZodMiniNonOptional<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodNonOptionalInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniNonOptional: core.$constructor<ZodMiniNonOptional>;
|
||||
export declare function nonoptional<T extends SomeType>(innerType: T, params?: string | core.$ZodNonOptionalParams): ZodMiniNonOptional<T>;
|
||||
export interface ZodMiniSuccess<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodSuccessInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniSuccess: core.$constructor<ZodMiniSuccess>;
|
||||
export declare function success<T extends SomeType>(innerType: T): ZodMiniSuccess<T>;
|
||||
export interface ZodMiniCatch<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodCatchInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniCatch: core.$constructor<ZodMiniCatch>;
|
||||
declare function _catch<T extends SomeType>(innerType: T, catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>)): ZodMiniCatch<T>;
|
||||
export { _catch as catch };
|
||||
export interface ZodMiniNaN extends _ZodMiniType<core.$ZodNaNInternals> {
|
||||
}
|
||||
export declare const ZodMiniNaN: core.$constructor<ZodMiniNaN>;
|
||||
export declare function nan(params?: string | core.$ZodNaNParams): ZodMiniNaN;
|
||||
export interface ZodMiniPipe<A extends SomeType = core.$ZodType, B extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodPipeInternals<A, B>> {
|
||||
}
|
||||
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 ZodMiniReadonly<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodReadonlyInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniReadonly: core.$constructor<ZodMiniReadonly>;
|
||||
export declare function readonly<T extends SomeType>(innerType: T): ZodMiniReadonly<T>;
|
||||
export interface ZodMiniTemplateLiteral<Template extends string = string> extends _ZodMiniType<core.$ZodTemplateLiteralInternals<Template>> {
|
||||
}
|
||||
export declare const ZodMiniTemplateLiteral: core.$constructor<ZodMiniTemplateLiteral>;
|
||||
export declare function templateLiteral<const Parts extends core.$ZodTemplateLiteralPart[]>(parts: Parts, params?: string | core.$ZodTemplateLiteralParams): ZodMiniTemplateLiteral<core.$PartsToTemplateLiteral<Parts>>;
|
||||
export interface ZodMiniLazy<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodLazyInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniLazy: core.$constructor<ZodMiniLazy>;
|
||||
declare function _lazy<T extends SomeType>(getter: () => T): ZodMiniLazy<T>;
|
||||
export { _lazy as lazy };
|
||||
export interface ZodMiniPromise<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodPromiseInternals<T>> {
|
||||
}
|
||||
export declare const ZodMiniPromise: core.$constructor<ZodMiniPromise>;
|
||||
export declare function promise<T extends SomeType>(innerType: T): ZodMiniPromise<T>;
|
||||
export interface ZodMiniCustom<O = unknown, I = unknown> extends _ZodMiniType<core.$ZodCustomInternals<O, I>> {
|
||||
}
|
||||
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>;
|
||||
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) => ZodMiniPipe<ZodMiniPipe<ZodMiniString, ZodMiniTransform<boolean, string>>, ZodMiniBoolean>;
|
||||
type _ZodMiniJSONSchema = ZodMiniUnion<[
|
||||
ZodMiniString,
|
||||
ZodMiniNumber,
|
||||
ZodMiniBoolean,
|
||||
ZodMiniNull,
|
||||
ZodMiniArray<ZodMiniJSONSchema>,
|
||||
ZodMiniRecord<ZodMiniString<string>, ZodMiniJSONSchema>
|
||||
]>;
|
||||
type _ZodMiniJSONSchemaInternals = _ZodMiniJSONSchema["_zod"];
|
||||
export interface ZodMiniJSONSchemaInternals extends _ZodMiniJSONSchemaInternals {
|
||||
output: util.JSONType;
|
||||
input: util.JSONType;
|
||||
}
|
||||
export interface ZodMiniJSONSchema extends _ZodMiniJSONSchema {
|
||||
_zod: ZodMiniJSONSchemaInternals;
|
||||
}
|
||||
export declare function json(): ZodMiniJSONSchema;
|
732
node_modules/zod/v4/mini/schemas.js
generated
vendored
Normal file
732
node_modules/zod/v4/mini/schemas.js
generated
vendored
Normal file
@@ -0,0 +1,732 @@
|
||||
import * as core from "../core/index.js";
|
||||
import { util } from "../core/index.js";
|
||||
import * as parse from "./parse.js";
|
||||
export const ZodMiniType = /*@__PURE__*/ core.$constructor("ZodMiniType", (inst, def) => {
|
||||
if (!inst._zod)
|
||||
throw new Error("Uninitialized schema in ZodMiniType.");
|
||||
core.$ZodType.init(inst, def);
|
||||
inst.def = def;
|
||||
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 });
|
||||
inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);
|
||||
inst.check = (...checks) => {
|
||||
return inst.clone({
|
||||
...def,
|
||||
checks: [
|
||||
...(def.checks ?? []),
|
||||
...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch),
|
||||
],
|
||||
}
|
||||
// { parent: true }
|
||||
);
|
||||
};
|
||||
inst.clone = (_def, params) => core.clone(inst, _def, params);
|
||||
inst.brand = () => inst;
|
||||
inst.register = ((reg, meta) => {
|
||||
reg.add(inst, meta);
|
||||
return inst;
|
||||
});
|
||||
});
|
||||
export const ZodMiniString = /*@__PURE__*/ core.$constructor("ZodMiniString", (inst, def) => {
|
||||
core.$ZodString.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function string(params) {
|
||||
return core._string(ZodMiniString, params);
|
||||
}
|
||||
export const ZodMiniStringFormat = /*@__PURE__*/ core.$constructor("ZodMiniStringFormat", (inst, def) => {
|
||||
core.$ZodStringFormat.init(inst, def);
|
||||
ZodMiniString.init(inst, def);
|
||||
});
|
||||
export const ZodMiniEmail = /*@__PURE__*/ core.$constructor("ZodMiniEmail", (inst, def) => {
|
||||
core.$ZodEmail.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function email(params) {
|
||||
return core._email(ZodMiniEmail, params);
|
||||
}
|
||||
export const ZodMiniGUID = /*@__PURE__*/ core.$constructor("ZodMiniGUID", (inst, def) => {
|
||||
core.$ZodGUID.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function guid(params) {
|
||||
return core._guid(ZodMiniGUID, params);
|
||||
}
|
||||
export const ZodMiniUUID = /*@__PURE__*/ core.$constructor("ZodMiniUUID", (inst, def) => {
|
||||
core.$ZodUUID.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function uuid(params) {
|
||||
return core._uuid(ZodMiniUUID, params);
|
||||
}
|
||||
export function uuidv4(params) {
|
||||
return core._uuidv4(ZodMiniUUID, params);
|
||||
}
|
||||
// ZodMiniUUIDv6
|
||||
export function uuidv6(params) {
|
||||
return core._uuidv6(ZodMiniUUID, params);
|
||||
}
|
||||
// ZodMiniUUIDv7
|
||||
export function uuidv7(params) {
|
||||
return core._uuidv7(ZodMiniUUID, params);
|
||||
}
|
||||
export const ZodMiniURL = /*@__PURE__*/ core.$constructor("ZodMiniURL", (inst, def) => {
|
||||
core.$ZodURL.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function url(params) {
|
||||
return core._url(ZodMiniURL, params);
|
||||
}
|
||||
export const ZodMiniEmoji = /*@__PURE__*/ core.$constructor("ZodMiniEmoji", (inst, def) => {
|
||||
core.$ZodEmoji.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function emoji(params) {
|
||||
return core._emoji(ZodMiniEmoji, params);
|
||||
}
|
||||
export const ZodMiniNanoID = /*@__PURE__*/ core.$constructor("ZodMiniNanoID", (inst, def) => {
|
||||
core.$ZodNanoID.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function nanoid(params) {
|
||||
return core._nanoid(ZodMiniNanoID, params);
|
||||
}
|
||||
export const ZodMiniCUID = /*@__PURE__*/ core.$constructor("ZodMiniCUID", (inst, def) => {
|
||||
core.$ZodCUID.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function cuid(params) {
|
||||
return core._cuid(ZodMiniCUID, params);
|
||||
}
|
||||
export const ZodMiniCUID2 = /*@__PURE__*/ core.$constructor("ZodMiniCUID2", (inst, def) => {
|
||||
core.$ZodCUID2.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function cuid2(params) {
|
||||
return core._cuid2(ZodMiniCUID2, params);
|
||||
}
|
||||
export const ZodMiniULID = /*@__PURE__*/ core.$constructor("ZodMiniULID", (inst, def) => {
|
||||
core.$ZodULID.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function ulid(params) {
|
||||
return core._ulid(ZodMiniULID, params);
|
||||
}
|
||||
export const ZodMiniXID = /*@__PURE__*/ core.$constructor("ZodMiniXID", (inst, def) => {
|
||||
core.$ZodXID.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function xid(params) {
|
||||
return core._xid(ZodMiniXID, params);
|
||||
}
|
||||
export const ZodMiniKSUID = /*@__PURE__*/ core.$constructor("ZodMiniKSUID", (inst, def) => {
|
||||
core.$ZodKSUID.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function ksuid(params) {
|
||||
return core._ksuid(ZodMiniKSUID, params);
|
||||
}
|
||||
export const ZodMiniIPv4 = /*@__PURE__*/ core.$constructor("ZodMiniIPv4", (inst, def) => {
|
||||
core.$ZodIPv4.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function ipv4(params) {
|
||||
return core._ipv4(ZodMiniIPv4, params);
|
||||
}
|
||||
export const ZodMiniIPv6 = /*@__PURE__*/ core.$constructor("ZodMiniIPv6", (inst, def) => {
|
||||
core.$ZodIPv6.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function ipv6(params) {
|
||||
return core._ipv6(ZodMiniIPv6, params);
|
||||
}
|
||||
export const ZodMiniCIDRv4 = /*@__PURE__*/ core.$constructor("ZodMiniCIDRv4", (inst, def) => {
|
||||
core.$ZodCIDRv4.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function cidrv4(params) {
|
||||
return core._cidrv4(ZodMiniCIDRv4, params);
|
||||
}
|
||||
export const ZodMiniCIDRv6 = /*@__PURE__*/ core.$constructor("ZodMiniCIDRv6", (inst, def) => {
|
||||
core.$ZodCIDRv6.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function cidrv6(params) {
|
||||
return core._cidrv6(ZodMiniCIDRv6, params);
|
||||
}
|
||||
export const ZodMiniBase64 = /*@__PURE__*/ core.$constructor("ZodMiniBase64", (inst, def) => {
|
||||
core.$ZodBase64.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function base64(params) {
|
||||
return core._base64(ZodMiniBase64, params);
|
||||
}
|
||||
export const ZodMiniBase64URL = /*@__PURE__*/ core.$constructor("ZodMiniBase64URL", (inst, def) => {
|
||||
core.$ZodBase64URL.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function base64url(params) {
|
||||
return core._base64url(ZodMiniBase64URL, params);
|
||||
}
|
||||
export const ZodMiniE164 = /*@__PURE__*/ core.$constructor("ZodMiniE164", (inst, def) => {
|
||||
core.$ZodE164.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function e164(params) {
|
||||
return core._e164(ZodMiniE164, params);
|
||||
}
|
||||
export const ZodMiniJWT = /*@__PURE__*/ core.$constructor("ZodMiniJWT", (inst, def) => {
|
||||
core.$ZodJWT.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function jwt(params) {
|
||||
return core._jwt(ZodMiniJWT, params);
|
||||
}
|
||||
export const ZodMiniCustomStringFormat = /*@__PURE__*/ core.$constructor("ZodMiniCustomStringFormat", (inst, def) => {
|
||||
core.$ZodCustomStringFormat.init(inst, def);
|
||||
ZodMiniStringFormat.init(inst, def);
|
||||
});
|
||||
export function stringFormat(format, fnOrRegex, _params = {}) {
|
||||
return core._stringFormat(ZodMiniCustomStringFormat, format, fnOrRegex, _params);
|
||||
}
|
||||
export const ZodMiniNumber = /*@__PURE__*/ core.$constructor("ZodMiniNumber", (inst, def) => {
|
||||
core.$ZodNumber.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function number(params) {
|
||||
return core._number(ZodMiniNumber, params);
|
||||
}
|
||||
export const ZodMiniNumberFormat = /*@__PURE__*/ core.$constructor("ZodMiniNumberFormat", (inst, def) => {
|
||||
core.$ZodNumberFormat.init(inst, def);
|
||||
ZodMiniNumber.init(inst, def);
|
||||
});
|
||||
// int
|
||||
export function int(params) {
|
||||
return core._int(ZodMiniNumberFormat, params);
|
||||
}
|
||||
// float32
|
||||
export function float32(params) {
|
||||
return core._float32(ZodMiniNumberFormat, params);
|
||||
}
|
||||
// float64
|
||||
export function float64(params) {
|
||||
return core._float64(ZodMiniNumberFormat, params);
|
||||
}
|
||||
// int32
|
||||
export function int32(params) {
|
||||
return core._int32(ZodMiniNumberFormat, params);
|
||||
}
|
||||
// uint32
|
||||
export function uint32(params) {
|
||||
return core._uint32(ZodMiniNumberFormat, params);
|
||||
}
|
||||
export const ZodMiniBoolean = /*@__PURE__*/ core.$constructor("ZodMiniBoolean", (inst, def) => {
|
||||
core.$ZodBoolean.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function boolean(params) {
|
||||
return core._boolean(ZodMiniBoolean, params);
|
||||
}
|
||||
export const ZodMiniBigInt = /*@__PURE__*/ core.$constructor("ZodMiniBigInt", (inst, def) => {
|
||||
core.$ZodBigInt.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function bigint(params) {
|
||||
return core._bigint(ZodMiniBigInt, params);
|
||||
}
|
||||
export const ZodMiniBigIntFormat = /*@__PURE__*/ core.$constructor("ZodMiniBigIntFormat", (inst, def) => {
|
||||
core.$ZodBigIntFormat.init(inst, def);
|
||||
ZodMiniBigInt.init(inst, def);
|
||||
});
|
||||
// int64
|
||||
export function int64(params) {
|
||||
return core._int64(ZodMiniBigIntFormat, params);
|
||||
}
|
||||
// uint64
|
||||
export function uint64(params) {
|
||||
return core._uint64(ZodMiniBigIntFormat, params);
|
||||
}
|
||||
export const ZodMiniSymbol = /*@__PURE__*/ core.$constructor("ZodMiniSymbol", (inst, def) => {
|
||||
core.$ZodSymbol.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function symbol(params) {
|
||||
return core._symbol(ZodMiniSymbol, params);
|
||||
}
|
||||
export const ZodMiniUndefined = /*@__PURE__*/ core.$constructor("ZodMiniUndefined", (inst, def) => {
|
||||
core.$ZodUndefined.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
function _undefined(params) {
|
||||
return core._undefined(ZodMiniUndefined, params);
|
||||
}
|
||||
export { _undefined as undefined };
|
||||
export const ZodMiniNull = /*@__PURE__*/ core.$constructor("ZodMiniNull", (inst, def) => {
|
||||
core.$ZodNull.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
function _null(params) {
|
||||
return core._null(ZodMiniNull, params);
|
||||
}
|
||||
export { _null as null };
|
||||
export const ZodMiniAny = /*@__PURE__*/ core.$constructor("ZodMiniAny", (inst, def) => {
|
||||
core.$ZodAny.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function any() {
|
||||
return core._any(ZodMiniAny);
|
||||
}
|
||||
export const ZodMiniUnknown = /*@__PURE__*/ core.$constructor("ZodMiniUnknown", (inst, def) => {
|
||||
core.$ZodUnknown.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function unknown() {
|
||||
return core._unknown(ZodMiniUnknown);
|
||||
}
|
||||
export const ZodMiniNever = /*@__PURE__*/ core.$constructor("ZodMiniNever", (inst, def) => {
|
||||
core.$ZodNever.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function never(params) {
|
||||
return core._never(ZodMiniNever, params);
|
||||
}
|
||||
export const ZodMiniVoid = /*@__PURE__*/ core.$constructor("ZodMiniVoid", (inst, def) => {
|
||||
core.$ZodVoid.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
function _void(params) {
|
||||
return core._void(ZodMiniVoid, params);
|
||||
}
|
||||
export { _void as void };
|
||||
export const ZodMiniDate = /*@__PURE__*/ core.$constructor("ZodMiniDate", (inst, def) => {
|
||||
core.$ZodDate.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function date(params) {
|
||||
return core._date(ZodMiniDate, params);
|
||||
}
|
||||
export const ZodMiniArray = /*@__PURE__*/ core.$constructor("ZodMiniArray", (inst, def) => {
|
||||
core.$ZodArray.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function array(element, params) {
|
||||
return new ZodMiniArray({
|
||||
type: "array",
|
||||
element: element,
|
||||
...util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
// .keyof
|
||||
export function keyof(schema) {
|
||||
const shape = schema._zod.def.shape;
|
||||
return literal(Object.keys(shape));
|
||||
}
|
||||
export const ZodMiniObject = /*@__PURE__*/ core.$constructor("ZodMiniObject", (inst, def) => {
|
||||
core.$ZodObject.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
util.defineLazy(inst, "shape", () => def.shape);
|
||||
});
|
||||
export function object(shape, params) {
|
||||
const def = {
|
||||
type: "object",
|
||||
get shape() {
|
||||
util.assignProp(this, "shape", { ...shape });
|
||||
return this.shape;
|
||||
},
|
||||
...util.normalizeParams(params),
|
||||
};
|
||||
return new ZodMiniObject(def);
|
||||
}
|
||||
// strictObject
|
||||
export function strictObject(shape, params) {
|
||||
return new ZodMiniObject({
|
||||
type: "object",
|
||||
// shape: shape as core.$ZodLooseShape,
|
||||
get shape() {
|
||||
util.assignProp(this, "shape", { ...shape });
|
||||
return this.shape;
|
||||
},
|
||||
catchall: never(),
|
||||
...util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
// looseObject
|
||||
export function looseObject(shape, params) {
|
||||
return new ZodMiniObject({
|
||||
type: "object",
|
||||
// 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),
|
||||
});
|
||||
}
|
||||
// object methods
|
||||
export function extend(schema, shape) {
|
||||
return util.extend(schema, shape);
|
||||
}
|
||||
export function merge(schema, shape) {
|
||||
return util.extend(schema, shape);
|
||||
}
|
||||
export function pick(schema, mask) {
|
||||
return util.pick(schema, mask);
|
||||
}
|
||||
// .omit
|
||||
export function omit(schema, mask) {
|
||||
return util.omit(schema, mask);
|
||||
}
|
||||
export function partial(schema, mask) {
|
||||
return util.partial(ZodMiniOptional, schema, mask);
|
||||
}
|
||||
export function required(schema, mask) {
|
||||
return util.required(ZodMiniNonOptional, schema, mask);
|
||||
}
|
||||
export function catchall(inst, catchall) {
|
||||
return inst.clone({ ...inst._zod.def, catchall: catchall });
|
||||
}
|
||||
export const ZodMiniUnion = /*@__PURE__*/ core.$constructor("ZodMiniUnion", (inst, def) => {
|
||||
core.$ZodUnion.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function union(options, params) {
|
||||
return new ZodMiniUnion({
|
||||
type: "union",
|
||||
options: options,
|
||||
...util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
export const ZodMiniDiscriminatedUnion = /*@__PURE__*/ core.$constructor("ZodMiniDiscriminatedUnion", (inst, def) => {
|
||||
core.$ZodDiscriminatedUnion.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function discriminatedUnion(discriminator, options, params) {
|
||||
return new ZodMiniDiscriminatedUnion({
|
||||
type: "union",
|
||||
options,
|
||||
discriminator,
|
||||
...util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
export const ZodMiniIntersection = /*@__PURE__*/ core.$constructor("ZodMiniIntersection", (inst, def) => {
|
||||
core.$ZodIntersection.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function intersection(left, right) {
|
||||
return new ZodMiniIntersection({
|
||||
type: "intersection",
|
||||
left: left,
|
||||
right: right,
|
||||
});
|
||||
}
|
||||
export const ZodMiniTuple = /*@__PURE__*/ core.$constructor("ZodMiniTuple", (inst, def) => {
|
||||
core.$ZodTuple.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function tuple(items, _paramsOrRest, _params) {
|
||||
const hasRest = _paramsOrRest instanceof core.$ZodType;
|
||||
const params = hasRest ? _params : _paramsOrRest;
|
||||
const rest = hasRest ? _paramsOrRest : null;
|
||||
return new ZodMiniTuple({
|
||||
type: "tuple",
|
||||
items: items,
|
||||
rest,
|
||||
...util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
export const ZodMiniRecord = /*@__PURE__*/ core.$constructor("ZodMiniRecord", (inst, def) => {
|
||||
core.$ZodRecord.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function record(keyType, valueType, params) {
|
||||
return new ZodMiniRecord({
|
||||
type: "record",
|
||||
keyType,
|
||||
valueType: valueType,
|
||||
...util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
export function partialRecord(keyType, valueType, params) {
|
||||
return new ZodMiniRecord({
|
||||
type: "record",
|
||||
keyType: union([keyType, never()]),
|
||||
valueType: valueType,
|
||||
...util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
export const ZodMiniMap = /*@__PURE__*/ core.$constructor("ZodMiniMap", (inst, def) => {
|
||||
core.$ZodMap.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function map(keyType, valueType, params) {
|
||||
return new ZodMiniMap({
|
||||
type: "map",
|
||||
keyType: keyType,
|
||||
valueType: valueType,
|
||||
...util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
export const ZodMiniSet = /*@__PURE__*/ core.$constructor("ZodMiniSet", (inst, def) => {
|
||||
core.$ZodSet.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function set(valueType, params) {
|
||||
return new ZodMiniSet({
|
||||
type: "set",
|
||||
valueType: valueType,
|
||||
...util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
export const ZodMiniEnum = /*@__PURE__*/ core.$constructor("ZodMiniEnum", (inst, def) => {
|
||||
core.$ZodEnum.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
function _enum(values, params) {
|
||||
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
||||
return new ZodMiniEnum({
|
||||
type: "enum",
|
||||
entries,
|
||||
...util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
export { _enum as enum };
|
||||
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
|
||||
*
|
||||
* ```ts
|
||||
* enum Colors { red, green, blue }
|
||||
* z.enum(Colors);
|
||||
* ```
|
||||
*/
|
||||
export function nativeEnum(entries, params) {
|
||||
return new ZodMiniEnum({
|
||||
type: "enum",
|
||||
entries,
|
||||
...util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
export const ZodMiniLiteral = /*@__PURE__*/ core.$constructor("ZodMiniLiteral", (inst, def) => {
|
||||
core.$ZodLiteral.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function literal(value, params) {
|
||||
return new ZodMiniLiteral({
|
||||
type: "literal",
|
||||
values: Array.isArray(value) ? value : [value],
|
||||
...util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
export const ZodMiniFile = /*@__PURE__*/ core.$constructor("ZodMiniFile", (inst, def) => {
|
||||
core.$ZodFile.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function file(params) {
|
||||
return core._file(ZodMiniFile, params);
|
||||
}
|
||||
export const ZodMiniTransform = /*@__PURE__*/ core.$constructor("ZodMiniTransform", (inst, def) => {
|
||||
core.$ZodTransform.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function transform(fn) {
|
||||
return new ZodMiniTransform({
|
||||
type: "transform",
|
||||
transform: fn,
|
||||
});
|
||||
}
|
||||
export const ZodMiniOptional = /*@__PURE__*/ core.$constructor("ZodMiniOptional", (inst, def) => {
|
||||
core.$ZodOptional.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function optional(innerType) {
|
||||
return new ZodMiniOptional({
|
||||
type: "optional",
|
||||
innerType: innerType,
|
||||
});
|
||||
}
|
||||
export const ZodMiniNullable = /*@__PURE__*/ core.$constructor("ZodMiniNullable", (inst, def) => {
|
||||
core.$ZodNullable.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function nullable(innerType) {
|
||||
return new ZodMiniNullable({
|
||||
type: "nullable",
|
||||
innerType: innerType,
|
||||
});
|
||||
}
|
||||
// nullish
|
||||
export function nullish(innerType) {
|
||||
return optional(nullable(innerType));
|
||||
}
|
||||
export const ZodMiniDefault = /*@__PURE__*/ core.$constructor("ZodMiniDefault", (inst, def) => {
|
||||
core.$ZodDefault.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function _default(innerType, defaultValue) {
|
||||
return new ZodMiniDefault({
|
||||
type: "default",
|
||||
innerType: innerType,
|
||||
get defaultValue() {
|
||||
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
||||
},
|
||||
});
|
||||
}
|
||||
export const ZodMiniPrefault = /*@__PURE__*/ core.$constructor("ZodMiniPrefault", (inst, def) => {
|
||||
core.$ZodPrefault.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function prefault(innerType, defaultValue) {
|
||||
return new ZodMiniPrefault({
|
||||
type: "prefault",
|
||||
innerType: innerType,
|
||||
get defaultValue() {
|
||||
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
||||
},
|
||||
});
|
||||
}
|
||||
export const ZodMiniNonOptional = /*@__PURE__*/ core.$constructor("ZodMiniNonOptional", (inst, def) => {
|
||||
core.$ZodNonOptional.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function nonoptional(innerType, params) {
|
||||
return new ZodMiniNonOptional({
|
||||
type: "nonoptional",
|
||||
innerType: innerType,
|
||||
...util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
export const ZodMiniSuccess = /*@__PURE__*/ core.$constructor("ZodMiniSuccess", (inst, def) => {
|
||||
core.$ZodSuccess.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function success(innerType) {
|
||||
return new ZodMiniSuccess({
|
||||
type: "success",
|
||||
innerType: innerType,
|
||||
});
|
||||
}
|
||||
export const ZodMiniCatch = /*@__PURE__*/ core.$constructor("ZodMiniCatch", (inst, def) => {
|
||||
core.$ZodCatch.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
function _catch(innerType, catchValue) {
|
||||
return new ZodMiniCatch({
|
||||
type: "catch",
|
||||
innerType: innerType,
|
||||
catchValue: (typeof catchValue === "function" ? catchValue : () => catchValue),
|
||||
});
|
||||
}
|
||||
export { _catch as catch };
|
||||
export const ZodMiniNaN = /*@__PURE__*/ core.$constructor("ZodMiniNaN", (inst, def) => {
|
||||
core.$ZodNaN.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function nan(params) {
|
||||
return core._nan(ZodMiniNaN, params);
|
||||
}
|
||||
export const ZodMiniPipe = /*@__PURE__*/ core.$constructor("ZodMiniPipe", (inst, def) => {
|
||||
core.$ZodPipe.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function pipe(in_, out) {
|
||||
return new ZodMiniPipe({
|
||||
type: "pipe",
|
||||
in: in_,
|
||||
out: out,
|
||||
});
|
||||
}
|
||||
export const ZodMiniReadonly = /*@__PURE__*/ core.$constructor("ZodMiniReadonly", (inst, def) => {
|
||||
core.$ZodReadonly.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function readonly(innerType) {
|
||||
return new ZodMiniReadonly({
|
||||
type: "readonly",
|
||||
innerType: innerType,
|
||||
});
|
||||
}
|
||||
export const ZodMiniTemplateLiteral = /*@__PURE__*/ core.$constructor("ZodMiniTemplateLiteral", (inst, def) => {
|
||||
core.$ZodTemplateLiteral.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function templateLiteral(parts, params) {
|
||||
return new ZodMiniTemplateLiteral({
|
||||
type: "template_literal",
|
||||
parts,
|
||||
...util.normalizeParams(params),
|
||||
});
|
||||
}
|
||||
export const ZodMiniLazy = /*@__PURE__*/ core.$constructor("ZodMiniLazy", (inst, def) => {
|
||||
core.$ZodLazy.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
// export function lazy<T extends object>(getter: () => T): T {
|
||||
// return util.createTransparentProxy<T>(getter);
|
||||
// }
|
||||
function _lazy(getter) {
|
||||
return new ZodMiniLazy({
|
||||
type: "lazy",
|
||||
getter: getter,
|
||||
});
|
||||
}
|
||||
export { _lazy as lazy };
|
||||
export const ZodMiniPromise = /*@__PURE__*/ core.$constructor("ZodMiniPromise", (inst, def) => {
|
||||
core.$ZodPromise.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
export function promise(innerType) {
|
||||
return new ZodMiniPromise({
|
||||
type: "promise",
|
||||
innerType: innerType,
|
||||
});
|
||||
}
|
||||
export const ZodMiniCustom = /*@__PURE__*/ core.$constructor("ZodMiniCustom", (inst, def) => {
|
||||
core.$ZodCustom.init(inst, def);
|
||||
ZodMiniType.init(inst, def);
|
||||
});
|
||||
// custom checks
|
||||
export function check(fn, params) {
|
||||
const ch = new core.$ZodCheck({
|
||||
check: "custom",
|
||||
...util.normalizeParams(params),
|
||||
});
|
||||
ch._zod.check = fn;
|
||||
return ch;
|
||||
}
|
||||
// ZodCustom
|
||||
// custom schema
|
||||
export function custom(fn, _params) {
|
||||
return core._custom(ZodMiniCustom, fn ?? (() => true), _params);
|
||||
}
|
||||
// refine
|
||||
export function refine(fn, _params = {}) {
|
||||
return core._refine(ZodMiniCustom, fn, _params);
|
||||
}
|
||||
// instanceof
|
||||
class Class {
|
||||
constructor(..._args) { }
|
||||
}
|
||||
function _instanceof(cls, params = {
|
||||
error: `Input not instance of ${cls.name}`,
|
||||
}) {
|
||||
const inst = custom((data) => data instanceof cls, params);
|
||||
inst._zod.bag.Class = cls;
|
||||
return inst;
|
||||
}
|
||||
export { _instanceof as instanceof };
|
||||
// stringbool
|
||||
export const stringbool = (...args) => core._stringbool({
|
||||
Pipe: ZodMiniPipe,
|
||||
Boolean: ZodMiniBoolean,
|
||||
String: ZodMiniString,
|
||||
Transform: ZodMiniTransform,
|
||||
}, ...args);
|
||||
export function json() {
|
||||
const jsonSchema = _lazy(() => {
|
||||
return union([string(), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);
|
||||
});
|
||||
return jsonSchema;
|
||||
}
|
Reference in New Issue
Block a user