@oxog/vld 3.0.4 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +985 -878
- package/README.md +28 -11
- package/dist/chunks/index-Bn85LHAC.js +1 -0
- package/dist/cjs/chunks/index-DJwZFerZ.cjs +1 -0
- package/dist/cjs/cli/bin.cjs +1 -1
- package/dist/cjs/compile.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locales/index.cjs +1 -1
- package/dist/cjs/locales/tg.cjs +1 -0
- package/dist/cjs/v3/index.cjs +1 -1
- package/dist/cjs/v4/core/index.cjs +1 -1
- package/dist/cjs/v4/index.cjs +1 -1
- package/dist/cjs/v4/locales/index.cjs +1 -1
- package/dist/cjs/v4/mini/index.cjs +1 -1
- package/dist/cjs/v4-mini/index.cjs +1 -1
- package/dist/cjs/validators/base.cjs +1 -1
- package/dist/cjs/validators/custom.cjs +1 -1
- package/dist/cjs/validators/promise.cjs +1 -1
- package/dist/cjs/validators/string-formats.cjs +1 -1
- package/dist/cjs/validators/string.cjs +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/compile.d.ts +15 -0
- package/dist/compile.js +1 -1
- package/dist/index.d.ts +50 -17
- package/dist/index.js +1 -1
- package/dist/locales/index.js +1 -1
- package/dist/locales/tg.d.ts +2 -0
- package/dist/locales/tg.js +1 -0
- package/dist/utils/json-schema.d.ts +4 -0
- package/dist/v3/index.js +1 -1
- package/dist/v4/core/index.d.ts +12 -2
- package/dist/v4/core/index.js +1 -1
- package/dist/v4/index.js +1 -1
- package/dist/v4/locales/index.d.ts +1 -0
- package/dist/v4/locales/index.js +1 -1
- package/dist/v4/mini/index.js +1 -1
- package/dist/v4-mini/index.d.ts +1 -1
- package/dist/v4-mini/index.js +1 -1
- package/dist/validators/array-v2.d.ts +1 -1
- package/dist/validators/base.d.ts +29 -0
- package/dist/validators/base.js +1 -1
- package/dist/validators/bigint-v2.d.ts +1 -1
- package/dist/validators/custom.d.ts +21 -1
- package/dist/validators/custom.js +1 -1
- package/dist/validators/date-v2.d.ts +1 -1
- package/dist/validators/number-v2.d.ts +1 -1
- package/dist/validators/object-v2.d.ts +5 -5
- package/dist/validators/promise.d.ts +7 -0
- package/dist/validators/promise.js +1 -1
- package/dist/validators/string-formats.d.ts +14 -1
- package/dist/validators/string-formats.js +1 -1
- package/dist/validators/string-v2.d.ts +2 -2
- package/dist/validators/string.d.ts +10 -0
- package/dist/validators/string.js +1 -1
- package/dist/validators/union-v2.d.ts +1 -1
- package/package.json +246 -245
- package/dist/chunks/index-CKPStM3V.js +0 -1
- package/dist/cjs/chunks/index-lejEpLfv.cjs +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ import { VldDiscriminatedUnion } from './validators/discriminated-union.js';
|
|
|
55
55
|
import { VldXor } from './validators/xor.js';
|
|
56
56
|
import { VldJson } from './validators/json.js';
|
|
57
57
|
import { VldTemplateLiteral } from './validators/template-literal.js';
|
|
58
|
-
import { VldCustom, custom as customFn } from './validators/custom.js';
|
|
58
|
+
import { VldCustom, VldInstance, custom as customFn } from './validators/custom.js';
|
|
59
59
|
import { VldFile } from './validators/file.js';
|
|
60
60
|
import { VldFunction } from './validators/function.js';
|
|
61
61
|
import { VldBrand, VldCatch, VldDefault, VldExactOptional, VldMeta, VldNullable, VldNullish, VldOptional, VldPipe, VldPrefault, VldPreprocess, VldReadonly, VldRefine, VldTransform } from './validators/base.js';
|
|
@@ -73,7 +73,7 @@ import { VldCoerceDate } from './coercion/date.js';
|
|
|
73
73
|
import { VldCoerceBigInt } from './coercion/bigint.js';
|
|
74
74
|
import { flattenError as flattenErrorFn, prettifyError as prettifyErrorFn, treeifyError as treeifyErrorFn } from './errors.js';
|
|
75
75
|
import { fromJSONSchema as fromJSONSchemaFn, toJSONSchema as toJSONSchemaFn } from './utils/json-schema.js';
|
|
76
|
-
import { validate as validateFn, validateAsync as validateAsyncFn, properties as propertiesFn, getDiscriminatedOption as getDiscriminatedOptionFn, toZod as toZodFn, ZodCompileError as ZodCompileErrorClass, ZodCompileAsyncError as ZodCompileAsyncErrorClass, ZodCompileUnsupportedError as ZodCompileUnsupportedErrorClass } from './compile.js';
|
|
76
|
+
import { validate as validateFn, validateAsync as validateAsyncFn, properties as propertiesFn, getDiscriminatedOption as getDiscriminatedOptionFn, toZod as toZodFn, withParser as withParserFn, COMPILE_INVALID, ZodCompileError as ZodCompileErrorClass, ZodCompileAsyncError as ZodCompileAsyncErrorClass, ZodCompileUnsupportedError as ZodCompileUnsupportedErrorClass } from './compile.js';
|
|
77
77
|
import * as stringFormats from './validators/string-formats.js';
|
|
78
78
|
type NativeEnumLike = Record<string, string | number>;
|
|
79
79
|
type Constructor<T = unknown> = abstract new (...args: any[]) => T;
|
|
@@ -145,7 +145,7 @@ export declare const core: {
|
|
|
145
145
|
readonly nullish: (value: unknown) => value is null | undefined;
|
|
146
146
|
readonly cached: <T>(getter: () => T) => (() => T);
|
|
147
147
|
};
|
|
148
|
-
readonly regexes: Readonly<Record<"number" | "bigint" | "boolean" | "undefined" | "integer" | "date" | "null" | "hex" | "base64" | "email" | "base64url" | "jwt" | "nanoid" | "cuid" | "cuid2" | "ulid" | "cidrv4" | "cidrv6" | "e164" | "xid" | "guid" | "ksuid" | "duration" | "ipv4" | "ipv6" | "browserEmail" | "creditCard" | "domain" | "extendedDuration" | "hostname" | "html5Email" | "httpProtocol" | "httpUrl" | "idnEmail" | "lowercase" | "md5" | "md5_base64" | "md5_base64url" | "md5_hex" | "rfc5322Email" | "sha1" | "sha1_base64" | "sha1_base64url" | "sha1_hex" | "sha256" | "sha256_base64" | "sha256_base64url" | "sha256_hex" | "sha384" | "sha384_base64" | "sha384_base64url" | "sha384_hex" | "sha512" | "sha512_base64" | "sha512_base64url" | "sha512_hex" | "unicodeEmail" | "uppercase" | "uuid4" | "uuid6" | "uuid7", RegExp> & {
|
|
148
|
+
readonly regexes: Readonly<Record<"number" | "bigint" | "boolean" | "undefined" | "integer" | "date" | "null" | "hex" | "base64" | "email" | "base64url" | "jwt" | "nanoid" | "cuid" | "cuid2" | "ulid" | "cidrv4" | "cidrv6" | "e164" | "xid" | "guid" | "ksuid" | "duration" | "ipv4" | "ipv6" | "anyString" | "browserEmail" | "creditCard" | "currencyCode" | "domain" | "extendedDuration" | "hostname" | "html5Email" | "httpProtocol" | "httpUrl" | "iban" | "idnEmail" | "lowercase" | "md5" | "md5_base64" | "md5_base64url" | "md5_hex" | "rfc5322Email" | "sha1" | "sha1_base64" | "sha1_base64url" | "sha1_hex" | "sha256" | "sha256_base64" | "sha256_base64url" | "sha256_hex" | "sha384" | "sha384_base64" | "sha384_base64url" | "sha384_hex" | "sha512" | "sha512_base64" | "sha512_base64url" | "sha512_hex" | "unicodeEmail" | "uppercase" | "uuid4" | "uuid6" | "uuid7", RegExp> & {
|
|
149
149
|
nanoidOfLength: (length: number) => RegExp;
|
|
150
150
|
datetime: (options?: stringFormats.ISODateTimeOptions) => RegExp;
|
|
151
151
|
emoji: () => RegExp;
|
|
@@ -193,8 +193,8 @@ export type { Infer, Input, Output } from './validators/index.js';
|
|
|
193
193
|
export { VldBase } from './validators/base.js';
|
|
194
194
|
export { VldIntersection } from './validators/intersection.js';
|
|
195
195
|
export { VldMeta, type SchemaMetadata } from './validators/base.js';
|
|
196
|
-
export { VldBase as ZodType, VldAny as ZodAny, VldArray as ZodArray, VldBigInt as ZodBigInt, VldBigInt as ZodBigIntFormat, VldBoolean as ZodBoolean, VldBrand as ZodBranded, VldCatch as ZodCatch, VldCodec as ZodCodec, VldCustom as ZodCustom, VldCustom as ZodSuccess, VldDate as ZodDate, VldDefault as ZodDefault, VldDiscriminatedUnion as ZodDiscriminatedUnion, VldEnum as ZodEnum, VldExactOptional as ZodExactOptional, VldFile as ZodFile, VldFunction as ZodFunction, VldIntersection as ZodIntersection, VldJson as ZodJSON, VldLazy as ZodLazy, VldLiteral as ZodLiteral, VldMap as ZodMap, VldMeta as ZodMeta, VldNan as ZodNaN, VldNever as ZodNever, VldNull as ZodNull, VldNullable as ZodNullable, VldNumber as ZodNumber, VldNumber as ZodNumberFormat, VldObject as ZodObject, VldOptional as ZodOptional, VldPipe as ZodPipe, VldPrefault as ZodPrefault, VldPreprocess as ZodPreprocess, VldPromise as ZodPromise, VldReadonly as ZodReadonly, VldRecord as ZodRecord, VldRefine as ZodNonOptional, VldSet as ZodSet, VldString as ZodString, VldSymbol as ZodSymbol, VldTemplateLiteral as ZodTemplateLiteral, VldTuple as ZodTuple, VldTransform as ZodTransform, VldUndefined as ZodUndefined, VldUnion as ZodUnion, VldUnknown as ZodUnknown, VldVoid as ZodVoid, VldXor as ZodXor };
|
|
197
|
-
export { VldStringFormat as ZodBase64, VldStringFormat as ZodBase64URL, VldStringFormat as ZodCIDRv4, VldStringFormat as ZodCIDRv6, VldStringFormat as ZodCUID, VldStringFormat as ZodCUID2, VldStringFormat as ZodCreditCard, VldStringFormat as ZodCustomStringFormat, VldStringFormat as ZodE164, VldStringFormat as ZodEmail, VldStringFormat as ZodEmoji, VldStringFormat as ZodGUID, VldStringFormat as ZodIPv4, VldStringFormat as ZodIPv6, VldStringFormat as ZodISODate, VldStringFormat as ZodISODateTime, VldStringFormat as ZodISODuration, VldStringFormat as ZodISOTime, VldStringFormat as ZodJWT, VldStringFormat as ZodKSUID, VldStringFormat as ZodMAC, VldStringFormat as ZodNanoID, VldStringFormat as ZodStringFormat, VldStringFormat as ZodULID, VldStringFormat as ZodURL, VldStringFormat as ZodUUID, VldStringFormat as ZodXID } from './validators/string-formats.js';
|
|
196
|
+
export { VldBase as ZodType, VldAny as ZodAny, VldArray as ZodArray, VldBigInt as ZodBigInt, VldBigInt as ZodBigIntFormat, VldBoolean as ZodBoolean, VldBrand as ZodBranded, VldCatch as ZodCatch, VldCodec as ZodCodec, VldCustom as ZodCustom, VldCustom as ZodSuccess, VldDate as ZodDate, VldDefault as ZodDefault, VldDiscriminatedUnion as ZodDiscriminatedUnion, VldEnum as ZodEnum, VldExactOptional as ZodExactOptional, VldFile as ZodFile, VldFunction as ZodFunction, VldIntersection as ZodIntersection, VldInstance as ZodInstanceOf, VldJson as ZodJSON, VldLazy as ZodLazy, VldLiteral as ZodLiteral, VldMap as ZodMap, VldMeta as ZodMeta, VldNan as ZodNaN, VldNever as ZodNever, VldNull as ZodNull, VldNullable as ZodNullable, VldNumber as ZodNumber, VldNumber as ZodNumberFormat, VldObject as ZodObject, VldOptional as ZodOptional, VldPipe as ZodPipe, VldPrefault as ZodPrefault, VldPreprocess as ZodPreprocess, VldPromise as ZodPromise, VldReadonly as ZodReadonly, VldRecord as ZodRecord, VldRefine as ZodNonOptional, VldSet as ZodSet, VldString as ZodString, VldSymbol as ZodSymbol, VldTemplateLiteral as ZodTemplateLiteral, VldTuple as ZodTuple, VldTransform as ZodTransform, VldUndefined as ZodUndefined, VldUnion as ZodUnion, VldUnknown as ZodUnknown, VldVoid as ZodVoid, VldXor as ZodXor };
|
|
197
|
+
export { VldStringFormat as ZodBase64, VldStringFormat as ZodBase64URL, VldStringFormat as ZodCIDRv4, VldStringFormat as ZodCIDRv6, VldStringFormat as ZodCUID, VldStringFormat as ZodCUID2, VldStringFormat as ZodCreditCard, VldStringFormat as ZodCustomStringFormat, VldStringFormat as ZodE164, VldStringFormat as ZodEmail, VldStringFormat as ZodEmoji, VldStringFormat as ZodGUID, VldStringFormat as ZodIBAN, VldStringFormat as ZodIPv4, VldStringFormat as ZodIPv6, VldStringFormat as ZodISODate, VldStringFormat as ZodISODateTime, VldStringFormat as ZodISODuration, VldStringFormat as ZodISOTime, VldStringFormat as ZodJWT, VldStringFormat as ZodKSUID, VldStringFormat as ZodMAC, VldStringFormat as ZodNanoID, VldStringFormat as ZodStringFormat, VldStringFormat as ZodULID, VldStringFormat as ZodURL, VldStringFormat as ZodUUID, VldStringFormat as ZodXID } from './validators/string-formats.js';
|
|
198
198
|
export { VldError as ZodError, VldError as ZodRealError } from './errors.js';
|
|
199
199
|
export { registry, globalRegistry, type SchemaRegistry } from './registry.js';
|
|
200
200
|
export { setLocale, setLocaleAsync, registerLocale, getLocale, getMessages, isLocaleLoaded, getSupportedLocales, isLocaleSupported, type Locale } from './locales/index.js';
|
|
@@ -356,7 +356,7 @@ export declare const v: {
|
|
|
356
356
|
check: <T = unknown>(schemaOrPredicate: VldBase<unknown, T> | ((value: T) => boolean | Promise<boolean>), predicateOrMessage?: ((value: T) => boolean | Promise<boolean>) | RefinementMessage, message?: RefinementMessage) => VldBase<unknown, T>;
|
|
357
357
|
superRefine: <T = unknown>(schemaOrRefinement: VldBase<unknown, T> | ((value: T, ctx: SuperRefineContext) => void | Promise<void>), refinement?: (value: T, ctx: SuperRefineContext) => void | Promise<void>) => VldBase<unknown, T>;
|
|
358
358
|
property: typeof propertyCheck;
|
|
359
|
-
instanceof: <T>(constructor: Constructor<T>, message?: RefinementMessage) =>
|
|
359
|
+
instanceof: <T>(constructor: Constructor<T>, message?: RefinementMessage) => VldInstance<T>;
|
|
360
360
|
config: typeof configure;
|
|
361
361
|
setErrorMap: typeof setGlobalErrorMap;
|
|
362
362
|
getErrorMap: typeof getGlobalErrorMap;
|
|
@@ -372,7 +372,7 @@ export declare const v: {
|
|
|
372
372
|
readonly nullish: (value: unknown) => value is null | undefined;
|
|
373
373
|
readonly cached: <T>(getter: () => T) => (() => T);
|
|
374
374
|
};
|
|
375
|
-
readonly regexes: Readonly<Record<"number" | "bigint" | "boolean" | "undefined" | "integer" | "date" | "null" | "hex" | "base64" | "email" | "base64url" | "jwt" | "nanoid" | "cuid" | "cuid2" | "ulid" | "cidrv4" | "cidrv6" | "e164" | "xid" | "guid" | "ksuid" | "duration" | "ipv4" | "ipv6" | "browserEmail" | "creditCard" | "domain" | "extendedDuration" | "hostname" | "html5Email" | "httpProtocol" | "httpUrl" | "idnEmail" | "lowercase" | "md5" | "md5_base64" | "md5_base64url" | "md5_hex" | "rfc5322Email" | "sha1" | "sha1_base64" | "sha1_base64url" | "sha1_hex" | "sha256" | "sha256_base64" | "sha256_base64url" | "sha256_hex" | "sha384" | "sha384_base64" | "sha384_base64url" | "sha384_hex" | "sha512" | "sha512_base64" | "sha512_base64url" | "sha512_hex" | "unicodeEmail" | "uppercase" | "uuid4" | "uuid6" | "uuid7", RegExp> & {
|
|
375
|
+
readonly regexes: Readonly<Record<"number" | "bigint" | "boolean" | "undefined" | "integer" | "date" | "null" | "hex" | "base64" | "email" | "base64url" | "jwt" | "nanoid" | "cuid" | "cuid2" | "ulid" | "cidrv4" | "cidrv6" | "e164" | "xid" | "guid" | "ksuid" | "duration" | "ipv4" | "ipv6" | "anyString" | "browserEmail" | "creditCard" | "currencyCode" | "domain" | "extendedDuration" | "hostname" | "html5Email" | "httpProtocol" | "httpUrl" | "iban" | "idnEmail" | "lowercase" | "md5" | "md5_base64" | "md5_base64url" | "md5_hex" | "rfc5322Email" | "sha1" | "sha1_base64" | "sha1_base64url" | "sha1_hex" | "sha256" | "sha256_base64" | "sha256_base64url" | "sha256_hex" | "sha384" | "sha384_base64" | "sha384_base64url" | "sha384_hex" | "sha512" | "sha512_base64" | "sha512_base64url" | "sha512_hex" | "unicodeEmail" | "uppercase" | "uuid4" | "uuid6" | "uuid7", RegExp> & {
|
|
376
376
|
nanoidOfLength: (length: number) => RegExp;
|
|
377
377
|
datetime: (options?: stringFormats.ISODateTimeOptions) => RegExp;
|
|
378
378
|
emoji: () => RegExp;
|
|
@@ -474,6 +474,12 @@ export declare const v: {
|
|
|
474
474
|
creditCard: (params?: {
|
|
475
475
|
message?: string;
|
|
476
476
|
}) => stringFormats.VldStringFormat;
|
|
477
|
+
iban: (params?: {
|
|
478
|
+
message?: string;
|
|
479
|
+
}) => stringFormats.VldStringFormat;
|
|
480
|
+
currencyCode: (params?: {
|
|
481
|
+
message?: string;
|
|
482
|
+
}) => stringFormats.VldStringFormat;
|
|
477
483
|
e164: () => stringFormats.VldStringFormat;
|
|
478
484
|
hash: (algorithm: "md5" | "sha1" | "sha256" | "sha384" | "sha512") => stringFormats.VldStringFormat;
|
|
479
485
|
iso: {
|
|
@@ -519,7 +525,7 @@ export declare const v: {
|
|
|
519
525
|
guid: () => stringFormats.VldStringFormat;
|
|
520
526
|
httpUrl: () => stringFormats.VldStringFormat;
|
|
521
527
|
ksuid: () => stringFormats.VldStringFormat;
|
|
522
|
-
regexes: Readonly<Record<"number" | "bigint" | "boolean" | "undefined" | "integer" | "date" | "null" | "hex" | "base64" | "email" | "base64url" | "jwt" | "nanoid" | "cuid" | "cuid2" | "ulid" | "cidrv4" | "cidrv6" | "e164" | "xid" | "guid" | "ksuid" | "duration" | "ipv4" | "ipv6" | "browserEmail" | "creditCard" | "domain" | "extendedDuration" | "hostname" | "html5Email" | "httpProtocol" | "httpUrl" | "idnEmail" | "lowercase" | "md5" | "md5_base64" | "md5_base64url" | "md5_hex" | "rfc5322Email" | "sha1" | "sha1_base64" | "sha1_base64url" | "sha1_hex" | "sha256" | "sha256_base64" | "sha256_base64url" | "sha256_hex" | "sha384" | "sha384_base64" | "sha384_base64url" | "sha384_hex" | "sha512" | "sha512_base64" | "sha512_base64url" | "sha512_hex" | "unicodeEmail" | "uppercase" | "uuid4" | "uuid6" | "uuid7", RegExp> & {
|
|
528
|
+
regexes: Readonly<Record<"number" | "bigint" | "boolean" | "undefined" | "integer" | "date" | "null" | "hex" | "base64" | "email" | "base64url" | "jwt" | "nanoid" | "cuid" | "cuid2" | "ulid" | "cidrv4" | "cidrv6" | "e164" | "xid" | "guid" | "ksuid" | "duration" | "ipv4" | "ipv6" | "anyString" | "browserEmail" | "creditCard" | "currencyCode" | "domain" | "extendedDuration" | "hostname" | "html5Email" | "httpProtocol" | "httpUrl" | "iban" | "idnEmail" | "lowercase" | "md5" | "md5_base64" | "md5_base64url" | "md5_hex" | "rfc5322Email" | "sha1" | "sha1_base64" | "sha1_base64url" | "sha1_hex" | "sha256" | "sha256_base64" | "sha256_base64url" | "sha256_hex" | "sha384" | "sha384_base64" | "sha384_base64url" | "sha384_hex" | "sha512" | "sha512_base64" | "sha512_base64url" | "sha512_hex" | "unicodeEmail" | "uppercase" | "uuid4" | "uuid6" | "uuid7", RegExp> & {
|
|
523
529
|
nanoidOfLength: (length: number) => RegExp;
|
|
524
530
|
datetime: (options?: stringFormats.ISODateTimeOptions) => RegExp;
|
|
525
531
|
emoji: () => RegExp;
|
|
@@ -534,6 +540,8 @@ export declare const v: {
|
|
|
534
540
|
compile: <T extends VldBase<any, any>>(schema: T, options?: {
|
|
535
541
|
JITless?: boolean;
|
|
536
542
|
}) => T;
|
|
543
|
+
withParser: <T extends VldBase<any, any>>(schema: T, parser: (input: unknown) => unknown) => T;
|
|
544
|
+
INVALID: symbol;
|
|
537
545
|
validate: typeof validateFn;
|
|
538
546
|
validateAsync: typeof validateAsyncFn;
|
|
539
547
|
properties: typeof propertiesFn;
|
|
@@ -659,7 +667,7 @@ export declare const v: {
|
|
|
659
667
|
$input: symbol;
|
|
660
668
|
};
|
|
661
669
|
/**
|
|
662
|
-
* v3.0: vV2
|
|
670
|
+
* v3.0: vV2 - drop-in factory that uses V2 validators everywhere.
|
|
663
671
|
* Recommended for new code and migrations from Zod 4.5.
|
|
664
672
|
*
|
|
665
673
|
* import { vV2 as v } from '@oxog/vld';
|
|
@@ -890,7 +898,7 @@ export declare const z: {
|
|
|
890
898
|
check: <T = unknown>(schemaOrPredicate: VldBase<unknown, T> | ((value: T) => boolean | Promise<boolean>), predicateOrMessage?: ((value: T) => boolean | Promise<boolean>) | RefinementMessage, message?: RefinementMessage) => VldBase<unknown, T>;
|
|
891
899
|
superRefine: <T = unknown>(schemaOrRefinement: VldBase<unknown, T> | ((value: T, ctx: SuperRefineContext) => void | Promise<void>), refinement?: (value: T, ctx: SuperRefineContext) => void | Promise<void>) => VldBase<unknown, T>;
|
|
892
900
|
property: typeof propertyCheck;
|
|
893
|
-
instanceof: <T>(constructor: Constructor<T>, message?: RefinementMessage) =>
|
|
901
|
+
instanceof: <T>(constructor: Constructor<T>, message?: RefinementMessage) => VldInstance<T>;
|
|
894
902
|
config: typeof configure;
|
|
895
903
|
setErrorMap: typeof setGlobalErrorMap;
|
|
896
904
|
getErrorMap: typeof getGlobalErrorMap;
|
|
@@ -906,7 +914,7 @@ export declare const z: {
|
|
|
906
914
|
readonly nullish: (value: unknown) => value is null | undefined;
|
|
907
915
|
readonly cached: <T>(getter: () => T) => (() => T);
|
|
908
916
|
};
|
|
909
|
-
readonly regexes: Readonly<Record<"number" | "bigint" | "boolean" | "undefined" | "integer" | "date" | "null" | "hex" | "base64" | "email" | "base64url" | "jwt" | "nanoid" | "cuid" | "cuid2" | "ulid" | "cidrv4" | "cidrv6" | "e164" | "xid" | "guid" | "ksuid" | "duration" | "ipv4" | "ipv6" | "browserEmail" | "creditCard" | "domain" | "extendedDuration" | "hostname" | "html5Email" | "httpProtocol" | "httpUrl" | "idnEmail" | "lowercase" | "md5" | "md5_base64" | "md5_base64url" | "md5_hex" | "rfc5322Email" | "sha1" | "sha1_base64" | "sha1_base64url" | "sha1_hex" | "sha256" | "sha256_base64" | "sha256_base64url" | "sha256_hex" | "sha384" | "sha384_base64" | "sha384_base64url" | "sha384_hex" | "sha512" | "sha512_base64" | "sha512_base64url" | "sha512_hex" | "unicodeEmail" | "uppercase" | "uuid4" | "uuid6" | "uuid7", RegExp> & {
|
|
917
|
+
readonly regexes: Readonly<Record<"number" | "bigint" | "boolean" | "undefined" | "integer" | "date" | "null" | "hex" | "base64" | "email" | "base64url" | "jwt" | "nanoid" | "cuid" | "cuid2" | "ulid" | "cidrv4" | "cidrv6" | "e164" | "xid" | "guid" | "ksuid" | "duration" | "ipv4" | "ipv6" | "anyString" | "browserEmail" | "creditCard" | "currencyCode" | "domain" | "extendedDuration" | "hostname" | "html5Email" | "httpProtocol" | "httpUrl" | "iban" | "idnEmail" | "lowercase" | "md5" | "md5_base64" | "md5_base64url" | "md5_hex" | "rfc5322Email" | "sha1" | "sha1_base64" | "sha1_base64url" | "sha1_hex" | "sha256" | "sha256_base64" | "sha256_base64url" | "sha256_hex" | "sha384" | "sha384_base64" | "sha384_base64url" | "sha384_hex" | "sha512" | "sha512_base64" | "sha512_base64url" | "sha512_hex" | "unicodeEmail" | "uppercase" | "uuid4" | "uuid6" | "uuid7", RegExp> & {
|
|
910
918
|
nanoidOfLength: (length: number) => RegExp;
|
|
911
919
|
datetime: (options?: stringFormats.ISODateTimeOptions) => RegExp;
|
|
912
920
|
emoji: () => RegExp;
|
|
@@ -1008,6 +1016,12 @@ export declare const z: {
|
|
|
1008
1016
|
creditCard: (params?: {
|
|
1009
1017
|
message?: string;
|
|
1010
1018
|
}) => stringFormats.VldStringFormat;
|
|
1019
|
+
iban: (params?: {
|
|
1020
|
+
message?: string;
|
|
1021
|
+
}) => stringFormats.VldStringFormat;
|
|
1022
|
+
currencyCode: (params?: {
|
|
1023
|
+
message?: string;
|
|
1024
|
+
}) => stringFormats.VldStringFormat;
|
|
1011
1025
|
e164: () => stringFormats.VldStringFormat;
|
|
1012
1026
|
hash: (algorithm: "md5" | "sha1" | "sha256" | "sha384" | "sha512") => stringFormats.VldStringFormat;
|
|
1013
1027
|
iso: {
|
|
@@ -1053,7 +1067,7 @@ export declare const z: {
|
|
|
1053
1067
|
guid: () => stringFormats.VldStringFormat;
|
|
1054
1068
|
httpUrl: () => stringFormats.VldStringFormat;
|
|
1055
1069
|
ksuid: () => stringFormats.VldStringFormat;
|
|
1056
|
-
regexes: Readonly<Record<"number" | "bigint" | "boolean" | "undefined" | "integer" | "date" | "null" | "hex" | "base64" | "email" | "base64url" | "jwt" | "nanoid" | "cuid" | "cuid2" | "ulid" | "cidrv4" | "cidrv6" | "e164" | "xid" | "guid" | "ksuid" | "duration" | "ipv4" | "ipv6" | "browserEmail" | "creditCard" | "domain" | "extendedDuration" | "hostname" | "html5Email" | "httpProtocol" | "httpUrl" | "idnEmail" | "lowercase" | "md5" | "md5_base64" | "md5_base64url" | "md5_hex" | "rfc5322Email" | "sha1" | "sha1_base64" | "sha1_base64url" | "sha1_hex" | "sha256" | "sha256_base64" | "sha256_base64url" | "sha256_hex" | "sha384" | "sha384_base64" | "sha384_base64url" | "sha384_hex" | "sha512" | "sha512_base64" | "sha512_base64url" | "sha512_hex" | "unicodeEmail" | "uppercase" | "uuid4" | "uuid6" | "uuid7", RegExp> & {
|
|
1070
|
+
regexes: Readonly<Record<"number" | "bigint" | "boolean" | "undefined" | "integer" | "date" | "null" | "hex" | "base64" | "email" | "base64url" | "jwt" | "nanoid" | "cuid" | "cuid2" | "ulid" | "cidrv4" | "cidrv6" | "e164" | "xid" | "guid" | "ksuid" | "duration" | "ipv4" | "ipv6" | "anyString" | "browserEmail" | "creditCard" | "currencyCode" | "domain" | "extendedDuration" | "hostname" | "html5Email" | "httpProtocol" | "httpUrl" | "iban" | "idnEmail" | "lowercase" | "md5" | "md5_base64" | "md5_base64url" | "md5_hex" | "rfc5322Email" | "sha1" | "sha1_base64" | "sha1_base64url" | "sha1_hex" | "sha256" | "sha256_base64" | "sha256_base64url" | "sha256_hex" | "sha384" | "sha384_base64" | "sha384_base64url" | "sha384_hex" | "sha512" | "sha512_base64" | "sha512_base64url" | "sha512_hex" | "unicodeEmail" | "uppercase" | "uuid4" | "uuid6" | "uuid7", RegExp> & {
|
|
1057
1071
|
nanoidOfLength: (length: number) => RegExp;
|
|
1058
1072
|
datetime: (options?: stringFormats.ISODateTimeOptions) => RegExp;
|
|
1059
1073
|
emoji: () => RegExp;
|
|
@@ -1068,6 +1082,8 @@ export declare const z: {
|
|
|
1068
1082
|
compile: <T extends VldBase<any, any>>(schema: T, options?: {
|
|
1069
1083
|
JITless?: boolean;
|
|
1070
1084
|
}) => T;
|
|
1085
|
+
withParser: <T extends VldBase<any, any>>(schema: T, parser: (input: unknown) => unknown) => T;
|
|
1086
|
+
INVALID: symbol;
|
|
1071
1087
|
validate: typeof validateFn;
|
|
1072
1088
|
validateAsync: typeof validateAsyncFn;
|
|
1073
1089
|
properties: typeof propertiesFn;
|
|
@@ -1231,7 +1247,7 @@ export declare const string: () => VldString, number: () => VldNumber, int: () =
|
|
|
1231
1247
|
datetime: (options?: stringFormats.ISODateTimeOptions) => stringFormats.VldStringFormat;
|
|
1232
1248
|
dateTime: (options?: stringFormats.ISODateTimeOptions) => stringFormats.VldStringFormat;
|
|
1233
1249
|
duration: () => stringFormats.VldStringFormat;
|
|
1234
|
-
}, stringFormat: (name: string, validator: ((val: string) => boolean) | RegExp) => stringFormats.VldStringFormat, normalize: (form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})) => VldTransform<string, string, string>, slugify: () => VldTransform<string, string, string>, mime: (types: string | string[], message?: string) => VldFile, xid: () => stringFormats.VldStringFormat, guid: () => stringFormats.VldStringFormat, httpUrl: () => stringFormats.VldStringFormat, ksuid: () => stringFormats.VldStringFormat, regexes: Readonly<Record<"number" | "bigint" | "boolean" | "undefined" | "integer" | "date" | "null" | "hex" | "base64" | "email" | "base64url" | "jwt" | "nanoid" | "cuid" | "cuid2" | "ulid" | "cidrv4" | "cidrv6" | "e164" | "xid" | "guid" | "ksuid" | "duration" | "ipv4" | "ipv6" | "browserEmail" | "creditCard" | "domain" | "extendedDuration" | "hostname" | "html5Email" | "httpProtocol" | "httpUrl" | "idnEmail" | "lowercase" | "md5" | "md5_base64" | "md5_base64url" | "md5_hex" | "rfc5322Email" | "sha1" | "sha1_base64" | "sha1_base64url" | "sha1_hex" | "sha256" | "sha256_base64" | "sha256_base64url" | "sha256_hex" | "sha384" | "sha384_base64" | "sha384_base64url" | "sha384_hex" | "sha512" | "sha512_base64" | "sha512_base64url" | "sha512_hex" | "unicodeEmail" | "uppercase" | "uuid4" | "uuid6" | "uuid7", RegExp> & {
|
|
1250
|
+
}, stringFormat: (name: string, validator: ((val: string) => boolean) | RegExp) => stringFormats.VldStringFormat, normalize: (form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})) => VldTransform<string, string, string>, slugify: () => VldTransform<string, string, string>, mime: (types: string | string[], message?: string) => VldFile, xid: () => stringFormats.VldStringFormat, guid: () => stringFormats.VldStringFormat, httpUrl: () => stringFormats.VldStringFormat, ksuid: () => stringFormats.VldStringFormat, regexes: Readonly<Record<"number" | "bigint" | "boolean" | "undefined" | "integer" | "date" | "null" | "hex" | "base64" | "email" | "base64url" | "jwt" | "nanoid" | "cuid" | "cuid2" | "ulid" | "cidrv4" | "cidrv6" | "e164" | "xid" | "guid" | "ksuid" | "duration" | "ipv4" | "ipv6" | "anyString" | "browserEmail" | "creditCard" | "currencyCode" | "domain" | "extendedDuration" | "hostname" | "html5Email" | "httpProtocol" | "httpUrl" | "iban" | "idnEmail" | "lowercase" | "md5" | "md5_base64" | "md5_base64url" | "md5_hex" | "rfc5322Email" | "sha1" | "sha1_base64" | "sha1_base64url" | "sha1_hex" | "sha256" | "sha256_base64" | "sha256_base64url" | "sha256_hex" | "sha384" | "sha384_base64" | "sha384_base64url" | "sha384_hex" | "sha512" | "sha512_base64" | "sha512_base64url" | "sha512_hex" | "unicodeEmail" | "uppercase" | "uuid4" | "uuid6" | "uuid7", RegExp> & {
|
|
1235
1251
|
nanoidOfLength: (length: number) => RegExp;
|
|
1236
1252
|
datetime: (options?: stringFormats.ISODateTimeOptions) => RegExp;
|
|
1237
1253
|
emoji: () => RegExp;
|
|
@@ -1248,10 +1264,19 @@ export declare const string: () => VldString, number: () => VldNumber, int: () =
|
|
|
1248
1264
|
}) => VldCodec<TInput, TOutput>, promise: <T>(inner: VldBase<unknown, T>) => VldPromise<T>, prefault: <TInput, TOutput>(validator: VldBase<TInput, TOutput>, defaultValue: TInput | (() => TInput)) => VldPrefault<TInput, TOutput>, parse: <T>(schema: VldBase<unknown, T>, value: unknown) => T, safeParse: <T>(schema: VldBase<unknown, T>, value: unknown) => ParseResult<T>, parseAsync: <T>(schema: VldBase<unknown, T>, value: unknown) => Promise<T>, safeParseAsync: <T>(schema: VldBase<unknown, T>, value: unknown) => Promise<ParseResult<T>>, decode: <T>(schema: VldBase<unknown, T>, value: unknown) => T, safeDecode: <T>(schema: VldBase<unknown, T>, value: unknown) => ParseResult<T>, decodeAsync: <T>(schema: VldBase<unknown, T>, value: unknown) => Promise<T>, safeDecodeAsync: <T>(schema: VldBase<unknown, T>, value: unknown) => Promise<ParseResult<T>>, encode: <TInput, TOutput>(schema: VldBase<TInput, TOutput>, value: TOutput) => TInput, safeEncode: <TInput, TOutput>(schema: VldBase<TInput, TOutput>, value: TOutput) => ParseResult<TInput>, encodeAsync: <TInput, TOutput>(schema: VldBase<TInput, TOutput>, value: TOutput) => Promise<TInput>, safeEncodeAsync: <TInput, TOutput>(schema: VldBase<TInput, TOutput>, value: TOutput) => Promise<ParseResult<TInput>>, formatError: (error: Error) => FormattedError, NEVER: VldNever, compile: <T extends VldBase<any, any>>(schema: T, options?: {
|
|
1249
1265
|
JITless?: boolean;
|
|
1250
1266
|
}) => T, validate: typeof validateFn, validateAsync: typeof validateAsyncFn, properties: typeof propertiesFn, getDiscriminatedOption: typeof getDiscriminatedOptionFn, memoizer: <K extends object, V>(compute: (key: K) => V) => ((key: K) => V), toZod: typeof toZodFn;
|
|
1267
|
+
export { withParserFn as withParser };
|
|
1268
|
+
export { COMPILE_INVALID, COMPILE_INVALID as INVALID };
|
|
1269
|
+
export declare const iban: (params?: {
|
|
1270
|
+
message?: string;
|
|
1271
|
+
}) => stringFormats.VldStringFormat;
|
|
1272
|
+
export declare const currencyCode: (params?: {
|
|
1273
|
+
message?: string;
|
|
1274
|
+
}) => stringFormats.VldStringFormat;
|
|
1275
|
+
export { isValidIBAN } from './validators/string-formats.js';
|
|
1251
1276
|
declare const catchFactory: <T>(validator: VldBase<unknown, T>, fallbackValue: T) => VldCatch<unknown, T>;
|
|
1252
1277
|
declare const enumFactory: typeof enumFactoryCompat;
|
|
1253
1278
|
declare const functionFactory: () => VldFunction;
|
|
1254
|
-
declare const instanceOfFactory: <T>(constructor: Constructor<T>, message?: RefinementMessage) =>
|
|
1279
|
+
declare const instanceOfFactory: <T>(constructor: Constructor<T>, message?: RefinementMessage) => VldInstance<T>;
|
|
1255
1280
|
declare const mapFactory: <K, V>(key: VldBase<unknown, K>, value: VldBase<unknown, V>) => VldMap<K, V>;
|
|
1256
1281
|
declare const neverFactory: () => VldNever;
|
|
1257
1282
|
declare const nullFactory: () => VldNull;
|
|
@@ -1368,7 +1393,7 @@ declare const defaultFactory: {
|
|
|
1368
1393
|
check: <T = unknown>(schemaOrPredicate: VldBase<unknown, T> | ((value: T) => boolean | Promise<boolean>), predicateOrMessage?: ((value: T) => boolean | Promise<boolean>) | RefinementMessage, message?: RefinementMessage) => VldBase<unknown, T>;
|
|
1369
1394
|
superRefine: <T = unknown>(schemaOrRefinement: VldBase<unknown, T> | ((value: T, ctx: SuperRefineContext) => void | Promise<void>), refinement?: (value: T, ctx: SuperRefineContext) => void | Promise<void>) => VldBase<unknown, T>;
|
|
1370
1395
|
property: typeof propertyCheck;
|
|
1371
|
-
instanceof: <T>(constructor: Constructor<T>, message?: RefinementMessage) =>
|
|
1396
|
+
instanceof: <T>(constructor: Constructor<T>, message?: RefinementMessage) => VldInstance<T>;
|
|
1372
1397
|
config: typeof configure;
|
|
1373
1398
|
setErrorMap: typeof setGlobalErrorMap;
|
|
1374
1399
|
getErrorMap: typeof getGlobalErrorMap;
|
|
@@ -1384,7 +1409,7 @@ declare const defaultFactory: {
|
|
|
1384
1409
|
readonly nullish: (value: unknown) => value is null | undefined;
|
|
1385
1410
|
readonly cached: <T>(getter: () => T) => (() => T);
|
|
1386
1411
|
};
|
|
1387
|
-
readonly regexes: Readonly<Record<"number" | "bigint" | "boolean" | "undefined" | "integer" | "date" | "null" | "hex" | "base64" | "email" | "base64url" | "jwt" | "nanoid" | "cuid" | "cuid2" | "ulid" | "cidrv4" | "cidrv6" | "e164" | "xid" | "guid" | "ksuid" | "duration" | "ipv4" | "ipv6" | "browserEmail" | "creditCard" | "domain" | "extendedDuration" | "hostname" | "html5Email" | "httpProtocol" | "httpUrl" | "idnEmail" | "lowercase" | "md5" | "md5_base64" | "md5_base64url" | "md5_hex" | "rfc5322Email" | "sha1" | "sha1_base64" | "sha1_base64url" | "sha1_hex" | "sha256" | "sha256_base64" | "sha256_base64url" | "sha256_hex" | "sha384" | "sha384_base64" | "sha384_base64url" | "sha384_hex" | "sha512" | "sha512_base64" | "sha512_base64url" | "sha512_hex" | "unicodeEmail" | "uppercase" | "uuid4" | "uuid6" | "uuid7", RegExp> & {
|
|
1412
|
+
readonly regexes: Readonly<Record<"number" | "bigint" | "boolean" | "undefined" | "integer" | "date" | "null" | "hex" | "base64" | "email" | "base64url" | "jwt" | "nanoid" | "cuid" | "cuid2" | "ulid" | "cidrv4" | "cidrv6" | "e164" | "xid" | "guid" | "ksuid" | "duration" | "ipv4" | "ipv6" | "anyString" | "browserEmail" | "creditCard" | "currencyCode" | "domain" | "extendedDuration" | "hostname" | "html5Email" | "httpProtocol" | "httpUrl" | "iban" | "idnEmail" | "lowercase" | "md5" | "md5_base64" | "md5_base64url" | "md5_hex" | "rfc5322Email" | "sha1" | "sha1_base64" | "sha1_base64url" | "sha1_hex" | "sha256" | "sha256_base64" | "sha256_base64url" | "sha256_hex" | "sha384" | "sha384_base64" | "sha384_base64url" | "sha384_hex" | "sha512" | "sha512_base64" | "sha512_base64url" | "sha512_hex" | "unicodeEmail" | "uppercase" | "uuid4" | "uuid6" | "uuid7", RegExp> & {
|
|
1388
1413
|
nanoidOfLength: (length: number) => RegExp;
|
|
1389
1414
|
datetime: (options?: stringFormats.ISODateTimeOptions) => RegExp;
|
|
1390
1415
|
emoji: () => RegExp;
|
|
@@ -1486,6 +1511,12 @@ declare const defaultFactory: {
|
|
|
1486
1511
|
creditCard: (params?: {
|
|
1487
1512
|
message?: string;
|
|
1488
1513
|
}) => stringFormats.VldStringFormat;
|
|
1514
|
+
iban: (params?: {
|
|
1515
|
+
message?: string;
|
|
1516
|
+
}) => stringFormats.VldStringFormat;
|
|
1517
|
+
currencyCode: (params?: {
|
|
1518
|
+
message?: string;
|
|
1519
|
+
}) => stringFormats.VldStringFormat;
|
|
1489
1520
|
e164: () => stringFormats.VldStringFormat;
|
|
1490
1521
|
hash: (algorithm: "md5" | "sha1" | "sha256" | "sha384" | "sha512") => stringFormats.VldStringFormat;
|
|
1491
1522
|
iso: {
|
|
@@ -1531,7 +1562,7 @@ declare const defaultFactory: {
|
|
|
1531
1562
|
guid: () => stringFormats.VldStringFormat;
|
|
1532
1563
|
httpUrl: () => stringFormats.VldStringFormat;
|
|
1533
1564
|
ksuid: () => stringFormats.VldStringFormat;
|
|
1534
|
-
regexes: Readonly<Record<"number" | "bigint" | "boolean" | "undefined" | "integer" | "date" | "null" | "hex" | "base64" | "email" | "base64url" | "jwt" | "nanoid" | "cuid" | "cuid2" | "ulid" | "cidrv4" | "cidrv6" | "e164" | "xid" | "guid" | "ksuid" | "duration" | "ipv4" | "ipv6" | "browserEmail" | "creditCard" | "domain" | "extendedDuration" | "hostname" | "html5Email" | "httpProtocol" | "httpUrl" | "idnEmail" | "lowercase" | "md5" | "md5_base64" | "md5_base64url" | "md5_hex" | "rfc5322Email" | "sha1" | "sha1_base64" | "sha1_base64url" | "sha1_hex" | "sha256" | "sha256_base64" | "sha256_base64url" | "sha256_hex" | "sha384" | "sha384_base64" | "sha384_base64url" | "sha384_hex" | "sha512" | "sha512_base64" | "sha512_base64url" | "sha512_hex" | "unicodeEmail" | "uppercase" | "uuid4" | "uuid6" | "uuid7", RegExp> & {
|
|
1565
|
+
regexes: Readonly<Record<"number" | "bigint" | "boolean" | "undefined" | "integer" | "date" | "null" | "hex" | "base64" | "email" | "base64url" | "jwt" | "nanoid" | "cuid" | "cuid2" | "ulid" | "cidrv4" | "cidrv6" | "e164" | "xid" | "guid" | "ksuid" | "duration" | "ipv4" | "ipv6" | "anyString" | "browserEmail" | "creditCard" | "currencyCode" | "domain" | "extendedDuration" | "hostname" | "html5Email" | "httpProtocol" | "httpUrl" | "iban" | "idnEmail" | "lowercase" | "md5" | "md5_base64" | "md5_base64url" | "md5_hex" | "rfc5322Email" | "sha1" | "sha1_base64" | "sha1_base64url" | "sha1_hex" | "sha256" | "sha256_base64" | "sha256_base64url" | "sha256_hex" | "sha384" | "sha384_base64" | "sha384_base64url" | "sha384_hex" | "sha512" | "sha512_base64" | "sha512_base64url" | "sha512_hex" | "unicodeEmail" | "uppercase" | "uuid4" | "uuid6" | "uuid7", RegExp> & {
|
|
1535
1566
|
nanoidOfLength: (length: number) => RegExp;
|
|
1536
1567
|
datetime: (options?: stringFormats.ISODateTimeOptions) => RegExp;
|
|
1537
1568
|
emoji: () => RegExp;
|
|
@@ -1546,6 +1577,8 @@ declare const defaultFactory: {
|
|
|
1546
1577
|
compile: <T extends VldBase<any, any>>(schema: T, options?: {
|
|
1547
1578
|
JITless?: boolean;
|
|
1548
1579
|
}) => T;
|
|
1580
|
+
withParser: <T extends VldBase<any, any>>(schema: T, parser: (input: unknown) => unknown) => T;
|
|
1581
|
+
INVALID: symbol;
|
|
1549
1582
|
validate: typeof validateFn;
|
|
1550
1583
|
validateAsync: typeof validateAsyncFn;
|
|
1551
1584
|
properties: typeof propertiesFn;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{VLD_VALIDATOR_TYPES as Z,configureSchemaCompositionFactories as V,VldBase as S,VldDefault as O,VldPreprocess as E,VldExactOptional as I,VldNullish as L,VldNullable as _,VldOptional as M,resolveErrorMessage as T,VldPipe as N,VldPrefault as D,VldCatch as U,VldReadonly as P,VldMeta as R,VldRefine as $,VldTransform as F}from"./validators/base.js";export{VldBrand as ZodBranded}from"./validators/base.js";import{globalRegistry as J,registry as W}from"./registry.js";import{VldString as K}from"./validators/string.js";import{VldCoerceStringV2 as G,VldStringV2 as X}from"./validators/string-v2.js";import{VldCoerceNumberV2 as H,VldNumberV2 as Y}from"./validators/number-v2.js";import{VldDateV2 as Q}from"./validators/date-v2.js";import{VldBigIntV2 as ee}from"./validators/bigint-v2.js";import{VldArrayV2 as te}from"./validators/array-v2.js";import{VldUnionV2 as re}from"./validators/union-v2.js";import{VldRefineV2 as ae,VldTransformV2 as ne,VldNullishV2 as oe,VldNullableV2 as ie,VldOptionalV2 as se}from"./validators/wrapper-v2.js";import{VldEnumV2 as ce,VldLiteralV2 as ue,VldRecordV2 as le,VldBooleanV2 as me,VldFunctionV2 as de,VldSymbolV2 as fe,VldUndefinedV2 as pe,VldNullV2 as ye,VldNeverV2 as ve,VldVoidV2 as ge,VldUnknownV2 as he,VldAnyV2 as be}from"./validators/leaf-v2.js";import{VldIntersectionV2 as xe,VldMapV2 as Ze,VldSetV2 as Ve,VldTupleV2 as je}from"./validators/composite-v2.js";import{VldNumber as Se}from"./validators/number.js";import{VldBoolean as Oe}from"./validators/boolean.js";import{VldDate as Ae}from"./validators/date.js";import{VldStringBool as we}from"./validators/string-bool.js";import{VldArray as Ee}from"./validators/array.js";import{VldObject as Ie}from"./validators/object.js";import{VldUnion as Le}from"./validators/union.js";import{VldLiteral as _e}from"./validators/literal.js";import{VldBigInt as Me}from"./validators/bigint.js";import{VldSymbol as Te}from"./validators/symbol.js";import{VldTuple as Ne}from"./validators/tuple.js";import{VldRecord as De}from"./validators/record.js";import{VldSet as Ue}from"./validators/set.js";import{VldMap as Ce}from"./validators/map.js";import{VldEnum as Pe}from"./validators/enum.js";import{VldIntersection as Re}from"./validators/intersection.js";import{VldAny as ke}from"./validators/any.js";import{VldUnknown as Be}from"./validators/unknown.js";import{VldVoid as $e}from"./validators/void.js";import{VldNever as ze}from"./validators/never.js";import{VldNull as Fe}from"./validators/null.js";import{VldUndefined as Je}from"./validators/undefined.js";import{VldNan as We}from"./validators/nan.js";import{VldLazy as Ke}from"./validators/lazy.js";import{VldDiscriminatedUnion as qe}from"./validators/discriminated-union.js";import{VldXor as Ge}from"./validators/xor.js";import{VldJson as Xe}from"./validators/json.js";import{VldTemplateLiteral as He,templateLiteral as Ye}from"./validators/template-literal.js";import{VldCustom as Qe,custom as et}from"./validators/custom.js";import{VldFile as tt,file as rt}from"./validators/file.js";import{VldFunction as at,functionValidator as nt}from"./validators/function.js";import{VldCodec as ot}from"./validators/codec.js";import{VldBase64 as it}from"./validators/base64.js";import{VldHex as st}from"./validators/hex.js";import{VldUint8Array as ct}from"./validators/uint8array.js";import{VldPromise as ut,promise as lt}from"./validators/promise.js";import{map as mt}from"./compat/result.js";export{Err,Ok,ResultUtils,all,failure,flatMap,fromNullable,isErr,isOk,isResult,mapErr,match,success,tryCatch,tryCatchAsync,unwrap,unwrapOr}from"./compat/result.js";import{l as dt}from"./chunks/index-CKPStM3V.js";export{s as setLocaleAsync}from"./chunks/index-CKPStM3V.js";import{VldCoerceBigInt as ft,VldCoerceDate as pt,VldCoerceBoolean as yt,VldCoerceNumber as vt,VldCoerceString as gt}from"./coercion/index.js";import{flattenError as ht,prettifyError as bt,treeifyError as xt}from"./errors.js";export{prettifyErrorColored,prettifyErrorPlain}from"./errors.js";import{uuid as Zt,httpUrl as Vt,email as jt,regexes as St,VldStringFormat as Ot,ksuid as At,guid as wt,xid as Et,stringFormat as It,iso as Lt,hash as _t,e164 as Mt,creditCard as Tt,cidrv6 as Nt,cidrv4 as Dt,mac as Ut,ipv6 as Ct,ipv4 as Pt,ulid as Rt,cuid2 as kt,cuid as Bt,nanoid as $t,jwt as zt,hex as Ft,base64url as Jt,base64 as Wt,emoji as Kt,hostname as qt,uuidv7 as Gt,uuidv6 as Xt,uuidv4 as Ht,url as Yt}from"./validators/string-formats.js";import{ZodCompileUnsupportedError as Qt,ZodCompileAsyncError as er,ZodCompileError as tr,toZod as rr,memoizer as ar,getDiscriminatedOption as nr,properties as or,validateAsync as ir,validate as sr,compile as cr}from"./compile.js";export{compileFn as zodCompileFn}from"./compile.js";export{b as base64Json,a as base64ToBytes,c as base64ToUint8Array,d as base64UrlToBytes,e as base64urlToBytes,f as bytesToUtf8,g as epochMillisToDate,h as epochSecondsToDate,i as hexLowerToBytes,j as hexToBytes,k as hexToUint8Array,l as invertCodec,m as isoDatetimeToDate,n as jsonCodec,o as jwtPayload,p as numberToBigInt,s as stringToBigInt,q as stringToBoolean,r as stringToHttpURL,t as stringToInt,u as stringToNumber,v as stringToURL,w as stringToUint8Array,x as uint8ArrayToBase64,y as uint8ArrayToBase64Url,z as uint8ArrayToHex,A as uint8ArrayToString,B as uriComponent,C as utf8ToBytes}from"./chunks/index-CkbfQQ4n.js";export{createEmitter,createEventBus,withEmitter}from"./compat/emitter.js";export{createVldKernel,definePlugin,getVldKernel,resetVldKernel,usePlugin}from"./kernel.js";export{blue,bold,createTheme,cyan,dim,gray,green,grey,italic,magenta,default as pigment,red,strip,supportsColor,underline,vldTheme,white,yellow}from"./pigment.js";import{V as ur}from"./chunks/errors-core-BU14-Dk8.js";export{getLocale,getMessages,getSupportedLocales,isLocaleLoaded,isLocaleSupported,registerLocale,setLocale}from"./locales/runtime.js";function lr(e,t={}){const r=function(e){const t=e.target;if("draft-4"===t)return{...e,target:"draft-04"};if("draft-7"===t)return{...e,target:"draft-07"};return e}(t),a=dr(fr(e,r),r),n=r.target||"draft-2020-12";return"draft-04"===n?a.$schema??(a.$schema="http://json-schema.org/draft-04/schema#"):"draft-07"===n?a.$schema??(a.$schema="http://json-schema.org/draft-07/schema#"):"draft-2019-09"===n?a.$schema??(a.$schema="https://json-schema.org/draft/2019-09/schema"):"draft-2020-12"===n&&(a.$schema??(a.$schema="https://json-schema.org/draft/2020-12/schema")),a}function mr(e,t={}){if("boolean"==typeof e)return e?ke.create():ze.create();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}const a=br(r),n=a.meta();return t.registry&&n&&t.registry.add(a,n),a}function dr(e,t){const r=t.target||"draft-2020-12",a={...e};if(Array.isArray(a.items)){const e=a.items.map(e=>dr(e,t));"draft-2020-12"===r||"draft-2019-09"===r?(a.prefixItems=e,a.items=!1):a.items=e}else a.items&&"object"==typeof a.items&&(a.items=dr(a.items,t));a.prefixItems&&(a.prefixItems=a.prefixItems.map(e=>dr(e,t))),a.properties&&(a.properties=Object.fromEntries(Object.entries(a.properties).map(([e,r])=>[e,dr(r,t)]))),a.additionalProperties&&"object"==typeof a.additionalProperties&&(a.additionalProperties=dr(a.additionalProperties,t));for(const e of["anyOf","allOf","oneOf"])a[e]&&(a[e]=a[e].map(e=>dr(e,t)));return a.not&&"object"==typeof a.not&&(a.not=dr(a.not,t)),"openapi-3.0"===r&&function(e){if(Array.isArray(e.type)&&e.type.includes("null")){const t=e.type.filter(e=>"null"!==e);if(e.nullable=!0,1===t.length){const r=t[0];void 0!==r?e.type=r:delete e.type}else t.length>1?e.type=t:delete e.type}"number"==typeof e.exclusiveMinimum&&(e.minimum??(e.minimum=e.exclusiveMinimum),e.exclusiveMinimum=!0);"number"==typeof e.exclusiveMaximum&&(e.maximum??(e.maximum=e.exclusiveMaximum),e.exclusiveMaximum=!0)}(a),a}function fr(e,t){t.target;const r=e,a=e.validatorType;if("VldString"===e.constructor.name||a===Z.STRING)return vr(e,function(e,t){const r=t?.config?.jsonSchema||{},a={type:"string"};void 0!==r.exactLength?(a.minLength=r.exactLength,a.maxLength=r.exactLength):(void 0!==r.minLength&&(a.minLength=r.minLength),void 0!==r.maxLength&&(a.maxLength=r.maxLength));r.format&&(a.format=r.format);r.pattern&&(a.pattern=r.pattern);return a}(0,e),t);if("VldNumber"===e.constructor.name||a===Z.NUMBER)return vr(e,function(e){const t=e.config||{},r=t.jsonSchema||{},a=t.checks||[],n={type:r.type||"number"};void 0!==r.minimum&&(n.minimum=r.minimum);void 0!==r.maximum&&(n.maximum=r.maximum);void 0!==r.exclusiveMinimum&&(n.exclusiveMinimum=r.exclusiveMinimum);void 0!==r.exclusiveMaximum&&(n.exclusiveMaximum=r.exclusiveMaximum);void 0!==r.multipleOf&&(n.multipleOf=r.multipleOf);if(Object.keys(r).length>0)return n;for(const e of a){const t=e.toString();(t.includes(">=")||t.includes("min"))&&(n.minimum=0),(t.includes("<=")||t.includes("max"))&&(n.maximum=0),(t.includes("isInteger")||t.includes("int"))&&(n.type="integer"),t.includes("isSafeInteger")&&(n.type="integer"),t.includes("Number.isFinite")}return n}(e),t);if("VldBoolean"===e.constructor.name||a===Z.BOOLEAN)return vr(e,{type:"boolean"},t);if("VldBigInt"===e.constructor.name||a===Z.BIGINT)return pr(e,t,"BigInt",()=>function(e){const t=e.jsonSchema||e.config?.jsonSchema||{},r={type:"integer"};return gr(r,"minimum","x-vld-minimum",t.minimum),gr(r,"maximum","x-vld-maximum",t.maximum),gr(r,"exclusiveMinimum","x-vld-exclusiveMinimum",t.exclusiveMinimum),gr(r,"exclusiveMaximum","x-vld-exclusiveMaximum",t.exclusiveMaximum),r}(e));if("VldDate"===e.constructor.name||a===Z.DATE)return pr(e,t,"Date",()=>function(e){const t=e.jsonSchema||e.config?.jsonSchema||{},r={type:"string",format:"date-time"};t.formatMinimum&&(r.formatMinimum=t.formatMinimum);t.formatMaximum&&(r.formatMaximum=t.formatMaximum);t.formatExclusiveMinimum&&(r.formatExclusiveMinimum=t.formatExclusiveMinimum);t.formatExclusiveMaximum&&(r.formatExclusiveMaximum=t.formatExclusiveMaximum);return r}(e));if("VldArray"===e.constructor.name||a===Z.ARRAY)return vr(e,function(e,t){const r=e._item||e._inner||e.config?.itemValidator,a={type:"array"};r&&(a.items=fr(r,t));void 0!==e.config?.exactLength?(a.minItems=e.config.exactLength,a.maxItems=e.config.exactLength):(void 0!==e.config?.minLength&&(a.minItems=e.config.minLength),void 0!==e.config?.maxLength&&(a.maxItems=e.config.maxLength));e.config?.unique&&(a.uniqueItems=!0);return a}(e,t),t);if("VldObject"===e.constructor.name||a===Z.OBJECT)return vr(e,function(e,t){const r=e._shape||e.shape||e.config?.shape;if(!r)return{type:"object"};const a={},n=[];for(const[e,o]of Object.entries(r)){const r=o;a[e]=fr(r,t),hr(r)||n.push(e)}const o={type:"object",properties:a};n.length>0&&(o.required=n);e._passthrough||e._loose||e.config?.passthrough?o.additionalProperties=!0:e.config?.catchall?o.additionalProperties=fr(e.config.catchall,t):o.additionalProperties=!1;return o}(e,t),t);if("VldUnion"===e.constructor.name)return vr(e,function(e,t){const r=e._validators||e._options||e.validators||[];return{anyOf:r.map(e=>fr(e,t))}}(e,t),t);if("VldLiteral"===e.constructor.name)return vr(e,function(e){const t=e._literal??e.literal??e._value??e.value;return null===t?{type:"null"}:"string"==typeof t?{type:"string",const:t}:"number"==typeof t?{type:"number",const:t}:"boolean"==typeof t?{type:"boolean",const:t}:{const:t}}(e),t);if("VldEnum"===e.constructor.name)return vr(e,function(e){const t=e._values||e.values;if(Array.isArray(t))return{enum:[...t]};return{}}(e),t);if("VldSet"===e.constructor.name||a===Z.SET)return pr(e,t,"Set",()=>function(e,t){const r=e.itemSchema||e.itemValidator||e._item||e._inner,a={type:"array",uniqueItems:!0,"x-vld-type":"set"};r&&(a.items=fr(r,t));return a}(e,t));if("VldMap"===e.constructor.name||a===Z.MAP)return pr(e,t,"Map",()=>function(e,t){const r=e.keySchema||e.keyValidator||e._key,a=e.valueSchema||e.valueValidator||e._value,n=r?fr(r,t):{},o=a?fr(a,t):{};return{type:"array","x-vld-type":"map",items:{type:"array",items:[n,o],minItems:2,maxItems:2}}}(e,t));if("VldRecord"===e.constructor.name||a===Z.RECORD)return vr(e,function(e,t){const r=e.valueSchema||e._value||e._inner||e.valueValidator;if(r)return{type:"object",additionalProperties:fr(r,t)};return{type:"object"}}(e,t),t);if("VldTuple"===e.constructor.name||a===Z.TUPLE)return vr(e,function(e,t){const r=e.items||e._items||e.validators;if(!r||!Array.isArray(r))return{type:"array"};return{type:"array",items:r.map(e=>fr(e,t)),minItems:r.length,maxItems:r.length}}(e,t),t);if("VldIntersection"===e.constructor.name)return vr(e,function(e,t){const r=e._first||e.first,a=e._second||e.second,n=[];r&&n.push(fr(r,t));a&&n.push(fr(a,t));return 0===n.length?{}:1===n.length?n[0]??{}:{allOf:n}}(e,t),t);if("VldOptional"===e.constructor.name)return vr(e,function(e,t){const r=yr(e);if(!r)return{};const a=fr(r,t);return a}(e,t),t);if("VldNullable"===e.constructor.name)return vr(e,function(e,t){const r=yr(e);if(!r)return{type:"null"};const a=fr(r,t);if("string"==typeof a.type)return{type:[a.type,"null"]};if(Array.isArray(a.type))return a.type.push("null"),a;return{anyOf:[a,{type:"null"}]}}(e,t),t);if("VldNullish"===e.constructor.name)return vr(e,function(e,t){const r=yr(e);if(!r)return{};const a=fr(r,t);if("string"==typeof a.type)return{...a,type:[a.type,"null"]};return a}(e,t),t);if("VldExactOptional"===e.constructor.name)return vr(e,function(e,t){const r=yr(e);return r?fr(r,t):{}}(e,t),t);if("VldLazy"===e.constructor.name)return vr(e,{type:"object"},t);if("VldJson"===e.constructor.name)return vr(e,{},t);if("VldAny"===e.constructor.name)return vr(e,{},t);if("VldUnknown"===e.constructor.name)return vr(e,{},t);if("VldNever"===e.constructor.name)return vr(e,{not:{}},t);if("VldNull"===e.constructor.name)return vr(e,{type:"null"},t);if("VldUndefined"===e.constructor.name)return pr(e,t,"Undefined",()=>({not:{}}));if("VldNan"===e.constructor.name)return pr(e,t,"NaN",()=>({type:"number",not:{}}));if("VldVoid"===e.constructor.name)return pr(e,t,"Void",()=>({not:{}}));if("VldSymbol"===e.constructor.name)return pr(e,t,"Symbol",()=>({}));if("VldBrand"===e.constructor.name)return vr(e,fr(r.baseValidator,t),t);if("VldReadonly"===e.constructor.name)return vr(e,fr(r.baseValidator,t),t);if("VldTransform"===e.constructor.name)return pr(e,t,"Transform",()=>fr(yr(r),t));if("VldMeta"===e.constructor.name){const a=fr(r.baseValidator,t);return vr(e,a,t)}if("VldRefine"===e.constructor.name||"VldSuperRefine"===e.constructor.name)return vr(e,fr(yr(r),t),t);if("VldPipe"===e.constructor.name){const a="input"===t.io?r.first:r._next||r.second;return vr(e,fr(a,t),t)}if("VldDefault"===e.constructor.name||"VldCatch"===e.constructor.name)return vr(e,fr(yr(r),t),t);if("VldPreprocess"===e.constructor.name)return pr(e,t,"Preprocess",()=>fr(r._schema,t));if("VldCodec"===e.constructor.name){const a="input"===t.io?r.inputValidator:r.outputValidator;return vr(e,fr(a,t),t)}if("VldCustom"===e.constructor.name)return pr(e,t,"Custom",()=>({}));if("VldStringFormat"===e.constructor.name){return vr(e,{type:"string",format:e._format},t)}return vr(e,{},t)}function pr(e,t,r,a){if("any"===t.unrepresentable)return vr(e,{},t);if("vld"===t.unrepresentable)return vr(e,a(),t);throw new Error(`${r} cannot be represented in JSON Schema`)}function yr(e){return"function"==typeof e.unwrap?e.unwrap():e._inner||e._baseValidator||e.baseValidator||e.valueValidator}function vr(e,t,r){if(!1===r.includeMetadata)return t;const a=function(e){const t=J.get(e),r=e,a="function"==typeof r.getMeta?r.getMeta():void 0;return t||a?{...a||{},...t||{}}:void 0}(e);if(!a)return t;const n={...t};return a.id&&(n.$id=a.id),a.title&&(n.title=a.title),a.description&&(n.description=a.description),a.examples&&!1!==r.includeExamples&&(n.examples=a.examples),void 0!==a.default&&(n.default=a.default),a.deprecated&&(n.deprecated=!0),a.readOnly&&(n.readOnly=!0),a.writeOnly&&(n.writeOnly=!0),n}function gr(e,t,r,a){if(void 0===a)return;e[r]=a.toString();const n=function(e){const t=Number(e);if(Number.isSafeInteger(t))return BigInt(t)===e?t:void 0}(a);void 0!==n&&(e[t]=n)}function hr(e){const t=e.constructor.name;return"VldOptional"===t||"VldNullish"===t||"VldExactOptional"===t||e.validatorType===Z.OPTIONAL||e.validatorType===Z.NULLISH||e.validatorType===Z.EXACT_OPTIONAL}function br(e){return function(e,t){const r={};t.$id&&(r.id=t.$id);t.title&&(r.title=t.title);t.description&&(r.description=t.description);t.examples&&(r.examples=t.examples);void 0!==t.default&&(r.default=t.default);t.deprecated&&(r.deprecated=!0);t.readOnly&&(r.readOnly=!0);t.writeOnly&&(r.writeOnly=!0);return Object.keys(r).length>0?e.meta(r):e}(function(e){if(e.$ref)return ke.create();if(e.anyOf||e.oneOf){const t=(e.anyOf||e.oneOf).map(e=>br(e)).filter(Boolean);if(t.length>0)return Le.create(...t)}if(e.allOf){const t=e.allOf[0];if(void 0===t)return ke.create();const r=br(t);if(e.allOf.length>1){const t=br({allOf:e.allOf.slice(1)});return Re.create(r,t)}return r}if(e.not)return ke.create();if(void 0!==e.const)return _e.create(e.const);if(e.enum)return Pe.create(e.enum);const t=e.nullable&&"string"==typeof e.type?[e.type,"null"]:e.type;if("string"===t||void 0===t){let t=K.create();if(void 0!==e.minLength&&(t=t.min(e.minLength)),void 0!==e.maxLength&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),e.format)switch(e.format){case"date-time":case"date":case"time":break;case"email":return jt();case"uri":case"uri-reference":return Vt();case"uuid":return Zt()}return t}if("number"===t||"integer"===t){let r=Se.create();return"integer"===t&&(r=r.int()),void 0!==e.minimum&&(r=r.min(e.minimum)),void 0!==e.maximum&&(r=r.max(e.maximum)),"number"==typeof e.exclusiveMinimum&&(r=r.gt(e.exclusiveMinimum)),"number"==typeof e.exclusiveMaximum&&(r=r.lt(e.exclusiveMaximum)),!0===e.exclusiveMinimum&&void 0!==e.minimum&&(r=r.gt(e.minimum)),!0===e.exclusiveMaximum&&void 0!==e.maximum&&(r=r.lt(e.maximum)),void 0!==e.multipleOf&&(r=r.multipleOf(e.multipleOf)),r}if("boolean"===t)return Oe.create();if("array"===t){if(e.prefixItems&&e.prefixItems.length>0){const t=e.prefixItems.map(e=>br(e));return Ne.create(...t)}if(Array.isArray(e.items)){const t=e.items.map(e=>br(e));return Ne.create(...t)}return e.items&&!Array.isArray(e.items)?Ee.create(br(e.items)):Ee.create(ke.create())}if("object"===t){if(e.properties){const t={},r=new Set(e.required||[]);for(const[a,n]of Object.entries(e.properties)){const e=br(n);t[a]=r.has(a)?e:e.optional()}let a=Ie.create(t);if(!1===e.additionalProperties)a=a.strict();else if(!0===e.additionalProperties)a=a.passthrough();else if(e.additionalProperties){const t=br(e.additionalProperties);return De.create(t)}return a}return Ie.create({})}if("null"===t)return Fe.create();if(Array.isArray(t)){const r=t.map(t=>br({...e,type:t,nullable:!1}));if(r.length>0)return Le.create(...r)}return ke.create()}(e),e)}class xr extends Error{constructor(e){super(JSON.stringify(e,null,2)),this.code="VLD_VALIDATION_ERROR",this.name="ZodError",this.issues=e}format(){const e={_errors:[]};for(const t of this.issues){const r=t.path;if(0===r.length){e._errors.push(t.message);continue}let a=e;for(let e=0;e<r.length-1;e++){const t=String(r[e]);t in a||(a[t]={_errors:[]}),a=a[t]}const n=String(r[r.length-1]);n in a||(a[n]={_errors:[]}),a[n]._errors.push(t.message)}return e}flatten(){const e=[],t={};for(const r of this.issues){if(0===r.path.length){e.push(r.message);continue}const a=String(r.path[0]);t[a]||(t[a]=[]),t[a].push(r.message)}return{formErrors:e,fieldErrors:t}}get errors(){return this.issues}}function Zr(e){const t=[],r=e?.issues??[];for(const e of r){const r={code:e.code??"custom",path:Array.isArray(e.path)?e.path:[],message:e.message??"Invalid value"};void 0!==e.expected&&(r.expected=e.expected),void 0!==e.received&&(r.received=e.received),void 0!==e.minimum&&(r.minimum=e.minimum),void 0!==e.maximum&&(r.maximum=e.maximum),void 0!==e.inclusive&&(r.inclusive=e.inclusive),e.origin&&(r.origin=e.origin),e.format&&(r.format=e.format),e.pattern&&(r.pattern=e.pattern),void 0===r.expected&&("invalid_type"!==r.code&&"invalid_value"!==r.code&&"invalid_literal"!==r.code||(r.expected=e.origin??"unknown"),"invalid_string"===r.code&&e.validation&&(r.expected=e.validation)),void 0===r.received&&"invalid_type"===r.code&&(r.received="string"==typeof e.received?e.received:e.expected?"unknown":void 0),t.push(r)}return new xr(t)}function Vr(e){return e.success?{success:!0,data:e.data}:{success:!1,error:Zr(e.error)}}const jr={debug:0,info:1,warn:2,error:3,silent:4},Sr="[0m",Or="[2m",Ar="[36m",wr={debug:"[90m",info:"[34m",warn:"[33m",error:"[31m"},Er={debug:"DEBUG",info:"INFO ",warn:"WARN ",error:"ERROR"};function Ir(e={}){const t=e.name??"vld";let r=e.level??"warn";const a=e.handler??function(e){const t=e.colored??!0,r=e.timestamps??!0;return e=>{const a=[];if(r){const r=e.timestamp.toISOString().slice(11,23);a.push(t?`${Or}${r}${Sr}`:r)}const n=Er[e.level],o=wr[e.level];a.push(t?`${o}${n}${Sr}`:n),a.push(t?`${Ar}[${e.name}]${Sr}`:`[${e.name}]`),a.push(e.message);const i=a.join(" ");switch(e.level){case"debug":console.debug(i,void 0!==e.data?e.data:"");break;case"info":console.info(i,void 0!==e.data?e.data:"");break;case"warn":console.warn(i,void 0!==e.data?e.data:"");break;case"error":console.error(i,void 0!==e.data?e.data:"")}}}(e),n=(e,n,o)=>{if(jr[e]<jr[r])return;const i={level:e,message:n,data:o,timestamp:new Date,name:t};a(i)};return{debug:(e,t)=>n("debug",e,t),info:(e,t)=>n("info",e,t),warn:(e,t)=>n("warn",e,t),error:(e,t)=>n("error",e,t),isLevelEnabled:e=>jr[e]>=jr[r],setLevel:e=>{r=e},getLevel:()=>r,child:r=>Ir({...e,name:`${t}:${r}`})}}let Lr=null;function _r(e){return Lr=Ir({name:"vld",...e}),Lr}function Mr(){return Lr}function Tr(e){Lr&&Lr.setLevel(e)}function Nr(){Lr?Lr.setLevel("debug"):_r({level:"debug"})}function Dr(){Lr&&Lr.setLevel("silent")}function Ur(){return Ir({level:"silent"})}const Cr=Symbol.for("@oxog/vld/global-state"),Pr=globalThis,Rr=Pr[Cr]??(Pr[Cr]={config:{}});function kr(e){return void 0===e||(Rr.config={...Rr.config,...e},"customError"in e?Rr.errorMap=e.customError:"errorMap"in e&&(Rr.errorMap=e.errorMap)),{...Rr.config}}function Br(e){Rr.errorMap=e,Rr.config={...Rr.config,errorMap:e}}function $r(){return Rr.errorMap}function zr(e){const t=Object.keys(e).filter(e=>!/^\d+$/.test(e)).map(t=>e[t]).filter(e=>"string"==typeof e||"number"==typeof e),r=Array.from(new Set(t));if(0===r.length)throw new Error("nativeEnum requires at least one string or number value");return r}function Fr(e,t,r){let a=e;for(const e of t){const t=String(e),r=a[t];r&&!Array.isArray(r)||(a[t]={_errors:[]}),a=a[t]}a._errors.push(r)}function Jr(e){return void 0===e?void 0:T(e,"Refinement check failed")}function Wr(e){return et({parse:t=>{const r=e(t,{addIssue:()=>{},path:[]});if(null!==r&&"object"==typeof r&&"function"==typeof r.then)throw new Error("Use parseAsync for async transforms");return r},parseAsync:async t=>await Promise.resolve(e(t,{addIssue:()=>{},path:[]}))})}function Kr(e,t){return et({parse:r=>{const a=e(r);if(null!==a&&"object"==typeof a&&"function"==typeof a.then)throw new Error("Use parseAsync for async refinements");if(!a)throw new Error(Jr(t)||"Refinement check failed");return r},parseAsync:async r=>{if(!await e(r))throw new Error(Jr(t)||"Refinement check failed");return r}})}const qr={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6},Gr={},Xr=Symbol.for("vld_brand"),Hr=Symbol.for("VldInput"),Yr=Symbol.for("VldOutput"),Qr={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"},ea={getParsedType:function(e){return null===e?"null":Array.isArray(e)?"array":Number.isNaN(e)?"nan":typeof e},propertyKeyTypes:new Set(["string","number","symbol"]),primitiveTypes:new Set(["string","number","bigint","boolean","symbol","undefined","null"]),assert:(e,t="Assertion failed")=>{if(!e)throw new Error(t)},assertNever:e=>{throw new Error(`Unexpected value: ${String(e)}`)},joinValues:(e,t=" | ")=>e.map(e=>JSON.stringify(e)).join(t),jsonStringifyReplacer:(e,t)=>"bigint"==typeof t?t.toString():t,nullish:e=>null==e,cached:e=>{let t,r=!1;return()=>(r||(t=e(),r=!0),t)}},ta={util:ea,regexes:St,locales:dt,NEVER:ze.create(),TimePrecision:qr,ZodIssueCode:Qr,globalRegistry:J,config:kr,getErrorMap:$r,setErrorMap:Br,parse:(e,t)=>e.parse(t),safeParse:(e,t)=>e.safeParse(t),parseAsync:(e,t)=>e.parseAsync(t),safeParseAsync:(e,t)=>e.safeParseAsync(t)};function ra(e){return Ie.create(e||{})}function aa(e,t,r){const a=r.get(e);if(a)return a;if(e instanceof Ke){const a=e,n=Ke.create(()=>aa(a.unwrap(),t,r));return r.set(e,n),n}const n=function(e,t){const r=e;if(e instanceof Ie){const a=e.shape,n={};let o=!1;for(const e of Object.keys(a))n[e]=t(a[e]),o||(o=n[e]!==a[e]);let i=r.config.catchall;if(i){const e=t(i);o||(o=e!==i),i=e}return o?new Ie({...r.config,shape:n,catchall:i}):e}if(e instanceof Ee){const a=t(r.element);return a===r.element?e:Ee.create(a)}if(e instanceof Ue){const a=t(r.itemSchema);return a===r.itemSchema?e:Ue.create(a)}if(e instanceof Ce){const a=t(r.keySchema),n=t(r.valueSchema);return a===r.keySchema&&n===r.valueSchema?e:Ce.create(a,n)}if(e instanceof De){const a=t(r.valueSchema),n=r.keySchema?t(r.keySchema):void 0,o=void 0!==r.keySchema&&n!==r.keySchema;return a!==r.valueSchema||o?De.create(a,n):e}if(e instanceof Ne){const a=e.items.map(t),n=a.some((e,t)=>e!==r.items[t]),o=null==r.restValidator?void 0:t(r.restValidator),i=null!=r.restValidator&&o!==r.restValidator;return n||i?new Ne(a,r.errorMessage,o):e}if(e instanceof Le){const a=r.validators.map(t);return a.some((e,t)=>e!==r.validators[t])?new Le(a,r.errorMessage):e}if(e instanceof Ge){const a=r._options.map(t);return a.some((e,t)=>e!==r._options[t])?new Ge(a):e}if(e instanceof qe){const a=r._options.map(t);return a.some((e,t)=>e!==r._options[t])?Le.create(...a):e}if(e instanceof Re){const a=t(r.validatorA),n=t(r.validatorB);return a===r.validatorA&&n===r.validatorB?e:Re.create(a,n)}if(e instanceof N){const a=t(r.first),n=t(r.second);return a===r.first&&n===r.second?e:new N(a,n)}if(e instanceof M){const a=t(r.baseValidator);return a===r.baseValidator?e:M.create(a)}if(e instanceof _){const a=t(r.baseValidator);return a===r.baseValidator?e:_.create(a)}if(e instanceof L){const a=t(r.baseValidator);return a===r.baseValidator?e:L.create(a)}if(e instanceof I){const a=t(r.baseValidator);return a===r.baseValidator?e:I.create(a)}if(e instanceof O){const a=t(r.baseValidator);return a===r.baseValidator?e:new O(a,r.defaultValue)}if(e instanceof D){const a=t(r.baseValidator);return a===r.baseValidator?e:new D(a,r.defaultValue)}if(e instanceof U){const a=t(r.baseValidator);return a===r.baseValidator?e:new U(a,r.fallbackValue)}if(e instanceof P){const a=t(r.baseValidator);return a===r.baseValidator?e:new P(a)}if(e instanceof R){const a=t(r.baseValidator);return a===r.baseValidator?e:new R(a,r.metadata)}if(e instanceof $){const a=t(r.baseValidator);return a===r.baseValidator?e:new $(a,r.predicate,r.customMessage)}if(e instanceof F){const a=t(r.baseValidator);return a===r.baseValidator?e:new F(a,r.transformer)}if(e instanceof E){const a=t(r._schema);return a===r._schema?e:new E(r._preprocessor,a)}return e}(e,e=>aa(e,t,r)),o=t(n)??n;return r.set(e,o),o}function na(e){return aa(e,e=>e instanceof Ie?e.partial():void 0,new Map)}function oa(e){return aa(e,e=>e instanceof N?e.first:void 0,new Map)}function ia(e){return aa(e,e=>e instanceof N?e.second:void 0,new Map)}V({array:e=>Ee.create(e),union:(e,t)=>Le.create(e,t),intersection:(e,t)=>Re.create(e,t),toJSONSchema:(e,t)=>lr(e,t)});const sa={string:()=>K.create(),stringLegacy:()=>K.create(),stringV2:()=>X.create(),number:()=>Se.create(),numberLegacy:()=>Se.create(),numberV2:()=>Y.create(),int:()=>Se.create().int(),int32:()=>Se.create().int().min(-2147483648).max(2147483647),uint32:()=>Se.create().uint32(),uint64:()=>Se.create().uint64(),int64:()=>Se.create().int64(),float32:()=>Se.create().float32(),float64:()=>Se.create().float64(),boolean:()=>Oe.create(),booleanV2:()=>me.create(),date:()=>Ae.create(),dateLegacy:()=>Ae.create(),dateV2:()=>Q.create(),bigint:()=>Me.create(),bigintLegacy:()=>Me.create(),bigintV2:()=>ee.create(),symbol:()=>Te.create(),stringbool:e=>we.create(e),array:e=>Ee.create(e),arrayV2:e=>te.create(e),tuple:function(...e){const t=Array.isArray(e[0])?e[0]:e.filter(e=>e instanceof S),r=Ne.create(...t);return Array.isArray(e[0])&&e[1]instanceof S?r.rest(e[1]):r},tupleV2:(...e)=>je.create(...e),set:e=>Ue.create(e),setV2:e=>Ve.create(e),map:(e,t)=>Ce.create(e,t),mapV2:(e,t)=>Ze.create(e,t),record:function(e,t){return void 0===t?De.create(e):De.create(t,e)},recordV2:e=>le.create(e),object:ra,strictObject:function(e){return ra(e).strict()},looseObject:function(e){return ra(e).passthrough()},partialRecord:function(e,t){return void 0===t?De.create(e).partial():De.create(t,e).partial()},looseRecord:function(e,t){return void 0===t?De.create(e).loose():De.create(t,e).loose()},union:function(...e){const t=Array.isArray(e[0])?e[0]:e.filter(e=>e instanceof S);return Le.create(...t)},unionV2:(...e)=>re.create(...e),intersection:(e,t)=>Re.create(e,t),intersectionV2:(e,t)=>xe.create(e,t),discriminatedUnion:function(e,...t){const r=Array.isArray(t[0])?t[0]:t.filter(e=>e instanceof S);return qe.create(e,r)},xor:function(...e){const t=Array.isArray(e[0])?e[0]:e.filter(e=>e instanceof S);return Ge.create(t)},keyof:e=>e.keyof(),deepPartial:na,input:oa,output:ia,literal:function(e){return _e.create(e)},literalV2:e=>ue.create(e),enum:function(...e){const t=e[0],r=Array.isArray(t)?t:null!==t&&"object"==typeof t?zr(t):e.filter(e=>"string"==typeof e||"number"==typeof e);return Pe.create(r)},enumV2:e=>ce.create(e),nativeEnum:e=>Pe.create(zr(e)),any:()=>ke.create(),unknown:()=>Be.create(),void:()=>$e.create(),never:()=>ze.create(),null:()=>Fe.create(),undefined:()=>Je.create(),nan:()=>We.create(),NEVER:ze.create(),TimePrecision:qr,ZodIssueCode:Qr,ZodFirstPartyTypeKind:Gr,optional:e=>M.create(e),optionalV2:e=>se.create(e),nullable:e=>_.create(e),nullableV2:e=>ie.create(e),nullish:e=>L.create(e),nullishV2:e=>oe.create(e),exactOptional:e=>I.create(e),nonoptional:(e,t)=>e.refine(e=>void 0!==e,Jr(t)),catch:(e,t)=>e.catch(t),prefault:(e,t)=>e.prefault(t),readonly:e=>e.readonly(),pipe:(e,t)=>e.pipe(t),pipeline:(e,t)=>e.pipe(t),clone:e=>e,describe:(e,t)=>e instanceof S?e.describe(t||""):Be.create().describe(e),meta:(e,t)=>e instanceof S?e.meta(t||{}):Be.create().meta(e),transform:(e,t)=>e instanceof S?e.transform(t||(e=>e)):Wr(e),transformV2:(e,t)=>ne.create(e,t),overwrite:e=>Wr(e),refine:(e,t,r)=>e instanceof S?e.refine(t,Jr(r)):Kr(e,t),refineV2:(e,t,r)=>ae.create(e,t,r),check:(e,t,r)=>e instanceof S?e.check(t,Jr(r)):Kr(e,t),superRefine:(e,t)=>e instanceof S?e.superRefine(t||(()=>{})):function(e){return Be.create().superRefine(e)}(e),property:function(e,t,r){return et({parse:a=>{if("object"!=typeof a||null===a||!(e in a))throw new Error(Jr(r)||`Expected object with property "${e}"`);const n=t.safeParse(a[e]);if(!n.success)throw new Error(Jr(r)||n.error.message);return a}})},instanceof:(e,t)=>et({parse:r=>{if(!(r instanceof e))throw new Error(Jr(t)||`Expected instance of ${e.name||"provided constructor"}`);return r}}),config:kr,setErrorMap:Br,getErrorMap:$r,core:ta,util:ea,locales:dt,lazy:e=>Ke.create(e),json:e=>Xe.create(e),custom:et,file:()=>rt(),function:()=>nt(),useV2:!1,setV2Mode:e=>{sa.useV2=e},preprocess:(e,t)=>E.create(e,t),coerce:{string:()=>gt.create(),stringLegacy:()=>gt.create(),number:()=>vt.create(),numberLegacy:()=>vt.create(),boolean:()=>yt.create(),date:()=>pt.create(),bigint:()=>ft.create(),stringV2:()=>G.create(),numberV2:()=>H.create()},email:e=>jt(e),url:e=>Yt(e),uuid:e=>Zt(e),uuidv4:()=>Ht(),uuidv6:()=>Xt(),uuidv7:()=>Gt(),hostname:()=>qt(),emoji:()=>Kt(),base64:()=>Wt(),base64url:()=>Jt(),hex:()=>Ft(),jwt:()=>zt(),nanoid:()=>$t(),cuid:()=>Bt(),cuid2:()=>kt(),ulid:()=>Rt(),ipv4:()=>Pt(),ipv6:()=>Ct(),mac:()=>Ut(),cidrv4:()=>Dt(),cidrv6:()=>Nt(),creditCard:e=>Tt(e),e164:()=>Mt(),hash:e=>_t(e),iso:{ZodISODate:Ot,ZodISODateTime:Ot,ZodISODuration:Ot,ZodISOTime:Ot,date:()=>Lt.date(),time:e=>Lt.time(e),datetime:e=>Lt.datetime(e),dateTime:e=>Lt.dateTime(e),duration:()=>Lt.duration()},stringFormat:(e,t)=>It(e,t),minLength:(e,t)=>K.create().min(e,t),maxLength:(e,t)=>K.create().max(e,t),length:(e,t)=>K.create().length(e,t),regex:(e,t)=>K.create().regex(e,t),startsWith:(e,t)=>K.create().startsWith(e,t),endsWith:(e,t)=>K.create().endsWith(e,t),includes:(e,t)=>K.create().includes(e,t),trim:()=>K.create().trim(),toLowerCase:()=>K.create().toLowerCase(),lowercase:()=>K.create().toLowerCase(),toUpperCase:()=>K.create().toUpperCase(),uppercase:()=>K.create().toUpperCase(),gt:(e,t)=>Se.create().gt(e,t),gte:(e,t)=>Se.create().gte(e,t),lt:(e,t)=>Se.create().lt(e,t),lte:(e,t)=>Se.create().lte(e,t),positive:e=>Se.create().positive(e),negative:e=>Se.create().negative(e),nonnegative:e=>Se.create().nonnegative(e),nonpositive:e=>Se.create().nonpositive(e),multipleOf:(e,t)=>Se.create().multipleOf(e,t),minSize:(e,t)=>K.create().min(e,t),maxSize:(e,t)=>K.create().max(e,t),size:(e,t)=>K.create().length(e,t),normalize:e=>K.create().transform(t=>t.normalize(e)),slugify:()=>K.create().transform(e=>e.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")),mime:(e,t)=>tt.create().mime(e,t),xid:()=>Et(),guid:()=>wt(),httpUrl:()=>Vt(),ksuid:()=>At(),regexes:St,compile:(e,t)=>cr(e,t),validate:sr,validateAsync:ir,properties:or,getDiscriminatedOption:nr,memoizer:ar,toZod:rr,templateLiteral:(...e)=>Ye(...e),base64Bytes:()=>it.create(),hexBytes:()=>st.create(),uint8Array:()=>ct.create(),codec:(e,t,r)=>ot.create(e,t,r),invertCodec:e=>e.invert(),promise:e=>lt(e),parse:(e,t)=>e.parse(t),safeParse:(e,t)=>e.safeParse(t),parseAsync:(e,t)=>e.parseAsync(t),safeParseAsync:(e,t)=>e.safeParseAsync(t),decode:(e,t)=>e.parse(t),safeDecode:(e,t)=>e.safeParse(t),decodeAsync:(e,t)=>e.parseAsync(t),safeDecodeAsync:(e,t)=>e.safeParseAsync(t),encode:(e,t)=>e.encode(t),safeEncode:(e,t)=>e.safeEncode(t),encodeAsync:(e,t)=>e.encodeAsync(t),safeEncodeAsync:(e,t)=>e.safeEncodeAsync(t),formatError:e=>{const t={_errors:[]};if(e instanceof ur){for(const r of e.issues)Fr(t,r.path,r.message);return t}return t._errors.push(function(e){return e instanceof Error?e.message:String(e)}(e)),t},treeifyError:xt,prettifyError:bt,flattenError:ht,toJSONSchema:lr,fromJSONSchema:mr,globalRegistry:J,registry:W,_default:(e,t)=>new O(e,t),success:e=>et({parse:e=>e}),_function:()=>nt(),ZodType:S,ZodTypeAny:S,ZodTypeDef:Object,ZodError:ur,ZodRealError:ur,ZodCompileError:tr,ZodCompileAsyncError:er,ZodCompileUnsupportedError:Qt,_ZodString:K,ZodString:K,ZodStringFormat:K,ZodEmail:K,ZodGUID:K,ZodUUID:K,ZodURL:K,ZodEmoji:K,ZodNanoID:K,ZodCUID:K,ZodCUID2:K,ZodULID:K,ZodXID:K,ZodKSUID:K,ZodIPv4:K,ZodMAC:K,ZodIPv6:K,ZodCIDRv4:K,ZodCIDRv6:K,ZodBase64:K,ZodBase64URL:K,ZodE164:K,ZodJWT:K,ZodCustomStringFormat:K,ZodNumber:Se,ZodNumberFormat:Se,ZodBoolean:Oe,ZodBigInt:Me,ZodBigIntFormat:Me,ZodSymbol:Te,ZodUndefined:Je,ZodNull:Fe,ZodAny:ke,ZodUnknown:Be,ZodNever:ze,ZodVoid:$e,ZodDate:Ae,ZodArray:Ee,ZodObject:Ie,ZodUnion:Le,ZodXor:Ge,ZodDiscriminatedUnion:qe,ZodIntersection:Re,ZodTuple:Ne,ZodRecord:De,ZodMap:Ce,ZodSet:Ue,ZodEnum:Pe,ZodLiteral:_e,ZodFile:tt,ZodTransform:S,ZodOptional:S,ZodExactOptional:S,ZodNullable:S,ZodDefault:S,ZodPrefault:S,ZodNonOptional:S,ZodSuccess:Qe,ZodCatch:S,ZodNaN:We,ZodPipe:S,ZodCodec:ot,ZodPreprocess:S,ZodReadonly:S,ZodTemplateLiteral:He,ZodLazy:Ke,ZodPromise:ut,ZodFunction:at,ZodCustom:Qe,ZodISODateTime:K,ZodISODate:K,ZodISOTime:K,ZodISODuration:K,$brand:Symbol.for("zod.brand"),$output:Symbol.for("zod.output"),$input:Symbol.for("zod.input")},ca={string:()=>X.create(),number:()=>Y.create(),boolean:()=>me.create(),date:()=>Q.create(),bigint:()=>ee.create(),int:()=>Y.create().int(),int32:()=>Y.create().int().min(-2147483648).max(2147483647),uint32:()=>Y.create().uint32(),uint64:()=>Y.create().uint64(),int64:()=>Y.create().int64(),float32:()=>Y.create().float32(),float64:()=>Y.create().float64(),array:e=>te.create(e),tuple:(...e)=>je.create(...e),set:e=>Ve.create(e),map:(e,t)=>Ze.create(e,t),record:e=>le.create(e),union:(...e)=>re.create(...e),intersection:(e,t)=>xe.create(e,t),literal:e=>ue.create(e),enum:e=>ce.create(e),optional:e=>se.create(e),nullable:e=>ie.create(e),nullish:e=>oe.create(e),object:ra,any:()=>be.create(),unknown:()=>he.create(),void:()=>ge.create(),never:()=>ve.create(),null:()=>ye.create(),undefined:()=>pe.create(),symbol:()=>fe.create(),function:()=>de.create(),coerce:{string:()=>G.create(),number:()=>H.create()},transformV2:(e,t)=>ne.create(e,t),refineV2:(e,t,r)=>ae.create(e,t,r)},ua=sa,{string:la,number:ma,int:da,int32:fa,uint32:pa,uint64:ya,int64:va,float32:ga,float64:ha,boolean:ba,date:xa,bigint:Za,symbol:Va,stringbool:ja,array:Sa,object:Oa,strictObject:Aa,looseObject:wa,tuple:Ea,record:Ia,partialRecord:La,looseRecord:_a,set:Ma,union:Ta,intersection:Na,discriminatedUnion:Da,xor:Ua,keyof:Ca,literal:Pa,nativeEnum:Ra,any:ka,unknown:Ba,nan:$a,optional:za,nullable:Fa,nullish:Ja,exactOptional:Wa,nonoptional:Ka,readonly:qa,pipe:Ga,clone:Xa,describe:Ha,meta:Ya,transform:Qa,overwrite:en,refine:tn,check:rn,superRefine:an,property:nn,config:on,setErrorMap:sn,getErrorMap:cn,locales:un,lazy:ln,json:mn,custom:dn,file:fn,preprocess:pn,coerce:yn,email:vn,url:gn,uuid:hn,uuidv4:bn,uuidv6:xn,uuidv7:Zn,hostname:Vn,emoji:jn,base64:Sn,base64url:On,hex:An,jwt:wn,nanoid:En,cuid:In,cuid2:Ln,ulid:_n,ipv4:Mn,ipv6:Tn,mac:Nn,cidrv4:Dn,cidrv6:Un,creditCard:Cn,e164:Pn,hash:Rn,iso:kn,stringFormat:Bn,normalize:$n,slugify:zn,mime:Fn,xid:Jn,guid:Wn,httpUrl:Kn,ksuid:qn,regexes:Gn,templateLiteral:Xn,base64Bytes:Hn,hexBytes:Yn,uint8Array:Qn,codec:eo,promise:to,prefault:ro,parse:ao,safeParse:no,parseAsync:oo,safeParseAsync:io,decode:so,safeDecode:co,decodeAsync:uo,safeDecodeAsync:lo,encode:mo,safeEncode:fo,encodeAsync:po,safeEncodeAsync:yo,formatError:vo,NEVER:go,compile:ho,validate:bo,validateAsync:xo,properties:Zo,getDiscriminatedOption:Vo,memoizer:jo,toZod:So}=sa,Oo=sa.catch,Ao=sa.enum,wo=sa.function,Eo=sa.instanceof,Io=sa.map,Lo=sa.never,_o=sa.null,Mo=sa.undefined,To=sa.void,No=sa,Do=K;function Uo(e,t){return e instanceof S&&t instanceof S?sa.map(e,t):mt(e,t)}const Co=(e,t)=>sa.string().min(e,t),Po=(e,t)=>sa.string().max(e,t),Ro=(e,t)=>sa.string().length(e,t),ko=(e,t)=>sa.string().regex(e,t),Bo=(e,t)=>sa.string().startsWith(e,t),$o=(e,t)=>sa.string().endsWith(e,t),zo=(e,t)=>sa.string().includes(e,t),Fo=()=>sa.string().trim(),Jo=()=>sa.string().toLowerCase(),Wo=Jo,Ko=()=>sa.string().toUpperCase(),qo=Ko,Go=(e,t)=>sa.number().gt(e,t),Xo=(e,t)=>sa.number().gte(e,t),Ho=(e,t)=>sa.number().lt(e,t),Yo=(e,t)=>sa.number().lte(e,t),Qo=e=>sa.number().positive(e),ei=e=>sa.number().negative(e),ti=e=>sa.number().nonnegative(e),ri=e=>sa.number().nonpositive(e),ai=(e,t)=>sa.number().multipleOf(e,t),ni=Co,oi=Po,ii=Ro;export{Xr as $brand,Hr as $input,Yr as $output,go as NEVER,qr as TimePrecision,S as VldBase,ur as VldError,Re as VldIntersection,R as VldMeta,ke as ZodAny,Ee as ZodArray,Ot as ZodBase64,Ot as ZodBase64URL,Me as ZodBigInt,Me as ZodBigIntFormat,Oe as ZodBoolean,Ot as ZodCIDRv4,Ot as ZodCIDRv6,Ot as ZodCUID,Ot as ZodCUID2,U as ZodCatch,ot as ZodCodec,er as ZodCompileAsyncError,Qt as ZodCompileUnsupportedError,Ot as ZodCreditCard,Qe as ZodCustom,Ot as ZodCustomStringFormat,Ae as ZodDate,O as ZodDefault,qe as ZodDiscriminatedUnion,Ot as ZodE164,Ot as ZodEmail,Ot as ZodEmoji,Pe as ZodEnum,ur as ZodError,I as ZodExactOptional,tt as ZodFile,Gr as ZodFirstPartyTypeKind,at as ZodFunction,Ot as ZodGUID,Ot as ZodIPv4,Ot as ZodIPv6,Ot as ZodISODate,Ot as ZodISODateTime,Ot as ZodISODuration,Ot as ZodISOTime,Re as ZodIntersection,Qr as ZodIssueCode,Xe as ZodJSON,Ot as ZodJWT,Ot as ZodKSUID,Ke as ZodLazy,xr as ZodLikeError,_e as ZodLiteral,Ot as ZodMAC,Ce as ZodMap,R as ZodMeta,We as ZodNaN,Ot as ZodNanoID,ze as ZodNever,$ as ZodNonOptional,Fe as ZodNull,_ as ZodNullable,Se as ZodNumber,Se as ZodNumberFormat,Ie as ZodObject,M as ZodOptional,N as ZodPipe,D as ZodPrefault,E as ZodPreprocess,ut as ZodPromise,P as ZodReadonly,ur as ZodRealError,De as ZodRecord,Ue as ZodSet,K as ZodString,Ot as ZodStringFormat,Qe as ZodSuccess,Te as ZodSymbol,He as ZodTemplateLiteral,F as ZodTransform,Ne as ZodTuple,S as ZodType,Ot as ZodULID,Ot as ZodURL,Ot as ZodUUID,Je as ZodUndefined,Le as ZodUnion,Be as ZodUnknown,$e as ZodVoid,Ot as ZodXID,Ge as ZodXor,Do as _ZodString,No as _default,wo as _function,ka as any,Sa as array,Sn as base64,Hn as base64Bytes,On as base64url,Za as bigint,ba as boolean,Oo as catch,rn as check,Dn as cidrv4,Un as cidrv6,Xa as clone,eo as codec,yn as coerce,ho as compile,on as config,ta as core,Ir as createLogger,Ur as createNoOpLogger,Cn as creditCard,In as cuid,Ln as cuid2,dn as custom,xa as date,so as decode,uo as decodeAsync,na as deepPartial,sa as default,Ha as describe,Dr as disableLogging,Da as discriminatedUnion,Pn as e164,vn as email,jn as emoji,Nr as enableDebug,mo as encode,po as encodeAsync,$o as endsWith,Ao as enum,Wa as exactOptional,fn as file,ht as flattenError,ga as float32,ha as float64,vo as formatError,mr as fromJSONSchema,wo as function,Vo as getDiscriminatedOption,cn as getErrorMap,Mr as getLogger,J as globalRegistry,Go as gt,Xo as gte,Wn as guid,Rn as hash,An as hex,Yn as hexBytes,Vn as hostname,Kn as httpUrl,zo as includes,_r as initLogger,oa as input,Eo as instanceof,da as int,fa as int32,va as int64,Na as intersection,Mn as ipv4,Tn as ipv6,kn as iso,mn as json,wn as jwt,Ca as keyof,qn as ksuid,ln as lazy,Ro as length,Pa as literal,un as locales,wa as looseObject,_a as looseRecord,Wo as lowercase,Ho as lt,Yo as lte,Nn as mac,Uo as map,Io as mapSchema,Po as maxLength,oi as maxSize,jo as memoizer,Ya as meta,Fn as mime,Co as minLength,ni as minSize,ai as multipleOf,$a as nan,En as nanoid,Ra as nativeEnum,ei as negative,Lo as never,ti as nonnegative,Ka as nonoptional,ri as nonpositive,$n as normalize,_o as null,Fa as nullable,Ja as nullish,ma as number,Oa as object,za as optional,ia as output,en as overwrite,ao as parse,oo as parseAsync,La as partialRecord,Ga as pipe,Qo as positive,ro as prefault,pn as preprocess,bt as prettifyError,to as promise,Zo as properties,nn as property,qa as readonly,Ia as record,tn as refine,ko as regex,Gn as regexes,W as registry,co as safeDecode,lo as safeDecodeAsync,fo as safeEncode,yo as safeEncodeAsync,no as safeParse,io as safeParseAsync,Ma as set,sn as setErrorMap,Tr as setLogLevel,ii as size,zn as slugify,Bo as startsWith,Aa as strictObject,la as string,Bn as stringFormat,ja as stringbool,an as superRefine,Va as symbol,Xn as templateLiteral,lr as toJSONSchema,Jo as toLowerCase,Ko as toUpperCase,So as toZod,Zr as toZodError,Vr as toZodSafeResult,Qa as transform,xt as treeifyError,Fo as trim,Ea as tuple,pa as uint32,ya as uint64,Qn as uint8Array,_n as ulid,Mo as undefined,Ta as union,Ba as unknown,qo as uppercase,gn as url,ea as util,hn as uuid,bn as uuidv4,xn as uuidv6,Zn as uuidv7,sa as v,ca as vV2,bo as validate,xo as validateAsync,To as void,Jn as xid,Ua as xor,ua as z};
|
|
1
|
+
import{VLD_VALIDATOR_TYPES as Z,VldPreprocess as V,configureSchemaCompositionFactories as S,VldBase as O,VldDefault as I,VldExactOptional as E,VldNullish as L,VldNullable as _,VldOptional as M,resolveErrorMessage as T,VldPipe as N,VldPrefault as D,VldCatch as P,VldReadonly as U,VldMeta as R,VldRefine as $,VldTransform as F}from"./validators/base.js";export{VldBrand as ZodBranded}from"./validators/base.js";import{globalRegistry as J,registry as W}from"./registry.js";import{VldString as K}from"./validators/string.js";import{VldCoerceStringV2 as G,VldStringV2 as X}from"./validators/string-v2.js";import{VldCoerceNumberV2 as H,VldNumberV2 as Y}from"./validators/number-v2.js";import{VldDateV2 as Q}from"./validators/date-v2.js";import{VldBigIntV2 as ee}from"./validators/bigint-v2.js";import{VldArrayV2 as te}from"./validators/array-v2.js";import{VldUnionV2 as re}from"./validators/union-v2.js";import{VldRefineV2 as ne,VldTransformV2 as oe,VldNullishV2 as ae,VldNullableV2 as ie,VldOptionalV2 as se}from"./validators/wrapper-v2.js";import{VldEnumV2 as ce,VldLiteralV2 as ue,VldRecordV2 as me,VldBooleanV2 as le,VldFunctionV2 as de,VldSymbolV2 as fe,VldUndefinedV2 as pe,VldNullV2 as ye,VldNeverV2 as ve,VldVoidV2 as ge,VldUnknownV2 as he,VldAnyV2 as be}from"./validators/leaf-v2.js";import{VldIntersectionV2 as xe,VldMapV2 as Ze,VldSetV2 as Ve,VldTupleV2 as je}from"./validators/composite-v2.js";import{VldNumber as Se}from"./validators/number.js";import{VldBoolean as Ae}from"./validators/boolean.js";import{VldDate as Oe}from"./validators/date.js";import{VldStringBool as we}from"./validators/string-bool.js";import{VldArray as Ie}from"./validators/array.js";import{VldObject as Ee}from"./validators/object.js";import{VldUnion as Le}from"./validators/union.js";import{VldLiteral as _e}from"./validators/literal.js";import{VldBigInt as Me}from"./validators/bigint.js";import{VldSymbol as Te}from"./validators/symbol.js";import{VldTuple as Ne}from"./validators/tuple.js";import{VldRecord as De}from"./validators/record.js";import{VldSet as Ce}from"./validators/set.js";import{VldMap as Pe}from"./validators/map.js";import{VldEnum as Ue}from"./validators/enum.js";import{VldIntersection as ke}from"./validators/intersection.js";import{VldAny as Re}from"./validators/any.js";import{VldUnknown as Be}from"./validators/unknown.js";import{VldVoid as $e}from"./validators/void.js";import{VldNever as ze}from"./validators/never.js";import{VldNull as Fe}from"./validators/null.js";import{VldUndefined as Je}from"./validators/undefined.js";import{VldNan as qe}from"./validators/nan.js";import{VldLazy as We}from"./validators/lazy.js";import{VldDiscriminatedUnion as Ke}from"./validators/discriminated-union.js";import{VldXor as Ge}from"./validators/xor.js";import{VldJson as Xe}from"./validators/json.js";import{VldTemplateLiteral as He,templateLiteral as Ye}from"./validators/template-literal.js";import{VldCustom as Qe,custom as et,VldInstance as tt}from"./validators/custom.js";import{VldFile as rt,file as nt}from"./validators/file.js";import{VldFunction as ot,functionValidator as at}from"./validators/function.js";import{VldCodec as it}from"./validators/codec.js";import{VldBase64 as st}from"./validators/base64.js";import{VldHex as ct}from"./validators/hex.js";import{VldUint8Array as ut}from"./validators/uint8array.js";import{VldPromise as mt,promise as lt}from"./validators/promise.js";import{map as dt}from"./compat/result.js";export{Err,Ok,ResultUtils,all,failure,flatMap,fromNullable,isErr,isOk,isResult,mapErr,match,success,tryCatch,tryCatchAsync,unwrap,unwrapOr}from"./compat/result.js";import{l as ft}from"./chunks/index-Bn85LHAC.js";export{s as setLocaleAsync}from"./chunks/index-Bn85LHAC.js";import{VldCoerceBigInt as pt,VldCoerceDate as yt,VldCoerceBoolean as vt,VldCoerceNumber as gt,VldCoerceString as ht}from"./coercion/index.js";import{flattenError as bt,prettifyError as xt,treeifyError as Zt}from"./errors.js";export{prettifyErrorColored,prettifyErrorPlain}from"./errors.js";import{V as Vt}from"./chunks/errors-core-BU14-Dk8.js";import{uuid as jt,httpUrl as St,email as At,regexes as Ot,VldStringFormat as wt,ksuid as It,guid as Et,xid as Lt,stringFormat as _t,iso as Mt,hash as Tt,e164 as Nt,currencyCode as Dt,iban as Ct,creditCard as Pt,cidrv6 as Ut,cidrv4 as kt,mac as Rt,ipv6 as Bt,ipv4 as $t,ulid as zt,cuid2 as Ft,cuid as Jt,nanoid as qt,jwt as Wt,hex as Kt,base64url as Gt,base64 as Xt,emoji as Ht,hostname as Yt,uuidv7 as Qt,uuidv6 as er,uuidv4 as tr,url as rr}from"./validators/string-formats.js";export{isValidIBAN}from"./validators/string-formats.js";import{ZodCompileUnsupportedError as nr,ZodCompileAsyncError as or,ZodCompileError as ar,toZod as ir,memoizer as sr,getDiscriminatedOption as cr,properties as ur,validateAsync as mr,validate as lr,COMPILE_INVALID as dr,withParser as fr,compile as pr}from"./compile.js";export{compileFn as zodCompileFn}from"./compile.js";export{b as base64Json,a as base64ToBytes,c as base64ToUint8Array,d as base64UrlToBytes,e as base64urlToBytes,f as bytesToUtf8,g as epochMillisToDate,h as epochSecondsToDate,i as hexLowerToBytes,j as hexToBytes,k as hexToUint8Array,l as invertCodec,m as isoDatetimeToDate,n as jsonCodec,o as jwtPayload,p as numberToBigInt,s as stringToBigInt,q as stringToBoolean,r as stringToHttpURL,t as stringToInt,u as stringToNumber,v as stringToURL,w as stringToUint8Array,x as uint8ArrayToBase64,y as uint8ArrayToBase64Url,z as uint8ArrayToHex,A as uint8ArrayToString,B as uriComponent,C as utf8ToBytes}from"./chunks/index-CkbfQQ4n.js";export{createEmitter,createEventBus,withEmitter}from"./compat/emitter.js";export{createVldKernel,definePlugin,getVldKernel,resetVldKernel,usePlugin}from"./kernel.js";export{blue,bold,createTheme,cyan,dim,gray,green,grey,italic,magenta,default as pigment,red,strip,supportsColor,underline,vldTheme,white,yellow}from"./pigment.js";export{getLocale,getMessages,getSupportedLocales,isLocaleLoaded,isLocaleSupported,registerLocale,setLocale}from"./locales/runtime.js";function yr(e,t={}){const r=function(e){const t=e.target;if("draft-4"===t)return{...e,target:"draft-04"};if("draft-7"===t)return{...e,target:"draft-07"};return e}(t),n=gr(hr(e,r),r),o=r.target||"draft-2020-12";return"draft-04"===o?n.$schema??(n.$schema="http://json-schema.org/draft-04/schema#"):"draft-07"===o?n.$schema??(n.$schema="http://json-schema.org/draft-07/schema#"):"draft-2019-09"===o?n.$schema??(n.$schema="https://json-schema.org/draft/2019-09/schema"):"draft-2020-12"===o&&(n.$schema??(n.$schema="https://json-schema.org/draft/2020-12/schema")),n}function vr(e,t={}){if("boolean"==typeof e)return e?Re.create():ze.create();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}const n=Ar(r),o=n.meta();return t.registry&&o&&t.registry.add(n,o),n}function gr(e,t){const r=t.target||"draft-2020-12",n={...e};if(Array.isArray(n.items)){const e=n.items.map(e=>gr(e,t));"draft-2020-12"===r||"draft-2019-09"===r?(n.prefixItems=e,n.items=!1):n.items=e}else n.items&&"object"==typeof n.items&&(n.items=gr(n.items,t));n.prefixItems&&(n.prefixItems=n.prefixItems.map(e=>gr(e,t))),n.properties&&(n.properties=Object.fromEntries(Object.entries(n.properties).map(([e,r])=>[e,gr(r,t)]))),n.additionalProperties&&"object"==typeof n.additionalProperties&&(n.additionalProperties=gr(n.additionalProperties,t));for(const e of["anyOf","allOf","oneOf"])n[e]&&(n[e]=n[e].map(e=>gr(e,t)));return n.not&&"object"==typeof n.not&&(n.not=gr(n.not,t)),"openapi-3.0"===r&&function(e){if(Array.isArray(e.type)&&e.type.includes("null")){const t=e.type.filter(e=>"null"!==e);if(e.nullable=!0,1===t.length){const r=t[0];void 0!==r?e.type=r:delete e.type}else t.length>1?e.type=t:delete e.type}"number"==typeof e.exclusiveMinimum&&(e.minimum??(e.minimum=e.exclusiveMinimum),e.exclusiveMinimum=!0);"number"==typeof e.exclusiveMaximum&&(e.maximum??(e.maximum=e.exclusiveMaximum),e.exclusiveMaximum=!0)}(n),n}function hr(e,t){t.target;const r=e,n=e.validatorType;if("VldString"===e.constructor.name||n===Z.STRING)return Zr(e,function(e,t){const r=t?.config?.jsonSchema||{},n={type:"string"};void 0!==r.exactLength?(n.minLength=r.exactLength,n.maxLength=r.exactLength):(void 0!==r.minLength&&(n.minLength=r.minLength),void 0!==r.maxLength&&(n.maxLength=r.maxLength));r.format&&(n.format=r.format);r.pattern&&(n.pattern=r.pattern);return n}(0,e),t);if("VldNumber"===e.constructor.name||n===Z.NUMBER)return Zr(e,function(e){const t=e.config||{},r=t.jsonSchema||{},n=t.checks||[],o={type:r.type||"number"};void 0!==r.minimum&&(o.minimum=r.minimum);void 0!==r.maximum&&(o.maximum=r.maximum);void 0!==r.exclusiveMinimum&&(o.exclusiveMinimum=r.exclusiveMinimum);void 0!==r.exclusiveMaximum&&(o.exclusiveMaximum=r.exclusiveMaximum);void 0!==r.multipleOf&&(o.multipleOf=r.multipleOf);if(Object.keys(r).length>0)return o;for(const e of n){const t=e.toString();(t.includes(">=")||t.includes("min"))&&(o.minimum=0),(t.includes("<=")||t.includes("max"))&&(o.maximum=0),(t.includes("isInteger")||t.includes("int"))&&(o.type="integer"),t.includes("isSafeInteger")&&(o.type="integer"),t.includes("Number.isFinite")}return o}(e),t);if("VldBoolean"===e.constructor.name||n===Z.BOOLEAN)return Zr(e,{type:"boolean"},t);if("VldBigInt"===e.constructor.name||n===Z.BIGINT)return br(e,t,"BigInt",()=>function(e){const t=e.jsonSchema||e.config?.jsonSchema||{},r={type:"integer"};return Vr(r,"minimum","x-vld-minimum",t.minimum),Vr(r,"maximum","x-vld-maximum",t.maximum),Vr(r,"exclusiveMinimum","x-vld-exclusiveMinimum",t.exclusiveMinimum),Vr(r,"exclusiveMaximum","x-vld-exclusiveMaximum",t.exclusiveMaximum),r}(e));if("VldDate"===e.constructor.name||n===Z.DATE)return br(e,t,"Date",()=>function(e){const t=e.jsonSchema||e.config?.jsonSchema||{},r={type:"string",format:"date-time"};t.formatMinimum&&(r.formatMinimum=t.formatMinimum);t.formatMaximum&&(r.formatMaximum=t.formatMaximum);t.formatExclusiveMinimum&&(r.formatExclusiveMinimum=t.formatExclusiveMinimum);t.formatExclusiveMaximum&&(r.formatExclusiveMaximum=t.formatExclusiveMaximum);return r}(e));if("VldArray"===e.constructor.name||n===Z.ARRAY)return Zr(e,function(e,t){const r=e._item||e._inner||e.config?.itemValidator,n={type:"array"};r&&(n.items=hr(r,t));void 0!==e.config?.exactLength?(n.minItems=e.config.exactLength,n.maxItems=e.config.exactLength):(void 0!==e.config?.minLength&&(n.minItems=e.config.minLength),void 0!==e.config?.maxLength&&(n.maxItems=e.config.maxLength));e.config?.unique&&(n.uniqueItems=!0);return n}(e,t),t);if("VldObject"===e.constructor.name||n===Z.OBJECT)return Zr(e,function(e,t){const r=e._shape||e.shape||e.config?.shape;if(!r)return{type:"object"};const n={},o=[];for(const[e,a]of Object.entries(r)){const r=a;n[e]=hr(r,t),jr(r)||o.push(e)}const a={type:"object",properties:n};o.length>0&&(a.required=o);e._passthrough||e._loose||e.config?.passthrough?a.additionalProperties=!0:e.config?.catchall?a.additionalProperties=hr(e.config.catchall,t):a.additionalProperties=!1;return a}(e,t),t);if("VldUnion"===e.constructor.name)return Zr(e,function(e,t){const r=e._validators||e._options||e.validators||[];return{anyOf:r.map(e=>hr(e,t))}}(e,t),t);if("VldLiteral"===e.constructor.name)return Zr(e,function(e){const t=e._literal??e.literal??e._value??e.value;return null===t?{type:"null"}:"string"==typeof t?{type:"string",const:t}:"number"==typeof t?{type:"number",const:t}:"boolean"==typeof t?{type:"boolean",const:t}:{const:t}}(e),t);if("VldEnum"===e.constructor.name)return Zr(e,function(e){const t=e._values||e.values;if(Array.isArray(t))return{enum:[...t]};return{}}(e),t);if("VldSet"===e.constructor.name||n===Z.SET)return br(e,t,"Set",()=>function(e,t){const r=e.itemSchema||e.itemValidator||e._item||e._inner,n={type:"array",uniqueItems:!0,"x-vld-type":"set"};r&&(n.items=hr(r,t));return n}(e,t));if("VldMap"===e.constructor.name||n===Z.MAP)return br(e,t,"Map",()=>function(e,t){const r=e.keySchema||e.keyValidator||e._key,n=e.valueSchema||e.valueValidator||e._value,o=r?hr(r,t):{},a=n?hr(n,t):{};return{type:"array","x-vld-type":"map",items:{type:"array",items:[o,a],minItems:2,maxItems:2}}}(e,t));if("VldRecord"===e.constructor.name||n===Z.RECORD)return Zr(e,function(e,t){const r=e.valueSchema||e._value||e._inner||e.valueValidator;if(r)return{type:"object",additionalProperties:hr(r,t)};return{type:"object"}}(e,t),t);if("VldTuple"===e.constructor.name||n===Z.TUPLE)return Zr(e,function(e,t){const r=e.items||e._items||e.validators;if(!r||!Array.isArray(r))return{type:"array"};return{type:"array",items:r.map(e=>hr(e,t)),minItems:r.length,maxItems:r.length}}(e,t),t);if("VldIntersection"===e.constructor.name)return Zr(e,function(e,t){const r=e._first||e.first,n=e._second||e.second,o=[];r&&o.push(hr(r,t));n&&o.push(hr(n,t));return 0===o.length?{}:1===o.length?o[0]??{}:{allOf:o}}(e,t),t);if("VldOptional"===e.constructor.name)return Zr(e,function(e,t){const r=xr(e);if(!r)return{};const n=hr(r,t);return n}(e,t),t);if("VldNullable"===e.constructor.name)return Zr(e,function(e,t){const r=xr(e);if(!r)return{type:"null"};const n=hr(r,t);if("string"==typeof n.type)return{type:[n.type,"null"]};if(Array.isArray(n.type))return n.type.push("null"),n;return{anyOf:[n,{type:"null"}]}}(e,t),t);if("VldNullish"===e.constructor.name)return Zr(e,function(e,t){const r=xr(e);if(!r)return{};const n=hr(r,t);if("string"==typeof n.type)return{...n,type:[n.type,"null"]};return n}(e,t),t);if("VldExactOptional"===e.constructor.name)return Zr(e,function(e,t){const r=xr(e);return r?hr(r,t):{}}(e,t),t);if("VldLazy"===e.constructor.name)return Zr(e,{type:"object"},t);if("VldJson"===e.constructor.name)return Zr(e,{},t);if("VldAny"===e.constructor.name)return Zr(e,{},t);if("VldUnknown"===e.constructor.name)return Zr(e,{},t);if("VldNever"===e.constructor.name)return Zr(e,{not:{}},t);if("VldNull"===e.constructor.name)return Zr(e,{type:"null"},t);if("VldUndefined"===e.constructor.name)return br(e,t,"Undefined",()=>({not:{}}));if("VldNan"===e.constructor.name)return br(e,t,"NaN",()=>({type:"number",not:{}}));if("VldVoid"===e.constructor.name)return br(e,t,"Void",()=>({not:{}}));if("VldSymbol"===e.constructor.name)return br(e,t,"Symbol",()=>({}));if("VldBrand"===e.constructor.name)return Zr(e,hr(r.baseValidator,t),t);if("VldReadonly"===e.constructor.name)return Zr(e,hr(r.baseValidator,t),t);if("VldTransform"===e.constructor.name)return br(e,t,"Transform",()=>hr(xr(r),t));if("VldMeta"===e.constructor.name){const n=hr(r.baseValidator,t);return Zr(e,n,t)}if("VldRefine"===e.constructor.name||"VldSuperRefine"===e.constructor.name)return Zr(e,hr(xr(r),t),t);if("VldPipe"===e.constructor.name){const n="input"===t.io?r.first:r._next||r.second;return Zr(e,hr(n,t),t)}if("VldDefault"===e.constructor.name||"VldCatch"===e.constructor.name)return Zr(e,hr(xr(r),t),t);if("VldPreprocess"===e.constructor.name)return br(e,t,"Preprocess",()=>hr(r._schema,t));if("VldCodec"===e.constructor.name){const n="input"===t.io?r.inputValidator:r.outputValidator;return Zr(e,hr(n,t),t)}if("VldCustom"===e.constructor.name)return br(e,t,"Custom",()=>({}));if("VldStringFormat"===e.constructor.name){return Zr(e,{type:"string",format:e._format},t)}return Zr(e,{},t)}function br(e,t,r,n){if("any"===t.unrepresentable)return Zr(e,{},t);if("vld"===t.unrepresentable)return Zr(e,n(),t);throw new Error(`${r} cannot be represented in JSON Schema`)}function xr(e){return"function"==typeof e.unwrap?e.unwrap():e._inner||e._baseValidator||e.baseValidator||e.valueValidator}function Zr(e,t,r){if(!1===r.includeMetadata)return t;const n=function(e){const t=J.get(e),r=e,n="function"==typeof r.getMeta?r.getMeta():void 0;return t||n?{...n||{},...t||{}}:void 0}(e);if(!n)return t;const o={...t};return n.id&&(o.$id=n.id),n.title&&(o.title=n.title),n.description&&(o.description=n.description),n.examples&&!1!==r.includeExamples&&(o.examples=n.examples),void 0!==n.default&&(o.default=n.default),n.deprecated&&(o.deprecated=!0),n.readOnly&&(o.readOnly=!0),n.writeOnly&&(o.writeOnly=!0),o}function Vr(e,t,r,n){if(void 0===n)return;e[r]=n.toString();const o=function(e){const t=Number(e);if(Number.isSafeInteger(t))return BigInt(t)===e?t:void 0}(n);void 0!==o&&(e[t]=o)}function jr(e){const t=e.constructor.name;return"VldOptional"===t||"VldNullish"===t||"VldExactOptional"===t||e.validatorType===Z.OPTIONAL||e.validatorType===Z.NULLISH||e.validatorType===Z.EXACT_OPTIONAL}function Sr(e,t){const r=t.minProperties,n=t.maxProperties;return void 0===r&&void 0===n?e:V.create(e=>{const t=null!==e&&"object"==typeof e?Object.keys(e).length:0;if(void 0!==r&&t<r||void 0!==n&&t>n){throw new Vt([{code:void 0!==r?"too_small":"too_big",path:[],message:void 0!==r?`Too small: expected object to have >=${r} properties`:`Too big: expected object to have <=${n} properties`}])}return e},e)}function Ar(e){return function(e,t){const r={};t.$id&&(r.id=t.$id);t.title&&(r.title=t.title);t.description&&(r.description=t.description);t.examples&&(r.examples=t.examples);void 0!==t.default&&(r.default=t.default);t.deprecated&&(r.deprecated=!0);t.readOnly&&(r.readOnly=!0);t.writeOnly&&(r.writeOnly=!0);return Object.keys(r).length>0?e.meta(r):e}(function(e){if(e.$ref)return Re.create();if(e.anyOf||e.oneOf){const t=(e.anyOf||e.oneOf).map(e=>Ar(e)).filter(Boolean);if(t.length>0)return Le.create(...t)}if(e.allOf){const t=e.allOf[0];if(void 0===t)return Re.create();const r=Ar(t);if(e.allOf.length>1){const t=Ar({allOf:e.allOf.slice(1)});return ke.create(r,t)}return r}if(e.not)return Re.create();if(void 0!==e.const)return _e.create(e.const);if(e.enum)return Ue.create(e.enum);const t=e.nullable&&"string"==typeof e.type?[e.type,"null"]:e.type;if("string"===t||void 0===t){let t=K.create();if(void 0!==e.minLength&&(t=t.min(e.minLength)),void 0!==e.maxLength&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),e.format)switch(e.format){case"date-time":case"date":case"time":break;case"email":return At();case"uri":case"uri-reference":return St();case"uuid":return jt()}return t}if("number"===t||"integer"===t){let r=Se.create();return"integer"===t&&(r=r.int()),void 0!==e.minimum&&(r=r.min(e.minimum)),void 0!==e.maximum&&(r=r.max(e.maximum)),"number"==typeof e.exclusiveMinimum&&(r=r.gt(e.exclusiveMinimum)),"number"==typeof e.exclusiveMaximum&&(r=r.lt(e.exclusiveMaximum)),!0===e.exclusiveMinimum&&void 0!==e.minimum&&(r=r.gt(e.minimum)),!0===e.exclusiveMaximum&&void 0!==e.maximum&&(r=r.lt(e.maximum)),void 0!==e.multipleOf&&(r=r.multipleOf(e.multipleOf)),r}if("boolean"===t)return Ae.create();if("array"===t){let t;if(e.prefixItems&&e.prefixItems.length>0){const r=e.prefixItems.map(e=>Ar(e));t=Ne.create(...r)}else if(Array.isArray(e.items)){const r=e.items.map(e=>Ar(e));t=Ne.create(...r)}else t=e.items&&!Array.isArray(e.items)?Ie.create(Ar(e.items)):Ie.create(Re.create());return function(e,t){let r=e;if(void 0!==t.minItems&&"function"==typeof r.min&&(r=r.min(t.minItems)),void 0!==t.maxItems&&"function"==typeof r.max&&(r=r.max(t.maxItems)),!0===t.uniqueItems&&"function"==typeof r.unique&&(r=r.unique()),t.contains){const e=Ar(t.contains),n=t.minContains??1,o=t.maxContains;r=r.refine(t=>{if(!Array.isArray(t))return!1;let r=0;for(const n of t)if(e.safeParse(n).success&&(r++,void 0!==o&&r>o))return!1;return r>=n})}return r}(t,e)}if("object"===t){if(e.properties){const t={},r=new Set(e.required||[]);for(const[n,o]of Object.entries(e.properties)){const e=Ar(o);t[n]=r.has(n)?e:e.optional()}let n=Ee.create(t);if(!1===e.additionalProperties)n=n.strict();else if(!0===e.additionalProperties)n=n.passthrough();else if(e.additionalProperties){const t=Ar(e.additionalProperties);return Sr(De.create(t),e)}return Sr(n,e)}return Sr(Ee.create({}),e)}if("null"===t)return Fe.create();if(Array.isArray(t)){const r=t.map(t=>Ar({...e,type:t,nullable:!1}));if(r.length>0)return Le.create(...r)}return Re.create()}(e),e)}class Or extends Error{constructor(e){super(JSON.stringify(e,null,2)),this.code="VLD_VALIDATION_ERROR",this.name="ZodError",this.issues=e}format(){const e={_errors:[]};for(const t of this.issues){const r=t.path;if(0===r.length){e._errors.push(t.message);continue}let n=e;for(let e=0;e<r.length-1;e++){const t=String(r[e]);t in n||(n[t]={_errors:[]}),n=n[t]}const o=String(r[r.length-1]);o in n||(n[o]={_errors:[]}),n[o]._errors.push(t.message)}return e}flatten(){const e=[],t={};for(const r of this.issues){if(0===r.path.length){e.push(r.message);continue}const n=String(r.path[0]);t[n]||(t[n]=[]),t[n].push(r.message)}return{formErrors:e,fieldErrors:t}}get errors(){return this.issues}}function wr(e){const t=[],r=e?.issues??[];for(const e of r){const r={code:e.code??"custom",path:Array.isArray(e.path)?e.path:[],message:e.message??"Invalid value"};void 0!==e.expected&&(r.expected=e.expected),void 0!==e.received&&(r.received=e.received),void 0!==e.minimum&&(r.minimum=e.minimum),void 0!==e.maximum&&(r.maximum=e.maximum),void 0!==e.inclusive&&(r.inclusive=e.inclusive),e.origin&&(r.origin=e.origin),e.format&&(r.format=e.format),e.pattern&&(r.pattern=e.pattern),void 0===r.expected&&("invalid_type"!==r.code&&"invalid_value"!==r.code&&"invalid_literal"!==r.code||(r.expected=e.origin??"unknown"),"invalid_string"===r.code&&e.validation&&(r.expected=e.validation)),void 0===r.received&&"invalid_type"===r.code&&(r.received="string"==typeof e.received?e.received:e.expected?"unknown":void 0),t.push(r)}return new Or(t)}function Ir(e){return e.success?{success:!0,data:e.data}:{success:!1,error:wr(e.error)}}const Er={debug:0,info:1,warn:2,error:3,silent:4},Lr="[0m",_r="[2m",Mr="[36m",Tr={debug:"[90m",info:"[34m",warn:"[33m",error:"[31m"},Nr={debug:"DEBUG",info:"INFO ",warn:"WARN ",error:"ERROR"};function Dr(e={}){const t=e.name??"vld";let r=e.level??"warn";const n=e.handler??function(e){const t=e.colored??!0,r=e.timestamps??!0;return e=>{const n=[];if(r){const r=e.timestamp.toISOString().slice(11,23);n.push(t?`${_r}${r}${Lr}`:r)}const o=Nr[e.level],a=Tr[e.level];n.push(t?`${a}${o}${Lr}`:o),n.push(t?`${Mr}[${e.name}]${Lr}`:`[${e.name}]`),n.push(e.message);const i=n.join(" ");switch(e.level){case"debug":console.debug(i,void 0!==e.data?e.data:"");break;case"info":console.info(i,void 0!==e.data?e.data:"");break;case"warn":console.warn(i,void 0!==e.data?e.data:"");break;case"error":console.error(i,void 0!==e.data?e.data:"")}}}(e),o=(e,o,a)=>{if(Er[e]<Er[r])return;const i={level:e,message:o,data:a,timestamp:new Date,name:t};n(i)};return{debug:(e,t)=>o("debug",e,t),info:(e,t)=>o("info",e,t),warn:(e,t)=>o("warn",e,t),error:(e,t)=>o("error",e,t),isLevelEnabled:e=>Er[e]>=Er[r],setLevel:e=>{r=e},getLevel:()=>r,child:r=>Dr({...e,name:`${t}:${r}`})}}let Cr=null;function Pr(e){return Cr=Dr({name:"vld",...e}),Cr}function Ur(){return Cr}function kr(e){Cr&&Cr.setLevel(e)}function Rr(){Cr?Cr.setLevel("debug"):Pr({level:"debug"})}function Br(){Cr&&Cr.setLevel("silent")}function $r(){return Dr({level:"silent"})}const zr=Symbol.for("@oxog/vld/global-state"),Fr=globalThis,Jr=Fr[zr]??(Fr[zr]={config:{}});function qr(e){return void 0===e||(Jr.config={...Jr.config,...e},"customError"in e?Jr.errorMap=e.customError:"errorMap"in e&&(Jr.errorMap=e.errorMap)),{...Jr.config}}function Wr(e){Jr.errorMap=e,Jr.config={...Jr.config,errorMap:e}}function Kr(){return Jr.errorMap}function Gr(e){const t=Object.keys(e).filter(e=>!/^\d+$/.test(e)).map(t=>e[t]).filter(e=>"string"==typeof e||"number"==typeof e),r=Array.from(new Set(t));if(0===r.length)throw new Error("nativeEnum requires at least one string or number value");return r}function Xr(e,t,r){let n=e;for(const e of t){const t=String(e),r=n[t];r&&!Array.isArray(r)||(n[t]={_errors:[]}),n=n[t]}n._errors.push(r)}function Hr(e){return void 0===e?void 0:T(e,"Refinement check failed")}function Yr(e){return et({parse:t=>{const r=e(t,{addIssue:()=>{},path:[]});if(null!==r&&"object"==typeof r&&"function"==typeof r.then)throw new Error("Use parseAsync for async transforms");return r},parseAsync:async t=>await Promise.resolve(e(t,{addIssue:()=>{},path:[]}))})}function Qr(e,t){return et({parse:r=>{const n=e(r);if(null!==n&&"object"==typeof n&&"function"==typeof n.then)throw new Error("Use parseAsync for async refinements");if(!n)throw new Error(Hr(t)||"Refinement check failed");return r},parseAsync:async r=>{if(!await e(r))throw new Error(Hr(t)||"Refinement check failed");return r}})}const en={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6},tn={},rn=Symbol.for("vld_brand"),nn=Symbol.for("VldInput"),on=Symbol.for("VldOutput"),an={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"},sn={getParsedType:function(e){return null===e?"null":Array.isArray(e)?"array":Number.isNaN(e)?"nan":typeof e},propertyKeyTypes:new Set(["string","number","symbol"]),primitiveTypes:new Set(["string","number","bigint","boolean","symbol","undefined","null"]),assert:(e,t="Assertion failed")=>{if(!e)throw new Error(t)},assertNever:e=>{throw new Error(`Unexpected value: ${String(e)}`)},joinValues:(e,t=" | ")=>e.map(e=>JSON.stringify(e)).join(t),jsonStringifyReplacer:(e,t)=>"bigint"==typeof t?t.toString():t,nullish:e=>null==e,cached:e=>{let t,r=!1;return()=>(r||(t=e(),r=!0),t)}},cn={util:sn,regexes:Ot,locales:ft,NEVER:ze.create(),TimePrecision:en,ZodIssueCode:an,globalRegistry:J,config:qr,getErrorMap:Kr,setErrorMap:Wr,parse:(e,t)=>e.parse(t),safeParse:(e,t)=>e.safeParse(t),parseAsync:(e,t)=>e.parseAsync(t),safeParseAsync:(e,t)=>e.safeParseAsync(t)};function un(e){return Ee.create(e||{})}function mn(e,t,r){const n=r.get(e);if(n)return n;if(e instanceof We){const n=e,o=We.create(()=>mn(n.unwrap(),t,r));return r.set(e,o),o}const o=function(e,t){const r=e;if(e instanceof Ee){const n=e.shape,o={};let a=!1;for(const e of Object.keys(n))o[e]=t(n[e]),a||(a=o[e]!==n[e]);let i=r.config.catchall;if(i){const e=t(i);a||(a=e!==i),i=e}return a?new Ee({...r.config,shape:o,catchall:i}):e}if(e instanceof Ie){const n=t(r.element);return n===r.element?e:Ie.create(n)}if(e instanceof Ce){const n=t(r.itemSchema);return n===r.itemSchema?e:Ce.create(n)}if(e instanceof Pe){const n=t(r.keySchema),o=t(r.valueSchema);return n===r.keySchema&&o===r.valueSchema?e:Pe.create(n,o)}if(e instanceof De){const n=t(r.valueSchema),o=r.keySchema?t(r.keySchema):void 0,a=void 0!==r.keySchema&&o!==r.keySchema;return n!==r.valueSchema||a?De.create(n,o):e}if(e instanceof Ne){const n=e.items.map(t),o=n.some((e,t)=>e!==r.items[t]),a=null==r.restValidator?void 0:t(r.restValidator),i=null!=r.restValidator&&a!==r.restValidator;return o||i?new Ne(n,r.errorMessage,a):e}if(e instanceof Le){const n=r.validators.map(t);return n.some((e,t)=>e!==r.validators[t])?new Le(n,r.errorMessage):e}if(e instanceof Ge){const n=r._options.map(t);return n.some((e,t)=>e!==r._options[t])?new Ge(n):e}if(e instanceof Ke){const n=r._options.map(t);return n.some((e,t)=>e!==r._options[t])?Le.create(...n):e}if(e instanceof ke){const n=t(r.validatorA),o=t(r.validatorB);return n===r.validatorA&&o===r.validatorB?e:ke.create(n,o)}if(e instanceof N){const n=t(r.first),o=t(r.second);return n===r.first&&o===r.second?e:new N(n,o)}if(e instanceof M){const n=t(r.baseValidator);return n===r.baseValidator?e:M.create(n)}if(e instanceof _){const n=t(r.baseValidator);return n===r.baseValidator?e:_.create(n)}if(e instanceof L){const n=t(r.baseValidator);return n===r.baseValidator?e:L.create(n)}if(e instanceof E){const n=t(r.baseValidator);return n===r.baseValidator?e:E.create(n)}if(e instanceof I){const n=t(r.baseValidator);return n===r.baseValidator?e:new I(n,r.defaultValue)}if(e instanceof D){const n=t(r.baseValidator);return n===r.baseValidator?e:new D(n,r.defaultValue)}if(e instanceof P){const n=t(r.baseValidator);return n===r.baseValidator?e:new P(n,r.fallbackValue)}if(e instanceof U){const n=t(r.baseValidator);return n===r.baseValidator?e:new U(n)}if(e instanceof R){const n=t(r.baseValidator);return n===r.baseValidator?e:new R(n,r.metadata)}if(e instanceof $){const n=t(r.baseValidator);return n===r.baseValidator?e:new $(n,r.predicate,r.customMessage)}if(e instanceof F){const n=t(r.baseValidator);return n===r.baseValidator?e:new F(n,r.transformer)}if(e instanceof V){const n=t(r._schema);return n===r._schema?e:new V(r._preprocessor,n)}return e}(e,e=>mn(e,t,r)),a=t(o)??o;return r.set(e,a),a}function ln(e){return mn(e,e=>e instanceof Ee?e.partial():void 0,new Map)}function dn(e){return mn(e,e=>e instanceof N?e.first:void 0,new Map)}function fn(e){return mn(e,e=>e instanceof N?e.second:void 0,new Map)}S({array:e=>Ie.create(e),union:(e,t)=>Le.create(e,t),intersection:(e,t)=>ke.create(e,t),toJSONSchema:(e,t)=>yr(e,t)});const pn={string:()=>K.create(),stringLegacy:()=>K.create(),stringV2:()=>X.create(),number:()=>Se.create(),numberLegacy:()=>Se.create(),numberV2:()=>Y.create(),int:()=>Se.create().int(),int32:()=>Se.create().int().min(-2147483648).max(2147483647),uint32:()=>Se.create().uint32(),uint64:()=>Se.create().uint64(),int64:()=>Se.create().int64(),float32:()=>Se.create().float32(),float64:()=>Se.create().float64(),boolean:()=>Ae.create(),booleanV2:()=>le.create(),date:()=>Oe.create(),dateLegacy:()=>Oe.create(),dateV2:()=>Q.create(),bigint:()=>Me.create(),bigintLegacy:()=>Me.create(),bigintV2:()=>ee.create(),symbol:()=>Te.create(),stringbool:e=>we.create(e),array:e=>Ie.create(e),arrayV2:e=>te.create(e),tuple:function(...e){const t=Array.isArray(e[0])?e[0]:e.filter(e=>e instanceof O),r=Ne.create(...t);return Array.isArray(e[0])&&e[1]instanceof O?r.rest(e[1]):r},tupleV2:(...e)=>je.create(...e),set:e=>Ce.create(e),setV2:e=>Ve.create(e),map:(e,t)=>Pe.create(e,t),mapV2:(e,t)=>Ze.create(e,t),record:function(e,t){return void 0===t?De.create(e):De.create(t,e)},recordV2:e=>me.create(e),object:un,strictObject:function(e){return un(e).strict()},looseObject:function(e){return un(e).passthrough()},partialRecord:function(e,t){return void 0===t?De.create(e).partial():De.create(t,e).partial()},looseRecord:function(e,t){return void 0===t?De.create(e).loose():De.create(t,e).loose()},union:function(...e){const t=Array.isArray(e[0])?e[0]:e.filter(e=>e instanceof O);return Le.create(...t)},unionV2:(...e)=>re.create(...e),intersection:(e,t)=>ke.create(e,t),intersectionV2:(e,t)=>xe.create(e,t),discriminatedUnion:function(e,...t){const r=Array.isArray(t[0])?t[0]:t.filter(e=>e instanceof O);return Ke.create(e,r)},xor:function(...e){const t=Array.isArray(e[0])?e[0]:e.filter(e=>e instanceof O);return Ge.create(t)},keyof:e=>e.keyof(),deepPartial:ln,input:dn,output:fn,literal:function(e){return _e.create(e)},literalV2:e=>ue.create(e),enum:function(...e){const t=e[0],r=Array.isArray(t)?t:null!==t&&"object"==typeof t?Gr(t):e.filter(e=>"string"==typeof e||"number"==typeof e);return Ue.create(r)},enumV2:e=>ce.create(e),nativeEnum:e=>Ue.create(Gr(e)),any:()=>Re.create(),unknown:()=>Be.create(),void:()=>$e.create(),never:()=>ze.create(),null:()=>Fe.create(),undefined:()=>Je.create(),nan:()=>qe.create(),NEVER:ze.create(),TimePrecision:en,ZodIssueCode:an,ZodFirstPartyTypeKind:tn,optional:e=>M.create(e),optionalV2:e=>se.create(e),nullable:e=>_.create(e),nullableV2:e=>ie.create(e),nullish:e=>L.create(e),nullishV2:e=>ae.create(e),exactOptional:e=>E.create(e),nonoptional:(e,t)=>e.refine(e=>void 0!==e,Hr(t)),catch:(e,t)=>e.catch(t),prefault:(e,t)=>e.prefault(t),readonly:e=>e.readonly(),pipe:(e,t)=>e.pipe(t),pipeline:(e,t)=>e.pipe(t),clone:e=>e,describe:(e,t)=>e instanceof O?e.describe(t||""):Be.create().describe(e),meta:(e,t)=>e instanceof O?e.meta(t||{}):Be.create().meta(e),transform:(e,t)=>e instanceof O?e.transform(t||(e=>e)):Yr(e),transformV2:(e,t)=>oe.create(e,t),overwrite:e=>Yr(e),refine:(e,t,r)=>e instanceof O?e.refine(t,Hr(r)):Qr(e,t),refineV2:(e,t,r)=>ne.create(e,t,r),check:(e,t,r)=>e instanceof O?e.check(t,Hr(r)):Qr(e,t),superRefine:(e,t)=>e instanceof O?e.superRefine(t||(()=>{})):function(e){return Be.create().superRefine(e)}(e),property:function(e,t,r){return et({parse:n=>{if("object"!=typeof n||null===n||!(e in n))throw new Error(Hr(r)||`Expected object with property "${e}"`);const o=t.safeParse(n[e]);if(!o.success)throw new Error(Hr(r)||o.error.message);return n}})},instanceof:(e,t)=>new tt(e,Hr(t)),config:qr,setErrorMap:Wr,getErrorMap:Kr,core:cn,util:sn,locales:ft,lazy:e=>We.create(e),json:e=>Xe.create(e),custom:et,file:()=>nt(),function:()=>at(),useV2:!1,setV2Mode:e=>{pn.useV2=e},preprocess:(e,t)=>V.create(e,t),coerce:{string:()=>ht.create(),stringLegacy:()=>ht.create(),number:()=>gt.create(),numberLegacy:()=>gt.create(),boolean:()=>vt.create(),date:()=>yt.create(),bigint:()=>pt.create(),stringV2:()=>G.create(),numberV2:()=>H.create()},email:e=>At(e),url:e=>rr(e),uuid:e=>jt(e),uuidv4:()=>tr(),uuidv6:()=>er(),uuidv7:()=>Qt(),hostname:()=>Yt(),emoji:()=>Ht(),base64:()=>Xt(),base64url:()=>Gt(),hex:()=>Kt(),jwt:()=>Wt(),nanoid:()=>qt(),cuid:()=>Jt(),cuid2:()=>Ft(),ulid:()=>zt(),ipv4:()=>$t(),ipv6:()=>Bt(),mac:()=>Rt(),cidrv4:()=>kt(),cidrv6:()=>Ut(),creditCard:e=>Pt(e),iban:e=>Ct(e),currencyCode:e=>Dt(e),e164:()=>Nt(),hash:e=>Tt(e),iso:{ZodISODate:wt,ZodISODateTime:wt,ZodISODuration:wt,ZodISOTime:wt,date:()=>Mt.date(),time:e=>Mt.time(e),datetime:e=>Mt.datetime(e),dateTime:e=>Mt.dateTime(e),duration:()=>Mt.duration()},stringFormat:(e,t)=>_t(e,t),minLength:(e,t)=>K.create().min(e,t),maxLength:(e,t)=>K.create().max(e,t),length:(e,t)=>K.create().length(e,t),regex:(e,t)=>K.create().regex(e,t),startsWith:(e,t)=>K.create().startsWith(e,t),endsWith:(e,t)=>K.create().endsWith(e,t),includes:(e,t)=>K.create().includes(e,t),trim:()=>K.create().trim(),toLowerCase:()=>K.create().toLowerCase(),lowercase:()=>K.create().toLowerCase(),toUpperCase:()=>K.create().toUpperCase(),uppercase:()=>K.create().toUpperCase(),gt:(e,t)=>Se.create().gt(e,t),gte:(e,t)=>Se.create().gte(e,t),lt:(e,t)=>Se.create().lt(e,t),lte:(e,t)=>Se.create().lte(e,t),positive:e=>Se.create().positive(e),negative:e=>Se.create().negative(e),nonnegative:e=>Se.create().nonnegative(e),nonpositive:e=>Se.create().nonpositive(e),multipleOf:(e,t)=>Se.create().multipleOf(e,t),minSize:(e,t)=>K.create().min(e,t),maxSize:(e,t)=>K.create().max(e,t),size:(e,t)=>K.create().length(e,t),normalize:e=>K.create().transform(t=>t.normalize(e)),slugify:()=>K.create().transform(e=>e.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")),mime:(e,t)=>rt.create().mime(e,t),xid:()=>Lt(),guid:()=>Et(),httpUrl:()=>St(),ksuid:()=>It(),regexes:Ot,compile:(e,t)=>pr(e,t),withParser:(e,t)=>fr(e,t),INVALID:dr,validate:lr,validateAsync:mr,properties:ur,getDiscriminatedOption:cr,memoizer:sr,toZod:ir,templateLiteral:(...e)=>Ye(...e),base64Bytes:()=>st.create(),hexBytes:()=>ct.create(),uint8Array:()=>ut.create(),codec:(e,t,r)=>it.create(e,t,r),invertCodec:e=>e.invert(),promise:e=>lt(e),parse:(e,t)=>e.parse(t),safeParse:(e,t)=>e.safeParse(t),parseAsync:(e,t)=>e.parseAsync(t),safeParseAsync:(e,t)=>e.safeParseAsync(t),decode:(e,t)=>e.parse(t),safeDecode:(e,t)=>e.safeParse(t),decodeAsync:(e,t)=>e.parseAsync(t),safeDecodeAsync:(e,t)=>e.safeParseAsync(t),encode:(e,t)=>e.encode(t),safeEncode:(e,t)=>e.safeEncode(t),encodeAsync:(e,t)=>e.encodeAsync(t),safeEncodeAsync:(e,t)=>e.safeEncodeAsync(t),formatError:e=>{const t={_errors:[]};if(e instanceof Vt){for(const r of e.issues)Xr(t,r.path,r.message);return t}return t._errors.push(function(e){return e instanceof Error?e.message:String(e)}(e)),t},treeifyError:Zt,prettifyError:xt,flattenError:bt,toJSONSchema:yr,fromJSONSchema:vr,globalRegistry:J,registry:W,_default:(e,t)=>new I(e,t),success:e=>et({parse:e=>e}),_function:()=>at(),ZodType:O,ZodTypeAny:O,ZodTypeDef:Object,ZodError:Vt,ZodRealError:Vt,ZodCompileError:ar,ZodCompileAsyncError:or,ZodCompileUnsupportedError:nr,_ZodString:K,ZodString:K,ZodStringFormat:K,ZodEmail:K,ZodGUID:K,ZodUUID:K,ZodURL:K,ZodEmoji:K,ZodNanoID:K,ZodCUID:K,ZodCUID2:K,ZodULID:K,ZodXID:K,ZodKSUID:K,ZodIPv4:K,ZodMAC:K,ZodIPv6:K,ZodCIDRv4:K,ZodCIDRv6:K,ZodBase64:K,ZodBase64URL:K,ZodE164:K,ZodJWT:K,ZodCustomStringFormat:K,ZodNumber:Se,ZodNumberFormat:Se,ZodBoolean:Ae,ZodBigInt:Me,ZodBigIntFormat:Me,ZodSymbol:Te,ZodUndefined:Je,ZodNull:Fe,ZodAny:Re,ZodUnknown:Be,ZodNever:ze,ZodVoid:$e,ZodDate:Oe,ZodArray:Ie,ZodObject:Ee,ZodUnion:Le,ZodXor:Ge,ZodDiscriminatedUnion:Ke,ZodIntersection:ke,ZodTuple:Ne,ZodRecord:De,ZodMap:Pe,ZodSet:Ce,ZodEnum:Ue,ZodLiteral:_e,ZodFile:rt,ZodTransform:O,ZodOptional:O,ZodExactOptional:O,ZodNullable:O,ZodDefault:O,ZodPrefault:O,ZodNonOptional:O,ZodSuccess:Qe,ZodCatch:O,ZodNaN:qe,ZodPipe:O,ZodCodec:it,ZodPreprocess:O,ZodReadonly:O,ZodTemplateLiteral:He,ZodLazy:We,ZodPromise:mt,ZodFunction:ot,ZodCustom:Qe,ZodISODateTime:K,ZodISODate:K,ZodISOTime:K,ZodISODuration:K,$brand:Symbol.for("zod.brand"),$output:Symbol.for("zod.output"),$input:Symbol.for("zod.input")},yn={string:()=>X.create(),number:()=>Y.create(),boolean:()=>le.create(),date:()=>Q.create(),bigint:()=>ee.create(),int:()=>Y.create().int(),int32:()=>Y.create().int().min(-2147483648).max(2147483647),uint32:()=>Y.create().uint32(),uint64:()=>Y.create().uint64(),int64:()=>Y.create().int64(),float32:()=>Y.create().float32(),float64:()=>Y.create().float64(),array:e=>te.create(e),tuple:(...e)=>je.create(...e),set:e=>Ve.create(e),map:(e,t)=>Ze.create(e,t),record:e=>me.create(e),union:(...e)=>re.create(...e),intersection:(e,t)=>xe.create(e,t),literal:e=>ue.create(e),enum:e=>ce.create(e),optional:e=>se.create(e),nullable:e=>ie.create(e),nullish:e=>ae.create(e),object:un,any:()=>be.create(),unknown:()=>he.create(),void:()=>ge.create(),never:()=>ve.create(),null:()=>ye.create(),undefined:()=>pe.create(),symbol:()=>fe.create(),function:()=>de.create(),coerce:{string:()=>G.create(),number:()=>H.create()},transformV2:(e,t)=>oe.create(e,t),refineV2:(e,t,r)=>ne.create(e,t,r)},vn=pn,{string:gn,number:hn,int:bn,int32:xn,uint32:Zn,uint64:Vn,int64:jn,float32:Sn,float64:An,boolean:On,date:wn,bigint:In,symbol:En,stringbool:Ln,array:_n,object:Mn,strictObject:Tn,looseObject:Nn,tuple:Dn,record:Cn,partialRecord:Pn,looseRecord:Un,set:kn,union:Rn,intersection:Bn,discriminatedUnion:$n,xor:zn,keyof:Fn,literal:Jn,nativeEnum:qn,any:Wn,unknown:Kn,nan:Gn,optional:Xn,nullable:Hn,nullish:Yn,exactOptional:Qn,nonoptional:eo,readonly:to,pipe:ro,clone:no,describe:oo,meta:ao,transform:io,overwrite:so,refine:co,check:uo,superRefine:mo,property:lo,config:fo,setErrorMap:po,getErrorMap:yo,locales:vo,lazy:go,json:ho,custom:bo,file:xo,preprocess:Zo,coerce:Vo,email:jo,url:So,uuid:Ao,uuidv4:Oo,uuidv6:wo,uuidv7:Io,hostname:Eo,emoji:Lo,base64:_o,base64url:Mo,hex:To,jwt:No,nanoid:Do,cuid:Co,cuid2:Po,ulid:Uo,ipv4:ko,ipv6:Ro,mac:Bo,cidrv4:$o,cidrv6:zo,creditCard:Fo,e164:Jo,hash:qo,iso:Wo,stringFormat:Ko,normalize:Go,slugify:Xo,mime:Ho,xid:Yo,guid:Qo,httpUrl:ea,ksuid:ta,regexes:ra,templateLiteral:na,base64Bytes:oa,hexBytes:aa,uint8Array:ia,codec:sa,promise:ca,prefault:ua,parse:ma,safeParse:la,parseAsync:da,safeParseAsync:fa,decode:pa,safeDecode:ya,decodeAsync:va,safeDecodeAsync:ga,encode:ha,safeEncode:ba,encodeAsync:xa,safeEncodeAsync:Za,formatError:Va,NEVER:ja,compile:Sa,validate:Aa,validateAsync:Oa,properties:wa,getDiscriminatedOption:Ia,memoizer:Ea,toZod:La}=pn,_a=e=>Ct(e),Ma=e=>Dt(e),Ta=pn.catch,Na=pn.enum,Da=pn.function,Ca=pn.instanceof,Pa=pn.map,Ua=pn.never,ka=pn.null,Ra=pn.undefined,Ba=pn.void,$a=pn,za=K;function Fa(e,t){return e instanceof O&&t instanceof O?pn.map(e,t):dt(e,t)}const Ja=(e,t)=>pn.string().min(e,t),qa=(e,t)=>pn.string().max(e,t),Wa=(e,t)=>pn.string().length(e,t),Ka=(e,t)=>pn.string().regex(e,t),Ga=(e,t)=>pn.string().startsWith(e,t),Xa=(e,t)=>pn.string().endsWith(e,t),Ha=(e,t)=>pn.string().includes(e,t),Ya=()=>pn.string().trim(),Qa=()=>pn.string().toLowerCase(),ei=Qa,ti=()=>pn.string().toUpperCase(),ri=ti,ni=(e,t)=>pn.number().gt(e,t),oi=(e,t)=>pn.number().gte(e,t),ai=(e,t)=>pn.number().lt(e,t),ii=(e,t)=>pn.number().lte(e,t),si=e=>pn.number().positive(e),ci=e=>pn.number().negative(e),ui=e=>pn.number().nonnegative(e),mi=e=>pn.number().nonpositive(e),li=(e,t)=>pn.number().multipleOf(e,t),di=Ja,fi=qa,pi=Wa;export{rn as $brand,nn as $input,on as $output,dr as COMPILE_INVALID,dr as INVALID,ja as NEVER,en as TimePrecision,O as VldBase,Vt as VldError,ke as VldIntersection,R as VldMeta,Re as ZodAny,Ie as ZodArray,wt as ZodBase64,wt as ZodBase64URL,Me as ZodBigInt,Me as ZodBigIntFormat,Ae as ZodBoolean,wt as ZodCIDRv4,wt as ZodCIDRv6,wt as ZodCUID,wt as ZodCUID2,P as ZodCatch,it as ZodCodec,or as ZodCompileAsyncError,nr as ZodCompileUnsupportedError,wt as ZodCreditCard,Qe as ZodCustom,wt as ZodCustomStringFormat,Oe as ZodDate,I as ZodDefault,Ke as ZodDiscriminatedUnion,wt as ZodE164,wt as ZodEmail,wt as ZodEmoji,Ue as ZodEnum,Vt as ZodError,E as ZodExactOptional,rt as ZodFile,tn as ZodFirstPartyTypeKind,ot as ZodFunction,wt as ZodGUID,wt as ZodIBAN,wt as ZodIPv4,wt as ZodIPv6,wt as ZodISODate,wt as ZodISODateTime,wt as ZodISODuration,wt as ZodISOTime,tt as ZodInstanceOf,ke as ZodIntersection,an as ZodIssueCode,Xe as ZodJSON,wt as ZodJWT,wt as ZodKSUID,We as ZodLazy,Or as ZodLikeError,_e as ZodLiteral,wt as ZodMAC,Pe as ZodMap,R as ZodMeta,qe as ZodNaN,wt as ZodNanoID,ze as ZodNever,$ as ZodNonOptional,Fe as ZodNull,_ as ZodNullable,Se as ZodNumber,Se as ZodNumberFormat,Ee as ZodObject,M as ZodOptional,N as ZodPipe,D as ZodPrefault,V as ZodPreprocess,mt as ZodPromise,U as ZodReadonly,Vt as ZodRealError,De as ZodRecord,Ce as ZodSet,K as ZodString,wt as ZodStringFormat,Qe as ZodSuccess,Te as ZodSymbol,He as ZodTemplateLiteral,F as ZodTransform,Ne as ZodTuple,O as ZodType,wt as ZodULID,wt as ZodURL,wt as ZodUUID,Je as ZodUndefined,Le as ZodUnion,Be as ZodUnknown,$e as ZodVoid,wt as ZodXID,Ge as ZodXor,za as _ZodString,$a as _default,Da as _function,Wn as any,_n as array,_o as base64,oa as base64Bytes,Mo as base64url,In as bigint,On as boolean,Ta as catch,uo as check,$o as cidrv4,zo as cidrv6,no as clone,sa as codec,Vo as coerce,Sa as compile,fo as config,cn as core,Dr as createLogger,$r as createNoOpLogger,Fo as creditCard,Co as cuid,Po as cuid2,Ma as currencyCode,bo as custom,wn as date,pa as decode,va as decodeAsync,ln as deepPartial,pn as default,oo as describe,Br as disableLogging,$n as discriminatedUnion,Jo as e164,jo as email,Lo as emoji,Rr as enableDebug,ha as encode,xa as encodeAsync,Xa as endsWith,Na as enum,Qn as exactOptional,xo as file,bt as flattenError,Sn as float32,An as float64,Va as formatError,vr as fromJSONSchema,Da as function,Ia as getDiscriminatedOption,yo as getErrorMap,Ur as getLogger,J as globalRegistry,ni as gt,oi as gte,Qo as guid,qo as hash,To as hex,aa as hexBytes,Eo as hostname,ea as httpUrl,_a as iban,Ha as includes,Pr as initLogger,dn as input,Ca as instanceof,bn as int,xn as int32,jn as int64,Bn as intersection,ko as ipv4,Ro as ipv6,Wo as iso,ho as json,No as jwt,Fn as keyof,ta as ksuid,go as lazy,Wa as length,Jn as literal,vo as locales,Nn as looseObject,Un as looseRecord,ei as lowercase,ai as lt,ii as lte,Bo as mac,Fa as map,Pa as mapSchema,qa as maxLength,fi as maxSize,Ea as memoizer,ao as meta,Ho as mime,Ja as minLength,di as minSize,li as multipleOf,Gn as nan,Do as nanoid,qn as nativeEnum,ci as negative,Ua as never,ui as nonnegative,eo as nonoptional,mi as nonpositive,Go as normalize,ka as null,Hn as nullable,Yn as nullish,hn as number,Mn as object,Xn as optional,fn as output,so as overwrite,ma as parse,da as parseAsync,Pn as partialRecord,ro as pipe,si as positive,ua as prefault,Zo as preprocess,xt as prettifyError,ca as promise,wa as properties,lo as property,to as readonly,Cn as record,co as refine,Ka as regex,ra as regexes,W as registry,ya as safeDecode,ga as safeDecodeAsync,ba as safeEncode,Za as safeEncodeAsync,la as safeParse,fa as safeParseAsync,kn as set,po as setErrorMap,kr as setLogLevel,pi as size,Xo as slugify,Ga as startsWith,Tn as strictObject,gn as string,Ko as stringFormat,Ln as stringbool,mo as superRefine,En as symbol,na as templateLiteral,yr as toJSONSchema,Qa as toLowerCase,ti as toUpperCase,La as toZod,wr as toZodError,Ir as toZodSafeResult,io as transform,Zt as treeifyError,Ya as trim,Dn as tuple,Zn as uint32,Vn as uint64,ia as uint8Array,Uo as ulid,Ra as undefined,Rn as union,Kn as unknown,ri as uppercase,So as url,sn as util,Ao as uuid,Oo as uuidv4,wo as uuidv6,Io as uuidv7,pn as v,yn as vV2,Aa as validate,Oa as validateAsync,Ba as void,fr as withParser,Yo as xid,zn as xor,vn as z};
|
package/dist/locales/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{getLocale,getMessages,getMessagesForLocale,getSupportedLocales,isLocaleLoaded,isLocaleSupported,registerLocale,setLocale}from"./runtime.js";import"./en.js";import"./tr.js";import"./es.js";import"./fr.js";import"./de.js";import"./it.js";import"./pt.js";import"./ru.js";import"./ja.js";import"./ko.js";import"./zh.js";import"./ar.js";import"./hi.js";import"./nl.js";import"./pl.js";import"./da.js";import"./sv.js";import"./no.js";import"./fi.js";import"./th.js";import"./vi.js";import"./id.js";import"./bn.js";import"./gu.js";import"./kn.js";import"./ne.js";import"./sk.js";import"./sw.js";import"./af.js";import"./pt-BR.js";import"./es-MX.js";export{s as setLocaleAsync}from"../chunks/index-
|
|
1
|
+
export{getLocale,getMessages,getMessagesForLocale,getSupportedLocales,isLocaleLoaded,isLocaleSupported,registerLocale,setLocale}from"./runtime.js";import"./en.js";import"./tr.js";import"./es.js";import"./fr.js";import"./de.js";import"./it.js";import"./pt.js";import"./ru.js";import"./ja.js";import"./ko.js";import"./zh.js";import"./ar.js";import"./hi.js";import"./nl.js";import"./pl.js";import"./da.js";import"./sv.js";import"./no.js";import"./fi.js";import"./th.js";import"./vi.js";import"./id.js";import"./bn.js";import"./gu.js";import"./kn.js";import"./ne.js";import"./sk.js";import"./tg.js";import"./sw.js";import"./af.js";import"./pt-BR.js";import"./es-MX.js";export{s as setLocaleAsync}from"../chunks/index-Bn85LHAC.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const i={invalidString:"Сатр нодуруст аст",stringMin:i=>`Сатр бояд ҳадди ақал ${i} аломат дошта бошад`,stringMax:i=>`Сатр бояд ҳадди аксар ${i} аломат дошта бошад`,stringLength:i=>`Сатр бояд айнан ${i} аломат дошта бошад`,stringEmail:"Суроғаи электронӣ нодуруст аст",stringUrl:"URL нодуруст аст",stringUuid:"UUID нодуруст аст",stringRegex:"Шакл нодуруст аст",stringStartsWith:i=>`Сатр бояд бо "${i}" оғоз шавад`,stringEndsWith:i=>`Сатр бояд бо "${i}" тамом шавад`,stringIncludes:i=>`Сатр бояд "${i}"-ро дар бар гирад`,stringIp:"Суроғаи IP нодуруст аст",stringIpv4:"Суроғаи IPv4 нодуруст аст",stringIpv6:"Суроғаи IPv6 нодуруст аст",stringEmpty:"Сатр набояд холӣ бошад",invalidNumber:"Рақам нодуруст аст",numberMin:i=>`Рақам бояд ҳадди ақал ${i} бошад`,numberMax:i=>`Рақам бояд ҳадди аксар ${i} бошад`,numberInt:"Рақам бояд бутун бошад",numberPositive:"Рақам бояд мусбат бошад",numberNegative:"Рақам бояд манфӣ бошад",numberNonnegative:"Рақам набояд манфӣ бошад",numberNonpositive:"Рақам набояд мусбат бошад",numberFinite:"Рақам бояд маҳдуд бошад",numberSafe:"Рақам бояд дар диапазони бутуни бехатар бошад",numberMultipleOf:i=>`Рақам бояд зариби ${i} бошад`,invalidBoolean:"Мақоми мантиқӣ нодуруст аст",invalidDate:"Таърих нодуруст аст",dateMin:i=>`Таърих бояд баъд аз ${i.toISOString()} бошад`,dateMax:i=>`Таърих бояд пеш аз ${i.toISOString()} бошад`,invalidObject:"Объект нодуруст аст",unexpectedKeys:i=>`Калидҳои номақбул: ${i.join(", ")}`,requiredField:i=>`Required field "${i}" is missing`,invalidArray:"Рӯйхат нодуруст аст",arrayMin:i=>`Рӯйхат бояд ҳадди ақал ${i} унсур дошта бошад`,arrayMax:i=>`Рӯйхат бояд ҳадди аксар ${i} унсур дошта бошад`,arrayLength:i=>`Рӯйхат бояд айнан ${i} унсур дошта бошад`,arrayEmpty:"Рӯйхат набояд холӣ бошад",arrayItem:(i,e)=>`Унсури рӯйхат ${i}: ${e}`,objectField:(i,e)=>`Майдон "${i}": ${e}`,unionNoMatch:i=>`Ягон имкони иттиҳод мувофиқ нест: ${i.join("; ")}`,intersectionError:i=>`Хатои буриш: ${i}`,literalExpected:(i,e)=>`Интизор рафт ${i}, гирифт ${e}`,enumExpected:(i,e)=>`Интизор рафт арзиши enum ${i.join(", ")}, гирифт ${e}`,expectedUndefined:"undefined интизор рафт",neverType:"Ҳеҷ гоҳ мувофиқ намеояд",invalidBigint:"bigint нодуруст аст",invalidSymbol:"Рамз нодуруст аст",invalidTuple:"tuple нодуруст аст",tupleLength:(i,e)=>`Интизор рафт ${i} унсур, гирифт ${e}`,invalidRecord:"Сабт нодуруст аст",invalidSet:"Маҷмӯа нодуруст аст",invalidMap:"Харита нодуруст аст",transformError:i=>`Хатои табдил: ${i}`,refinementError:i=>`Хатои такмил: ${i}`,customValidationError:i=>`Санҷиши фармоӣ: ${i}`,coercionFailed:(i,e)=>`Табдил ба ${i} ноком шуд: ${String(e)}`,codecDecodeFailed:"Рамкушоии кодек ноком шуд",codecEncodeFailed:"Рамкгузории кодек ноком шуд",codecAsyncNotSupported:"Кодеки синхронӣ async-ро дастгирӣ намекунад",invalidBase64:"base64 нодуруст аст",invalidHex:"Гексадесимал нодуруст аст",expectedUint8Array:"Uint8Array интизор рафт",uint8ArrayMinLength:i=>`Uint8Array бояд ҳадди ақал дарозии ${i} дошта бошад`,uint8ArrayMaxLength:i=>`Uint8Array бояд ҳадди аксар дарозии ${i} дошта бошад`,uint8ArrayExactLength:i=>`Uint8Array бояд айнан дарозии ${i} дошта бошад`,expectedString:"Сатр интизор рафт",stringExpected:(i,e)=>`Интизор рафт ${e}, гирифт ${i}`,stringBoolExpected:(i,e)=>`Арзиши сатр-мантиқӣ бояд яке аз ${i} бошад, гирифт ${e}`,invalidJson:"JSON нодуруст аст",stringPatternInvalid:"Қолаби сатр мувофиқ нест",invalidFile:"Файл нодуруст аст",fileNotSupported:"Файл дастгирӣ намешавад",fileMinSize:i=>`Файл бояд ҳадди ақал ${i} байт дошта бошад`,fileMaxSize:i=>`Файл бояд ҳадди аксар ${i} байт дошта бошад`,fileMimeType:i=>`Навъи MIME-и файл бояд яке аз ${i.join(", ")} бошад`,invalidFunction:"Функсия нодуруст аст",stringCidrv4:"IPv4 CIDR нодуруст аст",stringCidrv6:"IPv6 CIDR нодуруст аст",safeExtendOverlap:i=>`safeExtend overlap: ${i.join(", ")}`};export{i as tg};
|
|
@@ -34,6 +34,10 @@ export type JSONSchemaDefinition = {
|
|
|
34
34
|
items?: JSONSchemaDefinition | JSONSchemaDefinition[] | false;
|
|
35
35
|
prefixItems?: JSONSchemaDefinition[];
|
|
36
36
|
contains?: JSONSchemaDefinition;
|
|
37
|
+
minContains?: number;
|
|
38
|
+
maxContains?: number;
|
|
39
|
+
minProperties?: number;
|
|
40
|
+
maxProperties?: number;
|
|
37
41
|
minItems?: number;
|
|
38
42
|
maxItems?: number;
|
|
39
43
|
uniqueItems?: boolean;
|
package/dist/v3/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{$brand,$input,$output,NEVER,TimePrecision,ZodFirstPartyTypeKind,ZodIssueCode,ZodLikeError,_ZodString,_default,_function,any,array,base64,base64Bytes,base64url,bigint,boolean,catch,check,cidrv4,cidrv6,clone,codec,coerce,compile,config,core,createLogger,createNoOpLogger,creditCard,cuid,cuid2,custom,date,decode,decodeAsync,deepPartial,default,describe,disableLogging,discriminatedUnion,e164,email,emoji,enableDebug,encode,encodeAsync,endsWith,enum,exactOptional,file,float32,float64,formatError,fromJSONSchema,_function as function,getDiscriminatedOption,getErrorMap,getLogger,gt,gte,guid,hash,hex,hexBytes,hostname,httpUrl,includes,initLogger,input,instanceof,int,int32,int64,intersection,ipv4,ipv6,iso,json,jwt,keyof,ksuid,lazy,length,literal,locales,looseObject,looseRecord,lowercase,lt,lte,mac,map,mapSchema,maxLength,maxSize,memoizer,meta,mime,minLength,minSize,multipleOf,nan,nanoid,nativeEnum,negative,never,nonnegative,nonoptional,nonpositive,normalize,null,nullable,nullish,number,object,optional,output,overwrite,parse,parseAsync,partialRecord,pipe,positive,prefault,preprocess,promise,properties,property,readonly,record,refine,regex,regexes,safeDecode,safeDecodeAsync,safeEncode,safeEncodeAsync,safeParse,safeParseAsync,set,setErrorMap,setLogLevel,size,slugify,startsWith,strictObject,string,stringFormat,stringbool,superRefine,symbol,templateLiteral,toJSONSchema,toLowerCase,toUpperCase,toZod,toZodError,toZodSafeResult,transform,trim,tuple,uint32,uint64,uint8Array,ulid,undefined,union,unknown,uppercase,url,util,uuid,uuidv4,uuidv6,uuidv7,default as v,vV2,validate,validateAsync,void,xid,xor,z}from"../index.js";export{Err,Ok,ResultUtils,all,failure,flatMap,fromNullable,isErr,isOk,isResult,mapErr,match,success,tryCatch,tryCatchAsync,unwrap,unwrapOr}from"../compat/result.js";export{VldBase,VldMeta,VldBrand as ZodBranded,VldCatch as ZodCatch,VldDefault as ZodDefault,VldExactOptional as ZodExactOptional,VldMeta as ZodMeta,VldRefine as ZodNonOptional,VldNullable as ZodNullable,VldOptional as ZodOptional,VldPipe as ZodPipe,VldPrefault as ZodPrefault,VldPreprocess as ZodPreprocess,VldReadonly as ZodReadonly,VldTransform as ZodTransform,VldBase as ZodType}from"../validators/base.js";export{V as VldError,V as ZodError,V as ZodRealError}from"../chunks/errors-core-BU14-Dk8.js";export{VldIntersection,VldIntersection as ZodIntersection}from"../validators/intersection.js";export{VldAny as ZodAny}from"../validators/any.js";export{VldArray as ZodArray}from"../validators/array.js";export{VldStringFormat as ZodBase64,VldStringFormat as ZodBase64URL,VldStringFormat as ZodCIDRv4,VldStringFormat as ZodCIDRv6,VldStringFormat as ZodCUID,VldStringFormat as ZodCUID2,VldStringFormat as ZodCreditCard,VldStringFormat as ZodCustomStringFormat,VldStringFormat as ZodE164,VldStringFormat as ZodEmail,VldStringFormat as ZodEmoji,VldStringFormat as ZodGUID,VldStringFormat as ZodIPv4,VldStringFormat as ZodIPv6,VldStringFormat as ZodISODate,VldStringFormat as ZodISODateTime,VldStringFormat as ZodISODuration,VldStringFormat as ZodISOTime,VldStringFormat as ZodJWT,VldStringFormat as ZodKSUID,VldStringFormat as ZodMAC,VldStringFormat as ZodNanoID,VldStringFormat as ZodStringFormat,VldStringFormat as ZodULID,VldStringFormat as ZodURL,VldStringFormat as ZodUUID,VldStringFormat as ZodXID}from"../validators/string-formats.js";export{VldBigInt as ZodBigInt,VldBigInt as ZodBigIntFormat}from"../validators/bigint.js";export{VldBoolean as ZodBoolean}from"../validators/boolean.js";export{VldCodec as ZodCodec}from"../validators/codec.js";export{
|
|
1
|
+
export{$brand,$input,$output,NEVER,TimePrecision,ZodFirstPartyTypeKind,ZodIssueCode,ZodLikeError,_ZodString,_default,_function,any,array,base64,base64Bytes,base64url,bigint,boolean,catch,check,cidrv4,cidrv6,clone,codec,coerce,compile,config,core,createLogger,createNoOpLogger,creditCard,cuid,cuid2,currencyCode,custom,date,decode,decodeAsync,deepPartial,default,describe,disableLogging,discriminatedUnion,e164,email,emoji,enableDebug,encode,encodeAsync,endsWith,enum,exactOptional,file,float32,float64,formatError,fromJSONSchema,_function as function,getDiscriminatedOption,getErrorMap,getLogger,gt,gte,guid,hash,hex,hexBytes,hostname,httpUrl,iban,includes,initLogger,input,instanceof,int,int32,int64,intersection,ipv4,ipv6,iso,json,jwt,keyof,ksuid,lazy,length,literal,locales,looseObject,looseRecord,lowercase,lt,lte,mac,map,mapSchema,maxLength,maxSize,memoizer,meta,mime,minLength,minSize,multipleOf,nan,nanoid,nativeEnum,negative,never,nonnegative,nonoptional,nonpositive,normalize,null,nullable,nullish,number,object,optional,output,overwrite,parse,parseAsync,partialRecord,pipe,positive,prefault,preprocess,promise,properties,property,readonly,record,refine,regex,regexes,safeDecode,safeDecodeAsync,safeEncode,safeEncodeAsync,safeParse,safeParseAsync,set,setErrorMap,setLogLevel,size,slugify,startsWith,strictObject,string,stringFormat,stringbool,superRefine,symbol,templateLiteral,toJSONSchema,toLowerCase,toUpperCase,toZod,toZodError,toZodSafeResult,transform,trim,tuple,uint32,uint64,uint8Array,ulid,undefined,union,unknown,uppercase,url,util,uuid,uuidv4,uuidv6,uuidv7,default as v,vV2,validate,validateAsync,void,xid,xor,z}from"../index.js";export{COMPILE_INVALID,COMPILE_INVALID as INVALID,ZodCompileAsyncError,ZodCompileUnsupportedError,withParser,compileFn as zodCompileFn}from"../compile.js";export{Err,Ok,ResultUtils,all,failure,flatMap,fromNullable,isErr,isOk,isResult,mapErr,match,success,tryCatch,tryCatchAsync,unwrap,unwrapOr}from"../compat/result.js";export{VldBase,VldMeta,VldBrand as ZodBranded,VldCatch as ZodCatch,VldDefault as ZodDefault,VldExactOptional as ZodExactOptional,VldMeta as ZodMeta,VldRefine as ZodNonOptional,VldNullable as ZodNullable,VldOptional as ZodOptional,VldPipe as ZodPipe,VldPrefault as ZodPrefault,VldPreprocess as ZodPreprocess,VldReadonly as ZodReadonly,VldTransform as ZodTransform,VldBase as ZodType}from"../validators/base.js";export{V as VldError,V as ZodError,V as ZodRealError}from"../chunks/errors-core-BU14-Dk8.js";export{VldIntersection,VldIntersection as ZodIntersection}from"../validators/intersection.js";export{VldAny as ZodAny}from"../validators/any.js";export{VldArray as ZodArray}from"../validators/array.js";export{VldStringFormat as ZodBase64,VldStringFormat as ZodBase64URL,VldStringFormat as ZodCIDRv4,VldStringFormat as ZodCIDRv6,VldStringFormat as ZodCUID,VldStringFormat as ZodCUID2,VldStringFormat as ZodCreditCard,VldStringFormat as ZodCustomStringFormat,VldStringFormat as ZodE164,VldStringFormat as ZodEmail,VldStringFormat as ZodEmoji,VldStringFormat as ZodGUID,VldStringFormat as ZodIBAN,VldStringFormat as ZodIPv4,VldStringFormat as ZodIPv6,VldStringFormat as ZodISODate,VldStringFormat as ZodISODateTime,VldStringFormat as ZodISODuration,VldStringFormat as ZodISOTime,VldStringFormat as ZodJWT,VldStringFormat as ZodKSUID,VldStringFormat as ZodMAC,VldStringFormat as ZodNanoID,VldStringFormat as ZodStringFormat,VldStringFormat as ZodULID,VldStringFormat as ZodURL,VldStringFormat as ZodUUID,VldStringFormat as ZodXID,isValidIBAN}from"../validators/string-formats.js";export{VldBigInt as ZodBigInt,VldBigInt as ZodBigIntFormat}from"../validators/bigint.js";export{VldBoolean as ZodBoolean}from"../validators/boolean.js";export{VldCodec as ZodCodec}from"../validators/codec.js";export{VldCustom as ZodCustom,VldInstance as ZodInstanceOf,VldCustom as ZodSuccess}from"../validators/custom.js";export{VldDate as ZodDate}from"../validators/date.js";export{VldDiscriminatedUnion as ZodDiscriminatedUnion}from"../validators/discriminated-union.js";export{VldEnum as ZodEnum}from"../validators/enum.js";export{VldFile as ZodFile}from"../validators/file.js";export{VldFunction as ZodFunction}from"../validators/function.js";export{VldJson as ZodJSON}from"../validators/json.js";export{VldLazy as ZodLazy}from"../validators/lazy.js";export{VldLiteral as ZodLiteral}from"../validators/literal.js";export{VldMap as ZodMap}from"../validators/map.js";export{VldNan as ZodNaN}from"../validators/nan.js";export{VldNever as ZodNever}from"../validators/never.js";export{VldNull as ZodNull}from"../validators/null.js";export{VldNumber as ZodNumber,VldNumber as ZodNumberFormat}from"../validators/number.js";export{VldObject as ZodObject}from"../validators/object.js";export{VldPromise as ZodPromise}from"../validators/promise.js";export{VldRecord as ZodRecord}from"../validators/record.js";export{VldSet as ZodSet}from"../validators/set.js";export{VldString as ZodString}from"../validators/string.js";export{VldSymbol as ZodSymbol}from"../validators/symbol.js";export{VldTemplateLiteral as ZodTemplateLiteral}from"../validators/template-literal.js";export{VldTuple as ZodTuple}from"../validators/tuple.js";export{VldUndefined as ZodUndefined}from"../validators/undefined.js";export{VldUnion as ZodUnion}from"../validators/union.js";export{VldUnknown as ZodUnknown}from"../validators/unknown.js";export{VldVoid as ZodVoid}from"../validators/void.js";export{VldXor as ZodXor}from"../validators/xor.js";export{b as base64Json,a as base64ToBytes,c as base64ToUint8Array,d as base64UrlToBytes,e as base64urlToBytes,f as bytesToUtf8,g as epochMillisToDate,h as epochSecondsToDate,i as hexLowerToBytes,j as hexToBytes,k as hexToUint8Array,l as invertCodec,m as isoDatetimeToDate,n as jsonCodec,o as jwtPayload,p as numberToBigInt,s as stringToBigInt,q as stringToBoolean,r as stringToHttpURL,t as stringToInt,u as stringToNumber,v as stringToURL,w as stringToUint8Array,x as uint8ArrayToBase64,y as uint8ArrayToBase64Url,z as uint8ArrayToHex,A as uint8ArrayToString,B as uriComponent,C as utf8ToBytes}from"../chunks/index-CkbfQQ4n.js";export{blue,bold,createTheme,cyan,dim,gray,green,grey,italic,magenta,default as pigment,red,strip,supportsColor,underline,vldTheme,white,yellow}from"../pigment.js";export{createEmitter,createEventBus,withEmitter}from"../compat/emitter.js";export{createVldKernel,definePlugin,getVldKernel,resetVldKernel,usePlugin}from"../kernel.js";export{flattenError,prettifyError,prettifyErrorColored,prettifyErrorPlain,treeifyError}from"../errors.js";export{getLocale,getMessages,getSupportedLocales,isLocaleLoaded,isLocaleSupported,registerLocale,setLocale}from"../locales/runtime.js";export{globalRegistry,registry}from"../registry.js";export{s as setLocaleAsync}from"../chunks/index-Bn85LHAC.js";
|