@oxog/vld 2.2.5 → 2.2.7
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 +26 -0
- package/README.md +242 -1125
- package/dist/chunks/errors-core-CerMg2rq.js +1 -0
- package/dist/cjs/chunks/errors-core-DrydF46s.cjs +1 -0
- package/dist/cjs/cli/bin.cjs +1 -1
- package/dist/cjs/codecs/index.cjs +1 -1
- package/dist/cjs/coercion/index.cjs +1 -1
- package/dist/cjs/errors.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/mini.cjs +1 -1
- 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/mini/index.cjs +1 -1
- package/dist/cjs/v4-mini/index.cjs +1 -1
- package/dist/cjs/validators/any.cjs +1 -1
- package/dist/cjs/validators/array.cjs +1 -1
- package/dist/cjs/validators/base.cjs +1 -1
- package/dist/cjs/validators/base64.cjs +1 -1
- package/dist/cjs/validators/bigint.cjs +1 -1
- package/dist/cjs/validators/boolean.cjs +1 -1
- package/dist/cjs/validators/codec.cjs +1 -1
- package/dist/cjs/validators/custom.cjs +1 -1
- package/dist/cjs/validators/date.cjs +1 -1
- package/dist/cjs/validators/discriminated-union.cjs +1 -1
- package/dist/cjs/validators/enum.cjs +1 -1
- package/dist/cjs/validators/file.cjs +1 -1
- package/dist/cjs/validators/function.cjs +1 -1
- package/dist/cjs/validators/hex.cjs +1 -1
- package/dist/cjs/validators/index.cjs +1 -1
- package/dist/cjs/validators/intersection.cjs +1 -1
- package/dist/cjs/validators/json.cjs +1 -1
- package/dist/cjs/validators/lazy.cjs +1 -1
- package/dist/cjs/validators/literal.cjs +1 -1
- package/dist/cjs/validators/map.cjs +1 -1
- package/dist/cjs/validators/nan.cjs +1 -1
- package/dist/cjs/validators/never.cjs +1 -1
- package/dist/cjs/validators/null.cjs +1 -1
- package/dist/cjs/validators/number.cjs +1 -1
- package/dist/cjs/validators/object.cjs +1 -1
- package/dist/cjs/validators/promise.cjs +1 -1
- package/dist/cjs/validators/record.cjs +1 -1
- package/dist/cjs/validators/set.cjs +1 -1
- package/dist/cjs/validators/string-bool.cjs +1 -1
- package/dist/cjs/validators/string-formats.cjs +1 -1
- package/dist/cjs/validators/string.cjs +1 -1
- package/dist/cjs/validators/symbol.cjs +1 -1
- package/dist/cjs/validators/template-literal.cjs +1 -1
- package/dist/cjs/validators/tuple.cjs +1 -1
- package/dist/cjs/validators/uint8array.cjs +1 -1
- package/dist/cjs/validators/undefined.cjs +1 -1
- package/dist/cjs/validators/union.cjs +1 -1
- package/dist/cjs/validators/unknown.cjs +1 -1
- package/dist/cjs/validators/void.cjs +1 -1
- package/dist/cjs/validators/xor.cjs +1 -1
- package/dist/coercion/index.js +1 -1
- package/dist/errors-core.d.ts +12 -1
- package/dist/errors.js +1 -1
- package/dist/index.d.ts +68 -5
- package/dist/index.js +1 -1
- package/dist/v3/index.js +1 -1
- package/dist/v4/core/index.js +1 -1
- package/dist/v4/index.js +1 -1
- package/dist/v4/mini/index.js +1 -1
- package/dist/v4-mini/index.js +1 -1
- package/dist/validators/array.js +1 -1
- package/dist/validators/base.d.ts +147 -9
- package/dist/validators/base.js +1 -1
- package/dist/validators/base64.js +1 -1
- package/dist/validators/bigint.d.ts +7 -0
- package/dist/validators/bigint.js +1 -1
- package/dist/validators/boolean.js +1 -1
- package/dist/validators/codec.js +1 -1
- package/dist/validators/custom.d.ts +20 -10
- package/dist/validators/custom.js +1 -1
- package/dist/validators/date.d.ts +2 -0
- package/dist/validators/date.js +1 -1
- package/dist/validators/discriminated-union.d.ts +2 -0
- package/dist/validators/discriminated-union.js +1 -1
- package/dist/validators/enum.d.ts +8 -2
- package/dist/validators/enum.js +1 -1
- package/dist/validators/file.js +1 -1
- package/dist/validators/function.js +1 -1
- package/dist/validators/hex.js +1 -1
- package/dist/validators/intersection.js +1 -1
- package/dist/validators/json.js +1 -1
- package/dist/validators/literal.d.ts +1 -0
- package/dist/validators/literal.js +1 -1
- package/dist/validators/map.d.ts +7 -0
- package/dist/validators/map.js +1 -1
- package/dist/validators/nan.js +1 -1
- package/dist/validators/never.js +1 -1
- package/dist/validators/null.js +1 -1
- package/dist/validators/number.d.ts +5 -0
- package/dist/validators/number.js +1 -1
- package/dist/validators/object.d.ts +6 -0
- package/dist/validators/object.js +1 -1
- package/dist/validators/promise.d.ts +6 -7
- package/dist/validators/promise.js +1 -1
- package/dist/validators/record.d.ts +2 -0
- package/dist/validators/record.js +1 -1
- package/dist/validators/set.d.ts +5 -0
- package/dist/validators/set.js +1 -1
- package/dist/validators/string-bool.js +1 -1
- package/dist/validators/string-formats.js +1 -1
- package/dist/validators/string.d.ts +2 -0
- package/dist/validators/string.js +1 -1
- package/dist/validators/symbol.js +1 -1
- package/dist/validators/template-literal.js +1 -1
- package/dist/validators/tuple.js +1 -1
- package/dist/validators/uint8array.js +1 -1
- package/dist/validators/undefined.js +1 -1
- package/dist/validators/union.d.ts +1 -0
- package/dist/validators/union.js +1 -1
- package/dist/validators/void.js +1 -1
- package/dist/validators/xor.js +1 -1
- package/package.json +2 -1
- package/dist/chunks/errors-core-Cqi4-9ew.js +0 -1
- package/dist/cjs/chunks/errors-core-DKPohm9I.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../index.cjs"),r=require("../../errors.cjs"),o=require("../../validators/base.cjs"),t=require("../../validators/string.cjs"),s=require("../../validators/number.cjs"),p=require("../../validators/boolean.cjs"),i=require("../../validators/bigint.cjs"),a=require("../../validators/symbol.cjs"),n=require("../../validators/undefined.cjs"),d=require("../../validators/null.cjs"),l=require("../../validators/any.cjs"),x=require("../../validators/unknown.cjs"),c=require("../../validators/never.cjs"),u=require("../../validators/void.cjs"),m=require("../../validators/date.cjs"),g=require("../../validators/array.cjs"),Z=require("../../validators/object.cjs"),V=require("../../validators/union.cjs"),y=require("../../validators/intersection.cjs"),f=require("../../validators/tuple.cjs"),h=require("../../validators/record.cjs"),v=require("../../validators/map.cjs"),_=require("../../validators/set.cjs"),S=require("../../validators/enum.cjs"),b=require("../../validators/literal.cjs"),j=require("../../validators/file.cjs"),$=require("../../validators/lazy.cjs"),C=require("../../validators/promise.cjs"),T=require("../../validators/custom.cjs"),E=require("../../validators/base64.cjs"),q=require("../../validators/codec.cjs"),F=require("../../validators/discriminated-union.cjs"),L=require("../../validators/function.cjs"),U=require("../../validators/json.cjs"),D=require("../../validators/nan.cjs"),A=require("../../validators/template-literal.cjs"),B=require("../../validators/xor.cjs"),I=require("../../validators/string-formats.cjs"),O=require("../../registry.cjs"),k=require("../../compat/result.cjs"),P=require("../../chunks/errors-core-DKPohm9I.cjs"),N=require("../../chunks/index-ZjHAxYdA.cjs"),w=require("../../pigment.cjs"),R=require("../../compat/emitter.cjs"),z=require("../../kernel.cjs"),M=require("../../locales/runtime.cjs"),J=require("../../chunks/index-BEV9nG0N.cjs");require("../../validators/string-bool.cjs"),require("../../locales/en.cjs"),require("../../validators/hex.cjs"),require("../../validators/uint8array.cjs"),require("../../coercion/index.cjs"),require("../../chunks/ip-validation-BZqPamPC.cjs"),require("../../chunks/security-aXZVI7qW.cjs"),require("../../locales/tr.cjs"),require("../../locales/es.cjs"),require("../../locales/fr.cjs"),require("../../locales/de.cjs"),require("../../locales/it.cjs"),require("../../locales/pt.cjs"),require("../../locales/ru.cjs"),require("../../locales/ja.cjs"),require("../../locales/ko.cjs"),require("../../locales/zh.cjs"),require("../../locales/ar.cjs"),require("../../locales/hi.cjs"),require("../../locales/nl.cjs"),require("../../locales/pl.cjs"),require("../../locales/da.cjs"),require("../../locales/sv.cjs"),require("../../locales/no.cjs"),require("../../locales/fi.cjs"),require("../../locales/th.cjs"),require("../../locales/vi.cjs"),require("../../locales/id.cjs"),require("../../locales/bn.cjs"),require("../../locales/sw.cjs"),require("../../locales/af.cjs"),require("../../locales/pt-BR.cjs"),require("../../locales/es-MX.cjs");const W=e=>"string"==typeof e?e:e?.message||e?.error,K=e=>"function"==typeof e[0]&&e.length>1,X=(e,r=0)=>e[K(e)?r+1:r],G=(e,r=0)=>e[K(e)?r+1:r],H=(e,r=0)=>{const o=G(e,r);return Array.isArray(o)?o:e.slice(r)},Q=e=>()=>{throw new Error(`${e} is an internal Zod core compatibility placeholder`)};class Y extends Error{}class ee extends Error{}class re{}const oe=Z.VldObject;const te=e.parse,se=e.safeParse,pe=e.parseAsync,ie=e.safeParseAsync,ae=e.encode,ne=e.safeEncode,de=e.decode,le=e.safeDecode,xe=e.encodeAsync,ce=e.safeEncodeAsync,ue=e.decodeAsync,me=e.safeDecodeAsync,ge=e.email,Ze=e.guid,Ve=e.uuid,ye=e.uuidv4,fe=e.uuidv6,he=e.uuidv7,ve=e.url,_e=e.emoji,Se=e.nanoid,be=e.cuid,je=e.cuid2,$e=e.ulid,Ce=e.xid,Te=e.ksuid,Ee=e.ipv4,qe=e.ipv6,Fe=e.cidrv4,Le=e.cidrv6,Ue=e.base64,De=e.base64url,Ae=e.e164,Be=e.jwt,Ie=e.iso.dateTime,Oe=e.iso.date,ke=e.iso.time,Pe=e.iso.duration,Ne=e.mac,we=e.mime,Re=e.stringFormat,ze=e.int,Me=e.int32,Je=e.uint32,We=e.int64,Ke=e.uint64,Xe=e.float32,Ge=e.float64,He=e.positive,Qe=e.negative,Ye=e.nonpositive,er=e.nonnegative,rr=e.multipleOf,or=e.minLength,tr=e.maxLength,sr=e.length,pr=e.size,ir=e.minSize,ar=e.maxSize,nr=e.regex,dr=e.startsWith,lr=e.endsWith,xr=e.includes,cr=e.lowercase,ur=e.uppercase,mr=e.trim,gr=e.normalize,Zr=e.slugify,Vr=e.toLowerCase,yr=e.toUpperCase,fr=e.coerce.string,hr=e.coerce.number,vr=e.coerce.boolean,_r=e.coerce.bigint,Sr=e.coerce.date,br=Q("_checkInternal"),jr=Q("$ZodCyclicError"),$r=Q("attachMemoizer"),Cr=Q("isBackEdge");exports.$brand=e.$brand,exports.$input=e.$input,exports.$output=e.$output,exports.NEVER=e.NEVER,exports.TimePrecision=e.TimePrecision,exports.ZodFirstPartyTypeKind=e.ZodFirstPartyTypeKind,exports.ZodIssueCode=e.ZodIssueCode,exports._ZodString=e._ZodString,exports.any=e.any,exports.array=e.array,exports.base64=e.base64,exports.base64Bytes=e.base64Bytes,exports.base64url=e.base64url,exports.bigint=e.bigint,exports.boolean=e.boolean,exports.catch=e.catch,exports.check=e.check,exports.cidrv4=e.cidrv4,exports.cidrv6=e.cidrv6,exports.clone=e.clone,exports.codec=e.codec,exports.coerce=e.coerce,exports.config=e.config,exports.core=e.core,exports.createLogger=e.createLogger,exports.createNoOpLogger=e.createNoOpLogger,exports.creditCard=e.creditCard,exports.cuid=e.cuid,exports.cuid2=e.cuid2,exports.custom=e.custom,exports.date=e.date,exports.decode=e.decode,exports.decodeAsync=e.decodeAsync,exports.deepPartial=e.deepPartial,exports.default=e.core,exports.describe=e.describe,exports.disableLogging=e.disableLogging,exports.discriminatedUnion=e.discriminatedUnion,exports.e164=e.e164,exports.email=e.email,exports.emoji=e.emoji,exports.enableDebug=e.enableDebug,exports.encode=e.encode,exports.encodeAsync=e.encodeAsync,exports.endsWith=e.endsWith,exports.enum=e.enum,exports.exactOptional=e.exactOptional,exports.file=e.file,exports.float32=e.float32,exports.float64=e.float64,exports.formatError=e.formatError,exports.fromJSONSchema=e.fromJSONSchema,exports.function=e._function,exports.getErrorMap=e.getErrorMap,exports.getLogger=e.getLogger,exports.gt=e.gt,exports.gte=e.gte,exports.guid=e.guid,exports.hash=e.hash,exports.hex=e.hex,exports.hexBytes=e.hexBytes,exports.hostname=e.hostname,exports.httpUrl=e.httpUrl,exports.includes=e.includes,exports.initLogger=e.initLogger,exports.input=e.input,exports.instanceof=e.instanceof,exports.int=e.int,exports.int32=e.int32,exports.int64=e.int64,exports.intersection=e.intersection,exports.ipv4=e.ipv4,exports.ipv6=e.ipv6,exports.iso=e.iso,exports.json=e.json,exports.jwt=e.jwt,exports.keyof=e.keyof,exports.ksuid=e.ksuid,exports.lazy=e.lazy,exports.length=e.length,exports.literal=e.literal,exports.locales=e.locales,exports.looseObject=e.looseObject,exports.looseRecord=e.looseRecord,exports.lowercase=e.lowercase,exports.lt=e.lt,exports.lte=e.lte,exports.mac=e.mac,exports.map=e.map,exports.mapSchema=e.mapSchema,exports.maxLength=e.maxLength,exports.maxSize=e.maxSize,exports.meta=e.meta,exports.mime=e.mime,exports.minLength=e.minLength,exports.minSize=e.minSize,exports.multipleOf=e.multipleOf,exports.nan=e.nan,exports.nanoid=e.nanoid,exports.nativeEnum=e.nativeEnum,exports.negative=e.negative,exports.never=e.never,exports.nonnegative=e.nonnegative,exports.nonoptional=e.nonoptional,exports.nonpositive=e.nonpositive,exports.normalize=e.normalize,exports.null=e.null,exports.nullable=e.nullable,exports.nullish=e.nullish,exports.number=e.number,exports.object=e.object,exports.optional=e.optional,exports.output=e.output,exports.overwrite=e.overwrite,exports.parse=e.parse,exports.parseAsync=e.parseAsync,exports.partialRecord=e.partialRecord,exports.pipe=e.pipe,exports.positive=e.positive,exports.prefault=e.prefault,exports.preprocess=e.preprocess,exports.promise=e.promise,exports.property=e.property,exports.readonly=e.readonly,exports.record=e.record,exports.refine=e.refine,exports.regex=e.regex,exports.regexes=e.regexes,exports.safeDecode=e.safeDecode,exports.safeDecodeAsync=e.safeDecodeAsync,exports.safeEncode=e.safeEncode,exports.safeEncodeAsync=e.safeEncodeAsync,exports.safeParse=e.safeParse,exports.safeParseAsync=e.safeParseAsync,exports.set=e.set,exports.setErrorMap=e.setErrorMap,exports.setLogLevel=e.setLogLevel,exports.size=e.size,exports.slugify=e.slugify,exports.startsWith=e.startsWith,exports.strictObject=e.strictObject,exports.string=e.string,exports.stringFormat=e.stringFormat,exports.stringbool=e.stringbool,exports.superRefine=e.superRefine,exports.symbol=e.symbol,exports.templateLiteral=e.templateLiteral,exports.toJSONSchema=e.toJSONSchema,exports.toLowerCase=e.toLowerCase,exports.toUpperCase=e.toUpperCase,exports.transform=e.transform,exports.trim=e.trim,exports.tuple=e.tuple,exports.uint32=e.uint32,exports.uint64=e.uint64,exports.uint8Array=e.uint8Array,exports.ulid=e.ulid,exports.undefined=e.undefined,exports.union=e.union,exports.unknown=e.unknown,exports.uppercase=e.uppercase,exports.url=e.url,exports.util=e.util,exports.uuid=e.uuid,exports.uuidv4=e.uuidv4,exports.uuidv6=e.uuidv6,exports.uuidv7=e.uuidv7,exports.v=e.default,exports.void=e.void,exports.xid=e.xid,exports.xor=e.xor,exports.z=e.z,exports.flattenError=r.flattenError,exports.prettifyError=r.prettifyError,exports.prettifyErrorColored=r.prettifyErrorColored,exports.prettifyErrorPlain=r.prettifyErrorPlain,exports.treeifyError=r.treeifyError,exports.$ZodCatch=o.VldCatch,exports.$ZodDefault=o.VldDefault,exports.$ZodExactOptional=o.VldExactOptional,exports.$ZodNonOptional=o.VldRefine,exports.$ZodNullable=o.VldNullable,exports.$ZodOptional=o.VldOptional,exports.$ZodPipe=o.VldPipe,exports.$ZodPrefault=o.VldPrefault,exports.$ZodPreprocess=o.VldPreprocess,exports.$ZodReadonly=o.VldReadonly,exports.$ZodTransform=o.VldTransform,exports.$ZodType=o.VldBase,exports.VldBase=o.VldBase,exports.VldMeta=o.VldMeta,exports.ZodBranded=o.VldBrand,exports.ZodCatch=o.VldCatch,exports.ZodDefault=o.VldDefault,exports.ZodExactOptional=o.VldExactOptional,exports.ZodMeta=o.VldMeta,exports.ZodNonOptional=o.VldRefine,exports.ZodNullable=o.VldNullable,exports.ZodOptional=o.VldOptional,exports.ZodPipe=o.VldPipe,exports.ZodPrefault=o.VldPrefault,exports.ZodPreprocess=o.VldPreprocess,exports.ZodReadonly=o.VldReadonly,exports.ZodTransform=o.VldTransform,exports.ZodType=o.VldBase,exports.$ZodString=t.VldString,exports.ZodString=t.VldString,exports.$ZodNumber=s.VldNumber,exports.ZodNumber=s.VldNumber,exports.ZodNumberFormat=s.VldNumber,exports.$ZodBoolean=p.VldBoolean,exports.ZodBoolean=p.VldBoolean,exports.$ZodBigInt=i.VldBigInt,exports.ZodBigInt=i.VldBigInt,exports.ZodBigIntFormat=i.VldBigInt,exports.$ZodSymbol=a.VldSymbol,exports.ZodSymbol=a.VldSymbol,exports.$ZodUndefined=n.VldUndefined,exports.ZodUndefined=n.VldUndefined,exports.$ZodNull=d.VldNull,exports.ZodNull=d.VldNull,exports.$ZodAny=l.VldAny,exports.ZodAny=l.VldAny,exports.$ZodUnknown=x.VldUnknown,exports.ZodUnknown=x.VldUnknown,exports.$ZodNever=c.VldNever,exports.ZodNever=c.VldNever,exports.$ZodVoid=u.VldVoid,exports.ZodVoid=u.VldVoid,exports.$ZodDate=m.VldDate,exports.ZodDate=m.VldDate,exports.$ZodArray=g.VldArray,exports.ZodArray=g.VldArray,exports.$ZodObject=Z.VldObject,exports.ZodObject=Z.VldObject,exports.$ZodUnion=V.VldUnion,exports.ZodUnion=V.VldUnion,exports.$ZodIntersection=y.VldIntersection,exports.VldIntersection=y.VldIntersection,exports.ZodIntersection=y.VldIntersection,exports.$ZodTuple=f.VldTuple,exports.ZodTuple=f.VldTuple,exports.$ZodRecord=h.VldRecord,exports.ZodRecord=h.VldRecord,exports.$ZodMap=v.VldMap,exports.ZodMap=v.VldMap,exports.$ZodSet=_.VldSet,exports.ZodSet=_.VldSet,exports.$ZodEnum=S.VldEnum,exports.ZodEnum=S.VldEnum,exports.$ZodLiteral=b.VldLiteral,exports.ZodLiteral=b.VldLiteral,exports.$ZodFile=j.VldFile,exports.ZodFile=j.VldFile,exports.$ZodLazy=$.VldLazy,exports.ZodLazy=$.VldLazy,exports.$ZodPromise=C.VldPromise,exports.ZodPromise=C.VldPromise,exports.$ZodCustom=T.VldCustom,exports.ZodCustom=T.VldCustom,exports.ZodSuccess=T.VldCustom,exports.$ZodBase64=E.VldBase64,exports.$ZodBase64URL=E.VldBase64,exports.$ZodCodec=q.VldCodec,exports.ZodCodec=q.VldCodec,exports.$ZodDiscriminatedUnion=F.VldDiscriminatedUnion,exports.ZodDiscriminatedUnion=F.VldDiscriminatedUnion,exports.$ZodFunction=L.VldFunction,exports.ZodFunction=L.VldFunction,exports.$ZodSuccess=U.VldJson,exports.ZodJSON=U.VldJson,exports.$ZodNaN=D.VldNan,exports.ZodNaN=D.VldNan,exports.$ZodTemplateLiteral=A.VldTemplateLiteral,exports.ZodTemplateLiteral=A.VldTemplateLiteral,exports.$ZodXor=B.VldXor,exports.ZodXor=B.VldXor,exports.$ZodBigIntFormat=I.VldStringFormat,exports.$ZodCIDRv4=I.VldStringFormat,exports.$ZodCIDRv6=I.VldStringFormat,exports.$ZodCUID=I.VldStringFormat,exports.$ZodCUID2=I.VldStringFormat,exports.$ZodCreditCard=I.VldStringFormat,exports.$ZodCustomStringFormat=I.VldStringFormat,exports.$ZodE164=I.VldStringFormat,exports.$ZodEmail=I.VldStringFormat,exports.$ZodEmoji=I.VldStringFormat,exports.$ZodGUID=I.VldStringFormat,exports.$ZodIPv4=I.VldStringFormat,exports.$ZodIPv6=I.VldStringFormat,exports.$ZodISODate=I.VldStringFormat,exports.$ZodISODateTime=I.VldStringFormat,exports.$ZodISODuration=I.VldStringFormat,exports.$ZodISOTime=I.VldStringFormat,exports.$ZodJWT=I.VldStringFormat,exports.$ZodKSUID=I.VldStringFormat,exports.$ZodMAC=I.VldStringFormat,exports.$ZodNanoID=I.VldStringFormat,exports.$ZodNumberFormat=I.VldStringFormat,exports.$ZodStringFormat=I.VldStringFormat,exports.$ZodULID=I.VldStringFormat,exports.$ZodURL=I.VldStringFormat,exports.$ZodUUID=I.VldStringFormat,exports.$ZodXID=I.VldStringFormat,exports.ZodBase64=I.VldStringFormat,exports.ZodBase64URL=I.VldStringFormat,exports.ZodCIDRv4=I.VldStringFormat,exports.ZodCIDRv6=I.VldStringFormat,exports.ZodCUID=I.VldStringFormat,exports.ZodCUID2=I.VldStringFormat,exports.ZodCreditCard=I.VldStringFormat,exports.ZodCustomStringFormat=I.VldStringFormat,exports.ZodE164=I.VldStringFormat,exports.ZodEmail=I.VldStringFormat,exports.ZodEmoji=I.VldStringFormat,exports.ZodGUID=I.VldStringFormat,exports.ZodIPv4=I.VldStringFormat,exports.ZodIPv6=I.VldStringFormat,exports.ZodISODate=I.VldStringFormat,exports.ZodISODateTime=I.VldStringFormat,exports.ZodISODuration=I.VldStringFormat,exports.ZodISOTime=I.VldStringFormat,exports.ZodJWT=I.VldStringFormat,exports.ZodKSUID=I.VldStringFormat,exports.ZodMAC=I.VldStringFormat,exports.ZodNanoID=I.VldStringFormat,exports.ZodStringFormat=I.VldStringFormat,exports.ZodULID=I.VldStringFormat,exports.ZodURL=I.VldStringFormat,exports.ZodUUID=I.VldStringFormat,exports.ZodXID=I.VldStringFormat,exports.isValidCreditCard=I.isValidCreditCard,exports.$ZodRegistry=O.registry,exports.globalRegistry=O.globalRegistry,exports.registry=O.registry,exports.Err=k.Err,exports.Ok=k.Ok,exports.ResultUtils=k.ResultUtils,exports.all=k.all,exports.failure=k.failure,exports.flatMap=k.flatMap,exports.fromNullable=k.fromNullable,exports.isErr=k.isErr,exports.isOk=k.isOk,exports.isResult=k.isResult,exports.mapErr=k.mapErr,exports.match=k.match,exports.success=k.success,exports.tryCatch=k.tryCatch,exports.tryCatchAsync=k.tryCatchAsync,exports.unwrap=k.unwrap,exports.unwrapOr=k.unwrapOr,exports.$ZodError=P.VldError,exports.$ZodRealError=P.VldError,exports.VldError=P.VldError,exports.ZodError=P.VldError,exports.ZodRealError=P.VldError,exports.base64Json=N.base64Json,exports.base64ToBytes=N.base64ToBytes,exports.base64ToUint8Array=N.base64ToUint8Array,exports.base64UrlToBytes=N.base64UrlToBytes,exports.base64urlToBytes=N.base64urlToBytes,exports.bytesToUtf8=N.bytesToUtf8,exports.epochMillisToDate=N.epochMillisToDate,exports.epochSecondsToDate=N.epochSecondsToDate,exports.hexLowerToBytes=N.hexLowerToBytes,exports.hexToBytes=N.hexToBytes,exports.hexToUint8Array=N.hexToUint8Array,exports.invertCodec=N.invertCodec,exports.isoDatetimeToDate=N.isoDatetimeToDate,exports.jsonCodec=N.jsonCodec,exports.jwtPayload=N.jwtPayload,exports.numberToBigInt=N.numberToBigInt,exports.stringToBigInt=N.stringToBigInt,exports.stringToBoolean=N.stringToBoolean,exports.stringToHttpURL=N.stringToHttpURL,exports.stringToInt=N.stringToInt,exports.stringToNumber=N.stringToNumber,exports.stringToURL=N.stringToURL,exports.stringToUint8Array=N.stringToUint8Array,exports.uint8ArrayToBase64=N.uint8ArrayToBase64,exports.uint8ArrayToBase64Url=N.uint8ArrayToBase64Url,exports.uint8ArrayToHex=N.uint8ArrayToHex,exports.uint8ArrayToString=N.uint8ArrayToString,exports.uriComponent=N.uriComponent,exports.utf8ToBytes=N.utf8ToBytes,exports.blue=w.blue,exports.bold=w.bold,exports.createTheme=w.createTheme,exports.cyan=w.cyan,exports.dim=w.dim,exports.gray=w.gray,exports.green=w.green,exports.grey=w.grey,exports.italic=w.italic,exports.magenta=w.magenta,exports.pigment=w.default,exports.red=w.red,exports.strip=w.strip,exports.supportsColor=w.supportsColor,exports.underline=w.underline,exports.vldTheme=w.vldTheme,exports.white=w.white,exports.yellow=w.yellow,exports.createEmitter=R.createEmitter,exports.createEventBus=R.createEventBus,exports.withEmitter=R.withEmitter,exports.createVldKernel=z.createVldKernel,exports.definePlugin=z.definePlugin,exports.getVldKernel=z.getVldKernel,exports.resetVldKernel=z.resetVldKernel,exports.usePlugin=z.usePlugin,exports.getLocale=M.getLocale,exports.getMessages=M.getMessages,exports.getSupportedLocales=M.getSupportedLocales,exports.isLocaleLoaded=M.isLocaleLoaded,exports.isLocaleSupported=M.isLocaleSupported,exports.registerLocale=M.registerLocale,exports.setLocale=M.setLocale,exports.setLocaleAsync=J.setLocaleAsync,exports.$ZodAsyncError=Y,exports.$ZodCheck=re,exports.$ZodCheckBigIntFormat=class extends re{},exports.$ZodCheckEndsWith=class extends re{},exports.$ZodCheckGreaterThan=class extends re{},exports.$ZodCheckIncludes=class extends re{},exports.$ZodCheckLengthEquals=class extends re{},exports.$ZodCheckLessThan=class extends re{},exports.$ZodCheckLowerCase=class extends re{},exports.$ZodCheckMaxLength=class extends re{},exports.$ZodCheckMaxSize=class extends re{},exports.$ZodCheckMimeType=class extends re{},exports.$ZodCheckMinLength=class extends re{},exports.$ZodCheckMinSize=class extends re{},exports.$ZodCheckMultipleOf=class extends re{},exports.$ZodCheckNumberFormat=class extends re{},exports.$ZodCheckOverwrite=class extends re{},exports.$ZodCheckProperty=class extends re{},exports.$ZodCheckRegex=class extends re{},exports.$ZodCheckSizeEquals=class extends re{},exports.$ZodCheckStartsWith=class extends re{},exports.$ZodCheckStringFormat=class extends re{},exports.$ZodCheckUpperCase=class extends re{},exports.$ZodCyclicError=jr,exports.$ZodEncodeError=ee,exports.$ZodObjectJIT=oe,exports.$constructor=(e,r)=>{var o;return(o=class{constructor(e){Object.defineProperty(this,"_zod",{value:{def:e},enumerable:!1}),r?.(this,e)}}).displayName=e,o},exports.Doc=class{},exports.JSONSchema={},exports.JSONSchemaGenerator=class{},exports._any=(...r)=>e.any(),exports._array=(...r)=>e.array(X(r)),exports._base64=Ue,exports._base64url=De,exports._bigint=(...r)=>e.bigint(),exports._boolean=(...r)=>e.boolean(),exports._catch=(...r)=>e.catch(X(r),G(r,1)),exports._check=(...r)=>e.check(G(r)),exports._checkInternal=br,exports._cidrv4=Fe,exports._cidrv6=Le,exports._codec=(...r)=>e.codec(X(r),X(r,1),G(r,2)),exports._coercedBigint=_r,exports._coercedBoolean=vr,exports._coercedDate=Sr,exports._coercedNumber=hr,exports._coercedString=fr,exports._creditCard=(...r)=>e.creditCard(G(r)),exports._cuid=be,exports._cuid2=je,exports._custom=(...r)=>e.custom(G(r)),exports._date=(...r)=>e.date(),exports._decode=de,exports._decodeAsync=ue,exports._default=(...e)=>{const r=X(e),o=G(e,1);return r.default("function"==typeof o?o():o)},exports._discriminatedUnion=(...r)=>e.discriminatedUnion(G(r),...H(r,1)),exports._e164=Ae,exports._email=ge,exports._emoji=_e,exports._encode=ae,exports._encodeAsync=xe,exports._endsWith=lr,exports._enum=(...r)=>{const o=G(r);return Array.isArray(o)?e.enum(...o):e.nativeEnum(o)},exports._file=(...r)=>e.file(),exports._float32=Xe,exports._float64=Ge,exports._function=(...r)=>e._function(),exports._gt=(r,o)=>e.number().gt(r,W(o)),exports._gte=(r,o)=>e.number().gte(r,W(o)),exports._guid=Ze,exports._includes=xr,exports._int=ze,exports._int32=Me,exports._int64=We,exports._intersection=(...r)=>e.intersection(X(r),X(r,1)),exports._ipv4=Ee,exports._ipv6=qe,exports._isoDate=Oe,exports._isoDateTime=Ie,exports._isoDuration=Pe,exports._isoTime=ke,exports._jwt=Be,exports._ksuid=Te,exports._lazy=(...r)=>e.lazy(G(r)),exports._length=sr,exports._literal=(...r)=>e.literal(G(r)),exports._lowercase=cr,exports._lt=(r,o)=>e.number().lt(r,W(o)),exports._lte=(r,o)=>e.number().lte(r,W(o)),exports._mac=Ne,exports._map=(...r)=>e.map(X(r),X(r,1)),exports._max=(r,o)=>e.number().max(r,W(o)),exports._maxLength=tr,exports._maxSize=ar,exports._mime=we,exports._min=(r,o)=>e.number().min(r,W(o)),exports._minLength=or,exports._minSize=ir,exports._multipleOf=rr,exports._nan=(...r)=>e.nan(),exports._nanoid=Se,exports._nativeEnum=(...r)=>e.nativeEnum(G(r)),exports._negative=Qe,exports._never=(...r)=>e.never(),exports._nonnegative=er,exports._nonoptional=(...r)=>e.nonoptional(X(r)),exports._nonpositive=Ye,exports._normalize=gr,exports._null=(...r)=>e.null(),exports._nullable=(...r)=>e.nullable(X(r)),exports._number=(...r)=>e.number(),exports._object=(...r)=>e.object(G(r)),exports._optional=(...r)=>e.optional(X(r)),exports._overwrite=(...r)=>e.overwrite(G(r)),exports._parse=te,exports._parseAsync=pe,exports._pipe=(...r)=>e.pipe(X(r),X(r,1)),exports._positive=He,exports._promise=(...r)=>e.promise(X(r)),exports._property=(...r)=>e.property(G(r),X(r,1),G(r,2)),exports._readonly=(...r)=>e.readonly(X(r)),exports._record=(...r)=>e.record(X(r,K(r)?1:0)),exports._refine=(...r)=>e.refine(G(r),G(r,1)),exports._regex=nr,exports._safeDecode=le,exports._safeDecodeAsync=me,exports._safeEncode=ne,exports._safeEncodeAsync=ce,exports._safeParse=se,exports._safeParseAsync=ie,exports._set=(...r)=>e.set(X(r)),exports._size=pr,exports._slugify=Zr,exports._startsWith=dr,exports._string=(...r)=>e.string(),exports._stringFormat=Re,exports._stringbool=(...r)=>e.stringbool(G(r)),exports._success=(...e)=>k.success(G(e)),exports._superRefine=(...r)=>e.superRefine(X(r),G(r,1)),exports._symbol=(...r)=>e.symbol(),exports._templateLiteral=(...r)=>e.templateLiteral(...H(r)),exports._toLowerCase=Vr,exports._toUpperCase=yr,exports._transform=(...r)=>e.transform(G(r)),exports._trim=mr,exports._tuple=(...r)=>e.tuple(...H(r)),exports._uint32=Je,exports._uint64=Ke,exports._ulid=$e,exports._undefined=(...r)=>e.undefined(),exports._union=(...r)=>e.union(...H(r)),exports._unknown=(...r)=>e.unknown(),exports._uppercase=ur,exports._url=ve,exports._uuid=Ve,exports._uuidv4=ye,exports._uuidv6=fe,exports._uuidv7=he,exports._void=(...r)=>e.void(),exports._xid=Ce,exports._xor=(...r)=>e.xor(...H(r)),exports.attachMemoizer=$r,exports.createStandardJSONSchemaMethod=()=>e.toJSONSchema,exports.createToJSONSchemaMethod=()=>e.toJSONSchema,exports.extractDefs=()=>({}),exports.finalize=e=>e,exports.globalConfig={},exports.handleUnrepresentable=(e,r,o,t,s)=>{const p="function"==typeof r.unrepresentable?r.unrepresentable({zodSchema:e,path:t.path,message:s}):r.unrepresentable;if("any"===p)return!1;if(void 0===p||"throw"===p)throw new Error(s);return Object.assign(o,{...p}),!0},exports.initializeContext=()=>({}),exports.isBackEdge=Cr,exports.isValidBase64=r=>e.base64().safeParse(r).success,exports.isValidBase64URL=r=>e.base64url().safeParse(r).success,exports.isValidJWT=r=>e.jwt().safeParse(r).success,exports.process=e=>e,exports.standardProps=e=>{const r=e;if(r&&"object"==typeof r["~standard"]&&null!==r["~standard"])return r["~standard"];const o=e;if("function"!=typeof o?.safeParse)throw new TypeError("standardProps expects a VLD schema");return{validate:e=>{const r=o.safeParse(e);return r.success?{value:r.data}:{issues:[{message:r.error?.message??"Invalid input"}]}},vendor:"vld",version:1}},exports.toDotPath=e=>e.map(String).join("."),exports.version={major:4,minor:4,patch:3};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../index.cjs"),r=require("../../errors.cjs"),o=require("../../validators/base.cjs"),t=require("../../validators/string.cjs"),s=require("../../validators/number.cjs"),p=require("../../validators/boolean.cjs"),i=require("../../validators/bigint.cjs"),a=require("../../validators/symbol.cjs"),n=require("../../validators/undefined.cjs"),d=require("../../validators/null.cjs"),l=require("../../validators/any.cjs"),x=require("../../validators/unknown.cjs"),c=require("../../validators/never.cjs"),u=require("../../validators/void.cjs"),m=require("../../validators/date.cjs"),g=require("../../validators/array.cjs"),Z=require("../../validators/object.cjs"),V=require("../../validators/union.cjs"),y=require("../../validators/intersection.cjs"),f=require("../../validators/tuple.cjs"),h=require("../../validators/record.cjs"),v=require("../../validators/map.cjs"),_=require("../../validators/set.cjs"),S=require("../../validators/enum.cjs"),b=require("../../validators/literal.cjs"),j=require("../../validators/file.cjs"),$=require("../../validators/lazy.cjs"),C=require("../../validators/promise.cjs"),T=require("../../validators/custom.cjs"),E=require("../../validators/base64.cjs"),q=require("../../validators/codec.cjs"),F=require("../../validators/discriminated-union.cjs"),L=require("../../validators/function.cjs"),U=require("../../validators/json.cjs"),D=require("../../validators/nan.cjs"),A=require("../../validators/template-literal.cjs"),B=require("../../validators/xor.cjs"),I=require("../../validators/string-formats.cjs"),O=require("../../registry.cjs"),k=require("../../compat/result.cjs"),P=require("../../chunks/errors-core-DrydF46s.cjs"),N=require("../../chunks/index-ZjHAxYdA.cjs"),w=require("../../pigment.cjs"),R=require("../../compat/emitter.cjs"),z=require("../../kernel.cjs"),M=require("../../locales/runtime.cjs"),J=require("../../chunks/index-BEV9nG0N.cjs");require("../../validators/string-bool.cjs"),require("../../locales/en.cjs"),require("../../validators/hex.cjs"),require("../../validators/uint8array.cjs"),require("../../coercion/index.cjs"),require("../../chunks/ip-validation-BZqPamPC.cjs"),require("../../chunks/security-aXZVI7qW.cjs"),require("../../locales/tr.cjs"),require("../../locales/es.cjs"),require("../../locales/fr.cjs"),require("../../locales/de.cjs"),require("../../locales/it.cjs"),require("../../locales/pt.cjs"),require("../../locales/ru.cjs"),require("../../locales/ja.cjs"),require("../../locales/ko.cjs"),require("../../locales/zh.cjs"),require("../../locales/ar.cjs"),require("../../locales/hi.cjs"),require("../../locales/nl.cjs"),require("../../locales/pl.cjs"),require("../../locales/da.cjs"),require("../../locales/sv.cjs"),require("../../locales/no.cjs"),require("../../locales/fi.cjs"),require("../../locales/th.cjs"),require("../../locales/vi.cjs"),require("../../locales/id.cjs"),require("../../locales/bn.cjs"),require("../../locales/sw.cjs"),require("../../locales/af.cjs"),require("../../locales/pt-BR.cjs"),require("../../locales/es-MX.cjs");const W=e=>"string"==typeof e?e:e?.message||e?.error,K=e=>"function"==typeof e[0]&&e.length>1,X=(e,r=0)=>e[K(e)?r+1:r],G=(e,r=0)=>e[K(e)?r+1:r],H=(e,r=0)=>{const o=G(e,r);return Array.isArray(o)?o:e.slice(r)},Q=e=>()=>{throw new Error(`${e} is an internal Zod core compatibility placeholder`)};class Y extends Error{}class ee extends Error{}class re{}const oe=Z.VldObject;const te=e.parse,se=e.safeParse,pe=e.parseAsync,ie=e.safeParseAsync,ae=e.encode,ne=e.safeEncode,de=e.decode,le=e.safeDecode,xe=e.encodeAsync,ce=e.safeEncodeAsync,ue=e.decodeAsync,me=e.safeDecodeAsync,ge=e.email,Ze=e.guid,Ve=e.uuid,ye=e.uuidv4,fe=e.uuidv6,he=e.uuidv7,ve=e.url,_e=e.emoji,Se=e.nanoid,be=e.cuid,je=e.cuid2,$e=e.ulid,Ce=e.xid,Te=e.ksuid,Ee=e.ipv4,qe=e.ipv6,Fe=e.cidrv4,Le=e.cidrv6,Ue=e.base64,De=e.base64url,Ae=e.e164,Be=e.jwt,Ie=e.iso.dateTime,Oe=e.iso.date,ke=e.iso.time,Pe=e.iso.duration,Ne=e.mac,we=e.mime,Re=e.stringFormat,ze=e.int,Me=e.int32,Je=e.uint32,We=e.int64,Ke=e.uint64,Xe=e.float32,Ge=e.float64,He=e.positive,Qe=e.negative,Ye=e.nonpositive,er=e.nonnegative,rr=e.multipleOf,or=e.minLength,tr=e.maxLength,sr=e.length,pr=e.size,ir=e.minSize,ar=e.maxSize,nr=e.regex,dr=e.startsWith,lr=e.endsWith,xr=e.includes,cr=e.lowercase,ur=e.uppercase,mr=e.trim,gr=e.normalize,Zr=e.slugify,Vr=e.toLowerCase,yr=e.toUpperCase,fr=e.coerce.string,hr=e.coerce.number,vr=e.coerce.boolean,_r=e.coerce.bigint,Sr=e.coerce.date,br=Q("_checkInternal"),jr=Q("$ZodCyclicError"),$r=Q("attachMemoizer"),Cr=Q("isBackEdge");exports.$brand=e.$brand,exports.$input=e.$input,exports.$output=e.$output,exports.NEVER=e.NEVER,exports.TimePrecision=e.TimePrecision,exports.ZodFirstPartyTypeKind=e.ZodFirstPartyTypeKind,exports.ZodIssueCode=e.ZodIssueCode,exports._ZodString=e._ZodString,exports.any=e.any,exports.array=e.array,exports.base64=e.base64,exports.base64Bytes=e.base64Bytes,exports.base64url=e.base64url,exports.bigint=e.bigint,exports.boolean=e.boolean,exports.catch=e.catch,exports.check=e.check,exports.cidrv4=e.cidrv4,exports.cidrv6=e.cidrv6,exports.clone=e.clone,exports.codec=e.codec,exports.coerce=e.coerce,exports.config=e.config,exports.core=e.core,exports.createLogger=e.createLogger,exports.createNoOpLogger=e.createNoOpLogger,exports.creditCard=e.creditCard,exports.cuid=e.cuid,exports.cuid2=e.cuid2,exports.custom=e.custom,exports.date=e.date,exports.decode=e.decode,exports.decodeAsync=e.decodeAsync,exports.deepPartial=e.deepPartial,exports.default=e.core,exports.describe=e.describe,exports.disableLogging=e.disableLogging,exports.discriminatedUnion=e.discriminatedUnion,exports.e164=e.e164,exports.email=e.email,exports.emoji=e.emoji,exports.enableDebug=e.enableDebug,exports.encode=e.encode,exports.encodeAsync=e.encodeAsync,exports.endsWith=e.endsWith,exports.enum=e.enum,exports.exactOptional=e.exactOptional,exports.file=e.file,exports.float32=e.float32,exports.float64=e.float64,exports.formatError=e.formatError,exports.fromJSONSchema=e.fromJSONSchema,exports.function=e._function,exports.getErrorMap=e.getErrorMap,exports.getLogger=e.getLogger,exports.gt=e.gt,exports.gte=e.gte,exports.guid=e.guid,exports.hash=e.hash,exports.hex=e.hex,exports.hexBytes=e.hexBytes,exports.hostname=e.hostname,exports.httpUrl=e.httpUrl,exports.includes=e.includes,exports.initLogger=e.initLogger,exports.input=e.input,exports.instanceof=e.instanceof,exports.int=e.int,exports.int32=e.int32,exports.int64=e.int64,exports.intersection=e.intersection,exports.ipv4=e.ipv4,exports.ipv6=e.ipv6,exports.iso=e.iso,exports.json=e.json,exports.jwt=e.jwt,exports.keyof=e.keyof,exports.ksuid=e.ksuid,exports.lazy=e.lazy,exports.length=e.length,exports.literal=e.literal,exports.locales=e.locales,exports.looseObject=e.looseObject,exports.looseRecord=e.looseRecord,exports.lowercase=e.lowercase,exports.lt=e.lt,exports.lte=e.lte,exports.mac=e.mac,exports.map=e.map,exports.mapSchema=e.mapSchema,exports.maxLength=e.maxLength,exports.maxSize=e.maxSize,exports.meta=e.meta,exports.mime=e.mime,exports.minLength=e.minLength,exports.minSize=e.minSize,exports.multipleOf=e.multipleOf,exports.nan=e.nan,exports.nanoid=e.nanoid,exports.nativeEnum=e.nativeEnum,exports.negative=e.negative,exports.never=e.never,exports.nonnegative=e.nonnegative,exports.nonoptional=e.nonoptional,exports.nonpositive=e.nonpositive,exports.normalize=e.normalize,exports.null=e.null,exports.nullable=e.nullable,exports.nullish=e.nullish,exports.number=e.number,exports.object=e.object,exports.optional=e.optional,exports.output=e.output,exports.overwrite=e.overwrite,exports.parse=e.parse,exports.parseAsync=e.parseAsync,exports.partialRecord=e.partialRecord,exports.pipe=e.pipe,exports.positive=e.positive,exports.prefault=e.prefault,exports.preprocess=e.preprocess,exports.promise=e.promise,exports.property=e.property,exports.readonly=e.readonly,exports.record=e.record,exports.refine=e.refine,exports.regex=e.regex,exports.regexes=e.regexes,exports.safeDecode=e.safeDecode,exports.safeDecodeAsync=e.safeDecodeAsync,exports.safeEncode=e.safeEncode,exports.safeEncodeAsync=e.safeEncodeAsync,exports.safeParse=e.safeParse,exports.safeParseAsync=e.safeParseAsync,exports.set=e.set,exports.setErrorMap=e.setErrorMap,exports.setLogLevel=e.setLogLevel,exports.size=e.size,exports.slugify=e.slugify,exports.startsWith=e.startsWith,exports.strictObject=e.strictObject,exports.string=e.string,exports.stringFormat=e.stringFormat,exports.stringbool=e.stringbool,exports.superRefine=e.superRefine,exports.symbol=e.symbol,exports.templateLiteral=e.templateLiteral,exports.toJSONSchema=e.toJSONSchema,exports.toLowerCase=e.toLowerCase,exports.toUpperCase=e.toUpperCase,exports.transform=e.transform,exports.trim=e.trim,exports.tuple=e.tuple,exports.uint32=e.uint32,exports.uint64=e.uint64,exports.uint8Array=e.uint8Array,exports.ulid=e.ulid,exports.undefined=e.undefined,exports.union=e.union,exports.unknown=e.unknown,exports.uppercase=e.uppercase,exports.url=e.url,exports.util=e.util,exports.uuid=e.uuid,exports.uuidv4=e.uuidv4,exports.uuidv6=e.uuidv6,exports.uuidv7=e.uuidv7,exports.v=e.default,exports.void=e.void,exports.xid=e.xid,exports.xor=e.xor,exports.z=e.z,exports.flattenError=r.flattenError,exports.prettifyError=r.prettifyError,exports.prettifyErrorColored=r.prettifyErrorColored,exports.prettifyErrorPlain=r.prettifyErrorPlain,exports.treeifyError=r.treeifyError,exports.$ZodCatch=o.VldCatch,exports.$ZodDefault=o.VldDefault,exports.$ZodExactOptional=o.VldExactOptional,exports.$ZodNonOptional=o.VldRefine,exports.$ZodNullable=o.VldNullable,exports.$ZodOptional=o.VldOptional,exports.$ZodPipe=o.VldPipe,exports.$ZodPrefault=o.VldPrefault,exports.$ZodPreprocess=o.VldPreprocess,exports.$ZodReadonly=o.VldReadonly,exports.$ZodTransform=o.VldTransform,exports.$ZodType=o.VldBase,exports.VldBase=o.VldBase,exports.VldMeta=o.VldMeta,exports.ZodBranded=o.VldBrand,exports.ZodCatch=o.VldCatch,exports.ZodDefault=o.VldDefault,exports.ZodExactOptional=o.VldExactOptional,exports.ZodMeta=o.VldMeta,exports.ZodNonOptional=o.VldRefine,exports.ZodNullable=o.VldNullable,exports.ZodOptional=o.VldOptional,exports.ZodPipe=o.VldPipe,exports.ZodPrefault=o.VldPrefault,exports.ZodPreprocess=o.VldPreprocess,exports.ZodReadonly=o.VldReadonly,exports.ZodTransform=o.VldTransform,exports.ZodType=o.VldBase,exports.$ZodString=t.VldString,exports.ZodString=t.VldString,exports.$ZodNumber=s.VldNumber,exports.ZodNumber=s.VldNumber,exports.ZodNumberFormat=s.VldNumber,exports.$ZodBoolean=p.VldBoolean,exports.ZodBoolean=p.VldBoolean,exports.$ZodBigInt=i.VldBigInt,exports.ZodBigInt=i.VldBigInt,exports.ZodBigIntFormat=i.VldBigInt,exports.$ZodSymbol=a.VldSymbol,exports.ZodSymbol=a.VldSymbol,exports.$ZodUndefined=n.VldUndefined,exports.ZodUndefined=n.VldUndefined,exports.$ZodNull=d.VldNull,exports.ZodNull=d.VldNull,exports.$ZodAny=l.VldAny,exports.ZodAny=l.VldAny,exports.$ZodUnknown=x.VldUnknown,exports.ZodUnknown=x.VldUnknown,exports.$ZodNever=c.VldNever,exports.ZodNever=c.VldNever,exports.$ZodVoid=u.VldVoid,exports.ZodVoid=u.VldVoid,exports.$ZodDate=m.VldDate,exports.ZodDate=m.VldDate,exports.$ZodArray=g.VldArray,exports.ZodArray=g.VldArray,exports.$ZodObject=Z.VldObject,exports.ZodObject=Z.VldObject,exports.$ZodUnion=V.VldUnion,exports.ZodUnion=V.VldUnion,exports.$ZodIntersection=y.VldIntersection,exports.VldIntersection=y.VldIntersection,exports.ZodIntersection=y.VldIntersection,exports.$ZodTuple=f.VldTuple,exports.ZodTuple=f.VldTuple,exports.$ZodRecord=h.VldRecord,exports.ZodRecord=h.VldRecord,exports.$ZodMap=v.VldMap,exports.ZodMap=v.VldMap,exports.$ZodSet=_.VldSet,exports.ZodSet=_.VldSet,exports.$ZodEnum=S.VldEnum,exports.ZodEnum=S.VldEnum,exports.$ZodLiteral=b.VldLiteral,exports.ZodLiteral=b.VldLiteral,exports.$ZodFile=j.VldFile,exports.ZodFile=j.VldFile,exports.$ZodLazy=$.VldLazy,exports.ZodLazy=$.VldLazy,exports.$ZodPromise=C.VldPromise,exports.ZodPromise=C.VldPromise,exports.$ZodCustom=T.VldCustom,exports.ZodCustom=T.VldCustom,exports.ZodSuccess=T.VldCustom,exports.$ZodBase64=E.VldBase64,exports.$ZodBase64URL=E.VldBase64,exports.$ZodCodec=q.VldCodec,exports.ZodCodec=q.VldCodec,exports.$ZodDiscriminatedUnion=F.VldDiscriminatedUnion,exports.ZodDiscriminatedUnion=F.VldDiscriminatedUnion,exports.$ZodFunction=L.VldFunction,exports.ZodFunction=L.VldFunction,exports.$ZodSuccess=U.VldJson,exports.ZodJSON=U.VldJson,exports.$ZodNaN=D.VldNan,exports.ZodNaN=D.VldNan,exports.$ZodTemplateLiteral=A.VldTemplateLiteral,exports.ZodTemplateLiteral=A.VldTemplateLiteral,exports.$ZodXor=B.VldXor,exports.ZodXor=B.VldXor,exports.$ZodBigIntFormat=I.VldStringFormat,exports.$ZodCIDRv4=I.VldStringFormat,exports.$ZodCIDRv6=I.VldStringFormat,exports.$ZodCUID=I.VldStringFormat,exports.$ZodCUID2=I.VldStringFormat,exports.$ZodCreditCard=I.VldStringFormat,exports.$ZodCustomStringFormat=I.VldStringFormat,exports.$ZodE164=I.VldStringFormat,exports.$ZodEmail=I.VldStringFormat,exports.$ZodEmoji=I.VldStringFormat,exports.$ZodGUID=I.VldStringFormat,exports.$ZodIPv4=I.VldStringFormat,exports.$ZodIPv6=I.VldStringFormat,exports.$ZodISODate=I.VldStringFormat,exports.$ZodISODateTime=I.VldStringFormat,exports.$ZodISODuration=I.VldStringFormat,exports.$ZodISOTime=I.VldStringFormat,exports.$ZodJWT=I.VldStringFormat,exports.$ZodKSUID=I.VldStringFormat,exports.$ZodMAC=I.VldStringFormat,exports.$ZodNanoID=I.VldStringFormat,exports.$ZodNumberFormat=I.VldStringFormat,exports.$ZodStringFormat=I.VldStringFormat,exports.$ZodULID=I.VldStringFormat,exports.$ZodURL=I.VldStringFormat,exports.$ZodUUID=I.VldStringFormat,exports.$ZodXID=I.VldStringFormat,exports.ZodBase64=I.VldStringFormat,exports.ZodBase64URL=I.VldStringFormat,exports.ZodCIDRv4=I.VldStringFormat,exports.ZodCIDRv6=I.VldStringFormat,exports.ZodCUID=I.VldStringFormat,exports.ZodCUID2=I.VldStringFormat,exports.ZodCreditCard=I.VldStringFormat,exports.ZodCustomStringFormat=I.VldStringFormat,exports.ZodE164=I.VldStringFormat,exports.ZodEmail=I.VldStringFormat,exports.ZodEmoji=I.VldStringFormat,exports.ZodGUID=I.VldStringFormat,exports.ZodIPv4=I.VldStringFormat,exports.ZodIPv6=I.VldStringFormat,exports.ZodISODate=I.VldStringFormat,exports.ZodISODateTime=I.VldStringFormat,exports.ZodISODuration=I.VldStringFormat,exports.ZodISOTime=I.VldStringFormat,exports.ZodJWT=I.VldStringFormat,exports.ZodKSUID=I.VldStringFormat,exports.ZodMAC=I.VldStringFormat,exports.ZodNanoID=I.VldStringFormat,exports.ZodStringFormat=I.VldStringFormat,exports.ZodULID=I.VldStringFormat,exports.ZodURL=I.VldStringFormat,exports.ZodUUID=I.VldStringFormat,exports.ZodXID=I.VldStringFormat,exports.isValidCreditCard=I.isValidCreditCard,exports.$ZodRegistry=O.registry,exports.globalRegistry=O.globalRegistry,exports.registry=O.registry,exports.Err=k.Err,exports.Ok=k.Ok,exports.ResultUtils=k.ResultUtils,exports.all=k.all,exports.failure=k.failure,exports.flatMap=k.flatMap,exports.fromNullable=k.fromNullable,exports.isErr=k.isErr,exports.isOk=k.isOk,exports.isResult=k.isResult,exports.mapErr=k.mapErr,exports.match=k.match,exports.success=k.success,exports.tryCatch=k.tryCatch,exports.tryCatchAsync=k.tryCatchAsync,exports.unwrap=k.unwrap,exports.unwrapOr=k.unwrapOr,exports.$ZodError=P.VldError,exports.$ZodRealError=P.VldError,exports.VldError=P.VldError,exports.ZodError=P.VldError,exports.ZodRealError=P.VldError,exports.base64Json=N.base64Json,exports.base64ToBytes=N.base64ToBytes,exports.base64ToUint8Array=N.base64ToUint8Array,exports.base64UrlToBytes=N.base64UrlToBytes,exports.base64urlToBytes=N.base64urlToBytes,exports.bytesToUtf8=N.bytesToUtf8,exports.epochMillisToDate=N.epochMillisToDate,exports.epochSecondsToDate=N.epochSecondsToDate,exports.hexLowerToBytes=N.hexLowerToBytes,exports.hexToBytes=N.hexToBytes,exports.hexToUint8Array=N.hexToUint8Array,exports.invertCodec=N.invertCodec,exports.isoDatetimeToDate=N.isoDatetimeToDate,exports.jsonCodec=N.jsonCodec,exports.jwtPayload=N.jwtPayload,exports.numberToBigInt=N.numberToBigInt,exports.stringToBigInt=N.stringToBigInt,exports.stringToBoolean=N.stringToBoolean,exports.stringToHttpURL=N.stringToHttpURL,exports.stringToInt=N.stringToInt,exports.stringToNumber=N.stringToNumber,exports.stringToURL=N.stringToURL,exports.stringToUint8Array=N.stringToUint8Array,exports.uint8ArrayToBase64=N.uint8ArrayToBase64,exports.uint8ArrayToBase64Url=N.uint8ArrayToBase64Url,exports.uint8ArrayToHex=N.uint8ArrayToHex,exports.uint8ArrayToString=N.uint8ArrayToString,exports.uriComponent=N.uriComponent,exports.utf8ToBytes=N.utf8ToBytes,exports.blue=w.blue,exports.bold=w.bold,exports.createTheme=w.createTheme,exports.cyan=w.cyan,exports.dim=w.dim,exports.gray=w.gray,exports.green=w.green,exports.grey=w.grey,exports.italic=w.italic,exports.magenta=w.magenta,exports.pigment=w.default,exports.red=w.red,exports.strip=w.strip,exports.supportsColor=w.supportsColor,exports.underline=w.underline,exports.vldTheme=w.vldTheme,exports.white=w.white,exports.yellow=w.yellow,exports.createEmitter=R.createEmitter,exports.createEventBus=R.createEventBus,exports.withEmitter=R.withEmitter,exports.createVldKernel=z.createVldKernel,exports.definePlugin=z.definePlugin,exports.getVldKernel=z.getVldKernel,exports.resetVldKernel=z.resetVldKernel,exports.usePlugin=z.usePlugin,exports.getLocale=M.getLocale,exports.getMessages=M.getMessages,exports.getSupportedLocales=M.getSupportedLocales,exports.isLocaleLoaded=M.isLocaleLoaded,exports.isLocaleSupported=M.isLocaleSupported,exports.registerLocale=M.registerLocale,exports.setLocale=M.setLocale,exports.setLocaleAsync=J.setLocaleAsync,exports.$ZodAsyncError=Y,exports.$ZodCheck=re,exports.$ZodCheckBigIntFormat=class extends re{},exports.$ZodCheckEndsWith=class extends re{},exports.$ZodCheckGreaterThan=class extends re{},exports.$ZodCheckIncludes=class extends re{},exports.$ZodCheckLengthEquals=class extends re{},exports.$ZodCheckLessThan=class extends re{},exports.$ZodCheckLowerCase=class extends re{},exports.$ZodCheckMaxLength=class extends re{},exports.$ZodCheckMaxSize=class extends re{},exports.$ZodCheckMimeType=class extends re{},exports.$ZodCheckMinLength=class extends re{},exports.$ZodCheckMinSize=class extends re{},exports.$ZodCheckMultipleOf=class extends re{},exports.$ZodCheckNumberFormat=class extends re{},exports.$ZodCheckOverwrite=class extends re{},exports.$ZodCheckProperty=class extends re{},exports.$ZodCheckRegex=class extends re{},exports.$ZodCheckSizeEquals=class extends re{},exports.$ZodCheckStartsWith=class extends re{},exports.$ZodCheckStringFormat=class extends re{},exports.$ZodCheckUpperCase=class extends re{},exports.$ZodCyclicError=jr,exports.$ZodEncodeError=ee,exports.$ZodObjectJIT=oe,exports.$constructor=(e,r)=>{var o;return(o=class{constructor(e){Object.defineProperty(this,"_zod",{value:{def:e},enumerable:!1}),r?.(this,e)}}).displayName=e,o},exports.Doc=class{},exports.JSONSchema={},exports.JSONSchemaGenerator=class{},exports._any=(...r)=>e.any(),exports._array=(...r)=>e.array(X(r)),exports._base64=Ue,exports._base64url=De,exports._bigint=(...r)=>e.bigint(),exports._boolean=(...r)=>e.boolean(),exports._catch=(...r)=>e.catch(X(r),G(r,1)),exports._check=(...r)=>e.check(G(r)),exports._checkInternal=br,exports._cidrv4=Fe,exports._cidrv6=Le,exports._codec=(...r)=>e.codec(X(r),X(r,1),G(r,2)),exports._coercedBigint=_r,exports._coercedBoolean=vr,exports._coercedDate=Sr,exports._coercedNumber=hr,exports._coercedString=fr,exports._creditCard=(...r)=>e.creditCard(G(r)),exports._cuid=be,exports._cuid2=je,exports._custom=(...r)=>e.custom(G(r)),exports._date=(...r)=>e.date(),exports._decode=de,exports._decodeAsync=ue,exports._default=(...e)=>{const r=X(e),o=G(e,1);return r.default("function"==typeof o?o():o)},exports._discriminatedUnion=(...r)=>e.discriminatedUnion(G(r),...H(r,1)),exports._e164=Ae,exports._email=ge,exports._emoji=_e,exports._encode=ae,exports._encodeAsync=xe,exports._endsWith=lr,exports._enum=(...r)=>{const o=G(r);return Array.isArray(o)?e.enum(...o):e.nativeEnum(o)},exports._file=(...r)=>e.file(),exports._float32=Xe,exports._float64=Ge,exports._function=(...r)=>e._function(),exports._gt=(r,o)=>e.number().gt(r,W(o)),exports._gte=(r,o)=>e.number().gte(r,W(o)),exports._guid=Ze,exports._includes=xr,exports._int=ze,exports._int32=Me,exports._int64=We,exports._intersection=(...r)=>e.intersection(X(r),X(r,1)),exports._ipv4=Ee,exports._ipv6=qe,exports._isoDate=Oe,exports._isoDateTime=Ie,exports._isoDuration=Pe,exports._isoTime=ke,exports._jwt=Be,exports._ksuid=Te,exports._lazy=(...r)=>e.lazy(G(r)),exports._length=sr,exports._literal=(...r)=>e.literal(G(r)),exports._lowercase=cr,exports._lt=(r,o)=>e.number().lt(r,W(o)),exports._lte=(r,o)=>e.number().lte(r,W(o)),exports._mac=Ne,exports._map=(...r)=>e.map(X(r),X(r,1)),exports._max=(r,o)=>e.number().max(r,W(o)),exports._maxLength=tr,exports._maxSize=ar,exports._mime=we,exports._min=(r,o)=>e.number().min(r,W(o)),exports._minLength=or,exports._minSize=ir,exports._multipleOf=rr,exports._nan=(...r)=>e.nan(),exports._nanoid=Se,exports._nativeEnum=(...r)=>e.nativeEnum(G(r)),exports._negative=Qe,exports._never=(...r)=>e.never(),exports._nonnegative=er,exports._nonoptional=(...r)=>e.nonoptional(X(r)),exports._nonpositive=Ye,exports._normalize=gr,exports._null=(...r)=>e.null(),exports._nullable=(...r)=>e.nullable(X(r)),exports._number=(...r)=>e.number(),exports._object=(...r)=>e.object(G(r)),exports._optional=(...r)=>e.optional(X(r)),exports._overwrite=(...r)=>e.overwrite(G(r)),exports._parse=te,exports._parseAsync=pe,exports._pipe=(...r)=>e.pipe(X(r),X(r,1)),exports._positive=He,exports._promise=(...r)=>e.promise(X(r)),exports._property=(...r)=>e.property(G(r),X(r,1),G(r,2)),exports._readonly=(...r)=>e.readonly(X(r)),exports._record=(...r)=>e.record(X(r,K(r)?1:0)),exports._refine=(...r)=>e.refine(G(r),G(r,1)),exports._regex=nr,exports._safeDecode=le,exports._safeDecodeAsync=me,exports._safeEncode=ne,exports._safeEncodeAsync=ce,exports._safeParse=se,exports._safeParseAsync=ie,exports._set=(...r)=>e.set(X(r)),exports._size=pr,exports._slugify=Zr,exports._startsWith=dr,exports._string=(...r)=>e.string(),exports._stringFormat=Re,exports._stringbool=(...r)=>e.stringbool(G(r)),exports._success=(...e)=>k.success(G(e)),exports._superRefine=(...r)=>e.superRefine(X(r),G(r,1)),exports._symbol=(...r)=>e.symbol(),exports._templateLiteral=(...r)=>e.templateLiteral(...H(r)),exports._toLowerCase=Vr,exports._toUpperCase=yr,exports._transform=(...r)=>e.transform(G(r)),exports._trim=mr,exports._tuple=(...r)=>e.tuple(...H(r)),exports._uint32=Je,exports._uint64=Ke,exports._ulid=$e,exports._undefined=(...r)=>e.undefined(),exports._union=(...r)=>e.union(...H(r)),exports._unknown=(...r)=>e.unknown(),exports._uppercase=ur,exports._url=ve,exports._uuid=Ve,exports._uuidv4=ye,exports._uuidv6=fe,exports._uuidv7=he,exports._void=(...r)=>e.void(),exports._xid=Ce,exports._xor=(...r)=>e.xor(...H(r)),exports.attachMemoizer=$r,exports.createStandardJSONSchemaMethod=()=>e.toJSONSchema,exports.createToJSONSchemaMethod=()=>e.toJSONSchema,exports.extractDefs=()=>({}),exports.finalize=e=>e,exports.globalConfig={},exports.handleUnrepresentable=(e,r,o,t,s)=>{const p="function"==typeof r.unrepresentable?r.unrepresentable({zodSchema:e,path:t.path,message:s}):r.unrepresentable;if("any"===p)return!1;if(void 0===p||"throw"===p)throw new Error(s);return Object.assign(o,{...p}),!0},exports.initializeContext=()=>({}),exports.isBackEdge=Cr,exports.isValidBase64=r=>e.base64().safeParse(r).success,exports.isValidBase64URL=r=>e.base64url().safeParse(r).success,exports.isValidJWT=r=>e.jwt().safeParse(r).success,exports.process=e=>e,exports.standardProps=e=>{const r=e;if(r&&"object"==typeof r["~standard"]&&null!==r["~standard"])return r["~standard"];const o=e;if("function"!=typeof o?.safeParse)throw new TypeError("standardProps expects a VLD schema");return{validate:e=>{const r=o.safeParse(e);return r.success?{value:r.data}:{issues:[{message:r.error?.message??"Invalid input"}]}},vendor:"vld",version:1}},exports.toDotPath=e=>e.map(String).join("."),exports.version={major:4,minor:4,patch:3};
|
package/dist/cjs/v4/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../index.cjs"),r=require("../compat/result.cjs"),o=require("../validators/base.cjs"),t=require("../chunks/errors-core-DKPohm9I.cjs"),s=require("../validators/intersection.cjs"),i=require("../validators/any.cjs"),p=require("../validators/array.cjs"),a=require("../validators/string-formats.cjs"),l=require("../validators/bigint.cjs"),n=require("../validators/boolean.cjs"),x=require("../validators/codec.cjs"),d=require("../validators/custom.cjs"),c=require("../validators/date.cjs"),u=require("../validators/discriminated-union.cjs"),m=require("../validators/enum.cjs"),g=require("../validators/file.cjs"),y=require("../validators/function.cjs"),j=require("../validators/json.cjs"),V=require("../validators/lazy.cjs"),f=require("../validators/literal.cjs"),v=require("../validators/map.cjs"),Z=require("../validators/nan.cjs"),q=require("../validators/never.cjs"),b=require("../validators/null.cjs"),h=require("../validators/number.cjs"),S=require("../validators/object.cjs"),T=require("../validators/promise.cjs"),L=require("../validators/record.cjs"),E=require("../validators/set.cjs"),B=require("../validators/string.cjs"),U=require("../validators/symbol.cjs"),F=require("../validators/template-literal.cjs"),A=require("../validators/tuple.cjs"),C=require("../validators/undefined.cjs"),D=require("../validators/union.cjs"),O=require("../validators/unknown.cjs"),I=require("../validators/void.cjs"),P=require("../validators/xor.cjs"),R=require("../chunks/index-ZjHAxYdA.cjs"),w=require("../pigment.cjs"),N=require("../compat/emitter.cjs"),k=require("../kernel.cjs"),M=require("../errors.cjs"),z=require("../locales/runtime.cjs"),J=require("../registry.cjs"),K=require("../chunks/index-BEV9nG0N.cjs");require("../validators/string-bool.cjs"),require("../locales/en.cjs"),require("../validators/base64.cjs"),require("../validators/hex.cjs"),require("../validators/uint8array.cjs"),require("../coercion/index.cjs"),require("../chunks/ip-validation-BZqPamPC.cjs"),require("../chunks/security-aXZVI7qW.cjs"),require("../locales/tr.cjs"),require("../locales/es.cjs"),require("../locales/fr.cjs"),require("../locales/de.cjs"),require("../locales/it.cjs"),require("../locales/pt.cjs"),require("../locales/ru.cjs"),require("../locales/ja.cjs"),require("../locales/ko.cjs"),require("../locales/zh.cjs"),require("../locales/ar.cjs"),require("../locales/hi.cjs"),require("../locales/nl.cjs"),require("../locales/pl.cjs"),require("../locales/da.cjs"),require("../locales/sv.cjs"),require("../locales/no.cjs"),require("../locales/fi.cjs"),require("../locales/th.cjs"),require("../locales/vi.cjs"),require("../locales/id.cjs"),require("../locales/bn.cjs"),require("../locales/sw.cjs"),require("../locales/af.cjs"),require("../locales/pt-BR.cjs"),require("../locales/es-MX.cjs");exports.$brand=e.$brand,exports.$input=e.$input,exports.$output=e.$output,exports.NEVER=e.NEVER,exports.TimePrecision=e.TimePrecision,exports.ZodFirstPartyTypeKind=e.ZodFirstPartyTypeKind,exports.ZodIssueCode=e.ZodIssueCode,exports._ZodString=e._ZodString,exports._function=e._function,exports.any=e.any,exports.array=e.array,exports.base64=e.base64,exports.base64Bytes=e.base64Bytes,exports.base64url=e.base64url,exports.bigint=e.bigint,exports.boolean=e.boolean,exports.catch=e.catch,exports.check=e.check,exports.cidrv4=e.cidrv4,exports.cidrv6=e.cidrv6,exports.clone=e.clone,exports.codec=e.codec,exports.coerce=e.coerce,exports.config=e.config,exports.core=e.core,exports.createLogger=e.createLogger,exports.createNoOpLogger=e.createNoOpLogger,exports.creditCard=e.creditCard,exports.cuid=e.cuid,exports.cuid2=e.cuid2,exports.custom=e.custom,exports.date=e.date,exports.decode=e.decode,exports.decodeAsync=e.decodeAsync,exports.deepPartial=e.deepPartial,exports.default=e.default,exports.describe=e.describe,exports.disableLogging=e.disableLogging,exports.discriminatedUnion=e.discriminatedUnion,exports.e164=e.e164,exports.email=e.email,exports.emoji=e.emoji,exports.enableDebug=e.enableDebug,exports.encode=e.encode,exports.encodeAsync=e.encodeAsync,exports.endsWith=e.endsWith,exports.enum=e.enum,exports.exactOptional=e.exactOptional,exports.file=e.file,exports.float32=e.float32,exports.float64=e.float64,exports.formatError=e.formatError,exports.fromJSONSchema=e.fromJSONSchema,exports.function=e._function,exports.getErrorMap=e.getErrorMap,exports.getLogger=e.getLogger,exports.gt=e.gt,exports.gte=e.gte,exports.guid=e.guid,exports.hash=e.hash,exports.hex=e.hex,exports.hexBytes=e.hexBytes,exports.hostname=e.hostname,exports.httpUrl=e.httpUrl,exports.includes=e.includes,exports.initLogger=e.initLogger,exports.input=e.input,exports.instanceof=e.instanceof,exports.int=e.int,exports.int32=e.int32,exports.int64=e.int64,exports.intersection=e.intersection,exports.ipv4=e.ipv4,exports.ipv6=e.ipv6,exports.iso=e.iso,exports.json=e.json,exports.jwt=e.jwt,exports.keyof=e.keyof,exports.ksuid=e.ksuid,exports.lazy=e.lazy,exports.length=e.length,exports.literal=e.literal,exports.locales=e.locales,exports.looseObject=e.looseObject,exports.looseRecord=e.looseRecord,exports.lowercase=e.lowercase,exports.lt=e.lt,exports.lte=e.lte,exports.mac=e.mac,exports.map=e.map,exports.mapSchema=e.mapSchema,exports.maxLength=e.maxLength,exports.maxSize=e.maxSize,exports.meta=e.meta,exports.mime=e.mime,exports.minLength=e.minLength,exports.minSize=e.minSize,exports.multipleOf=e.multipleOf,exports.nan=e.nan,exports.nanoid=e.nanoid,exports.nativeEnum=e.nativeEnum,exports.negative=e.negative,exports.never=e.never,exports.nonnegative=e.nonnegative,exports.nonoptional=e.nonoptional,exports.nonpositive=e.nonpositive,exports.normalize=e.normalize,exports.null=e.null,exports.nullable=e.nullable,exports.nullish=e.nullish,exports.number=e.number,exports.object=e.object,exports.optional=e.optional,exports.output=e.output,exports.overwrite=e.overwrite,exports.parse=e.parse,exports.parseAsync=e.parseAsync,exports.partialRecord=e.partialRecord,exports.pipe=e.pipe,exports.positive=e.positive,exports.prefault=e.prefault,exports.preprocess=e.preprocess,exports.promise=e.promise,exports.property=e.property,exports.readonly=e.readonly,exports.record=e.record,exports.refine=e.refine,exports.regex=e.regex,exports.regexes=e.regexes,exports.safeDecode=e.safeDecode,exports.safeDecodeAsync=e.safeDecodeAsync,exports.safeEncode=e.safeEncode,exports.safeEncodeAsync=e.safeEncodeAsync,exports.safeParse=e.safeParse,exports.safeParseAsync=e.safeParseAsync,exports.set=e.set,exports.setErrorMap=e.setErrorMap,exports.setLogLevel=e.setLogLevel,exports.size=e.size,exports.slugify=e.slugify,exports.startsWith=e.startsWith,exports.strictObject=e.strictObject,exports.string=e.string,exports.stringFormat=e.stringFormat,exports.stringbool=e.stringbool,exports.superRefine=e.superRefine,exports.symbol=e.symbol,exports.templateLiteral=e.templateLiteral,exports.toJSONSchema=e.toJSONSchema,exports.toLowerCase=e.toLowerCase,exports.toUpperCase=e.toUpperCase,exports.transform=e.transform,exports.trim=e.trim,exports.tuple=e.tuple,exports.uint32=e.uint32,exports.uint64=e.uint64,exports.uint8Array=e.uint8Array,exports.ulid=e.ulid,exports.undefined=e.undefined,exports.union=e.union,exports.unknown=e.unknown,exports.uppercase=e.uppercase,exports.url=e.url,exports.util=e.util,exports.uuid=e.uuid,exports.uuidv4=e.uuidv4,exports.uuidv6=e.uuidv6,exports.uuidv7=e.uuidv7,exports.v=e.default,exports.void=e.void,exports.xid=e.xid,exports.xor=e.xor,exports.z=e.z,exports.Err=r.Err,exports.Ok=r.Ok,exports.ResultUtils=r.ResultUtils,exports.all=r.all,exports.failure=r.failure,exports.flatMap=r.flatMap,exports.fromNullable=r.fromNullable,exports.isErr=r.isErr,exports.isOk=r.isOk,exports.isResult=r.isResult,exports.mapErr=r.mapErr,exports.match=r.match,exports.success=r.success,exports.tryCatch=r.tryCatch,exports.tryCatchAsync=r.tryCatchAsync,exports.unwrap=r.unwrap,exports.unwrapOr=r.unwrapOr,exports.VldBase=o.VldBase,exports.VldMeta=o.VldMeta,exports.ZodBranded=o.VldBrand,exports.ZodCatch=o.VldCatch,exports.ZodDefault=o.VldDefault,exports.ZodExactOptional=o.VldExactOptional,exports.ZodMeta=o.VldMeta,exports.ZodNonOptional=o.VldRefine,exports.ZodNullable=o.VldNullable,exports.ZodOptional=o.VldOptional,exports.ZodPipe=o.VldPipe,exports.ZodPrefault=o.VldPrefault,exports.ZodPreprocess=o.VldPreprocess,exports.ZodReadonly=o.VldReadonly,exports.ZodTransform=o.VldTransform,exports.ZodType=o.VldBase,exports.VldError=t.VldError,exports.ZodError=t.VldError,exports.ZodRealError=t.VldError,exports.VldIntersection=s.VldIntersection,exports.ZodIntersection=s.VldIntersection,exports.ZodAny=i.VldAny,exports.ZodArray=p.VldArray,exports.ZodBase64=a.VldStringFormat,exports.ZodBase64URL=a.VldStringFormat,exports.ZodCIDRv4=a.VldStringFormat,exports.ZodCIDRv6=a.VldStringFormat,exports.ZodCUID=a.VldStringFormat,exports.ZodCUID2=a.VldStringFormat,exports.ZodCreditCard=a.VldStringFormat,exports.ZodCustomStringFormat=a.VldStringFormat,exports.ZodE164=a.VldStringFormat,exports.ZodEmail=a.VldStringFormat,exports.ZodEmoji=a.VldStringFormat,exports.ZodGUID=a.VldStringFormat,exports.ZodIPv4=a.VldStringFormat,exports.ZodIPv6=a.VldStringFormat,exports.ZodISODate=a.VldStringFormat,exports.ZodISODateTime=a.VldStringFormat,exports.ZodISODuration=a.VldStringFormat,exports.ZodISOTime=a.VldStringFormat,exports.ZodJWT=a.VldStringFormat,exports.ZodKSUID=a.VldStringFormat,exports.ZodMAC=a.VldStringFormat,exports.ZodNanoID=a.VldStringFormat,exports.ZodStringFormat=a.VldStringFormat,exports.ZodULID=a.VldStringFormat,exports.ZodURL=a.VldStringFormat,exports.ZodUUID=a.VldStringFormat,exports.ZodXID=a.VldStringFormat,exports.ZodBigInt=l.VldBigInt,exports.ZodBigIntFormat=l.VldBigInt,exports.ZodBoolean=n.VldBoolean,exports.ZodCodec=x.VldCodec,exports.ZodCustom=d.VldCustom,exports.ZodSuccess=d.VldCustom,exports.ZodDate=c.VldDate,exports.ZodDiscriminatedUnion=u.VldDiscriminatedUnion,exports.ZodEnum=m.VldEnum,exports.ZodFile=g.VldFile,exports.ZodFunction=y.VldFunction,exports.ZodJSON=j.VldJson,exports.ZodLazy=V.VldLazy,exports.ZodLiteral=f.VldLiteral,exports.ZodMap=v.VldMap,exports.ZodNaN=Z.VldNan,exports.ZodNever=q.VldNever,exports.ZodNull=b.VldNull,exports.ZodNumber=h.VldNumber,exports.ZodNumberFormat=h.VldNumber,exports.ZodObject=S.VldObject,exports.ZodPromise=T.VldPromise,exports.ZodRecord=L.VldRecord,exports.ZodSet=E.VldSet,exports.ZodString=B.VldString,exports.ZodSymbol=U.VldSymbol,exports.ZodTemplateLiteral=F.VldTemplateLiteral,exports.ZodTuple=A.VldTuple,exports.ZodUndefined=C.VldUndefined,exports.ZodUnion=D.VldUnion,exports.ZodUnknown=O.VldUnknown,exports.ZodVoid=I.VldVoid,exports.ZodXor=P.VldXor,exports.base64Json=R.base64Json,exports.base64ToBytes=R.base64ToBytes,exports.base64ToUint8Array=R.base64ToUint8Array,exports.base64UrlToBytes=R.base64UrlToBytes,exports.base64urlToBytes=R.base64urlToBytes,exports.bytesToUtf8=R.bytesToUtf8,exports.epochMillisToDate=R.epochMillisToDate,exports.epochSecondsToDate=R.epochSecondsToDate,exports.hexLowerToBytes=R.hexLowerToBytes,exports.hexToBytes=R.hexToBytes,exports.hexToUint8Array=R.hexToUint8Array,exports.invertCodec=R.invertCodec,exports.isoDatetimeToDate=R.isoDatetimeToDate,exports.jsonCodec=R.jsonCodec,exports.jwtPayload=R.jwtPayload,exports.numberToBigInt=R.numberToBigInt,exports.stringToBigInt=R.stringToBigInt,exports.stringToBoolean=R.stringToBoolean,exports.stringToHttpURL=R.stringToHttpURL,exports.stringToInt=R.stringToInt,exports.stringToNumber=R.stringToNumber,exports.stringToURL=R.stringToURL,exports.stringToUint8Array=R.stringToUint8Array,exports.uint8ArrayToBase64=R.uint8ArrayToBase64,exports.uint8ArrayToBase64Url=R.uint8ArrayToBase64Url,exports.uint8ArrayToHex=R.uint8ArrayToHex,exports.uint8ArrayToString=R.uint8ArrayToString,exports.uriComponent=R.uriComponent,exports.utf8ToBytes=R.utf8ToBytes,exports.blue=w.blue,exports.bold=w.bold,exports.createTheme=w.createTheme,exports.cyan=w.cyan,exports.dim=w.dim,exports.gray=w.gray,exports.green=w.green,exports.grey=w.grey,exports.italic=w.italic,exports.magenta=w.magenta,exports.pigment=w.default,exports.red=w.red,exports.strip=w.strip,exports.supportsColor=w.supportsColor,exports.underline=w.underline,exports.vldTheme=w.vldTheme,exports.white=w.white,exports.yellow=w.yellow,exports.createEmitter=N.createEmitter,exports.createEventBus=N.createEventBus,exports.withEmitter=N.withEmitter,exports.createVldKernel=k.createVldKernel,exports.definePlugin=k.definePlugin,exports.getVldKernel=k.getVldKernel,exports.resetVldKernel=k.resetVldKernel,exports.usePlugin=k.usePlugin,exports.flattenError=M.flattenError,exports.prettifyError=M.prettifyError,exports.prettifyErrorColored=M.prettifyErrorColored,exports.prettifyErrorPlain=M.prettifyErrorPlain,exports.treeifyError=M.treeifyError,exports.getLocale=z.getLocale,exports.getMessages=z.getMessages,exports.getSupportedLocales=z.getSupportedLocales,exports.isLocaleLoaded=z.isLocaleLoaded,exports.isLocaleSupported=z.isLocaleSupported,exports.registerLocale=z.registerLocale,exports.setLocale=z.setLocale,exports.globalRegistry=J.globalRegistry,exports.registry=J.registry,exports.setLocaleAsync=K.setLocaleAsync,exports._default=(e,r)=>e.default("function"==typeof r?r():r);
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../index.cjs"),r=require("../compat/result.cjs"),o=require("../validators/base.cjs"),t=require("../chunks/errors-core-DrydF46s.cjs"),s=require("../validators/intersection.cjs"),i=require("../validators/any.cjs"),p=require("../validators/array.cjs"),a=require("../validators/string-formats.cjs"),l=require("../validators/bigint.cjs"),n=require("../validators/boolean.cjs"),x=require("../validators/codec.cjs"),d=require("../validators/custom.cjs"),c=require("../validators/date.cjs"),u=require("../validators/discriminated-union.cjs"),m=require("../validators/enum.cjs"),g=require("../validators/file.cjs"),y=require("../validators/function.cjs"),j=require("../validators/json.cjs"),V=require("../validators/lazy.cjs"),f=require("../validators/literal.cjs"),v=require("../validators/map.cjs"),Z=require("../validators/nan.cjs"),q=require("../validators/never.cjs"),b=require("../validators/null.cjs"),h=require("../validators/number.cjs"),S=require("../validators/object.cjs"),T=require("../validators/promise.cjs"),L=require("../validators/record.cjs"),E=require("../validators/set.cjs"),B=require("../validators/string.cjs"),U=require("../validators/symbol.cjs"),F=require("../validators/template-literal.cjs"),A=require("../validators/tuple.cjs"),C=require("../validators/undefined.cjs"),D=require("../validators/union.cjs"),O=require("../validators/unknown.cjs"),I=require("../validators/void.cjs"),P=require("../validators/xor.cjs"),R=require("../chunks/index-ZjHAxYdA.cjs"),w=require("../pigment.cjs"),N=require("../compat/emitter.cjs"),k=require("../kernel.cjs"),M=require("../errors.cjs"),z=require("../locales/runtime.cjs"),J=require("../registry.cjs"),K=require("../chunks/index-BEV9nG0N.cjs");require("../validators/string-bool.cjs"),require("../locales/en.cjs"),require("../validators/base64.cjs"),require("../validators/hex.cjs"),require("../validators/uint8array.cjs"),require("../coercion/index.cjs"),require("../chunks/ip-validation-BZqPamPC.cjs"),require("../chunks/security-aXZVI7qW.cjs"),require("../locales/tr.cjs"),require("../locales/es.cjs"),require("../locales/fr.cjs"),require("../locales/de.cjs"),require("../locales/it.cjs"),require("../locales/pt.cjs"),require("../locales/ru.cjs"),require("../locales/ja.cjs"),require("../locales/ko.cjs"),require("../locales/zh.cjs"),require("../locales/ar.cjs"),require("../locales/hi.cjs"),require("../locales/nl.cjs"),require("../locales/pl.cjs"),require("../locales/da.cjs"),require("../locales/sv.cjs"),require("../locales/no.cjs"),require("../locales/fi.cjs"),require("../locales/th.cjs"),require("../locales/vi.cjs"),require("../locales/id.cjs"),require("../locales/bn.cjs"),require("../locales/sw.cjs"),require("../locales/af.cjs"),require("../locales/pt-BR.cjs"),require("../locales/es-MX.cjs");exports.$brand=e.$brand,exports.$input=e.$input,exports.$output=e.$output,exports.NEVER=e.NEVER,exports.TimePrecision=e.TimePrecision,exports.ZodFirstPartyTypeKind=e.ZodFirstPartyTypeKind,exports.ZodIssueCode=e.ZodIssueCode,exports._ZodString=e._ZodString,exports._function=e._function,exports.any=e.any,exports.array=e.array,exports.base64=e.base64,exports.base64Bytes=e.base64Bytes,exports.base64url=e.base64url,exports.bigint=e.bigint,exports.boolean=e.boolean,exports.catch=e.catch,exports.check=e.check,exports.cidrv4=e.cidrv4,exports.cidrv6=e.cidrv6,exports.clone=e.clone,exports.codec=e.codec,exports.coerce=e.coerce,exports.config=e.config,exports.core=e.core,exports.createLogger=e.createLogger,exports.createNoOpLogger=e.createNoOpLogger,exports.creditCard=e.creditCard,exports.cuid=e.cuid,exports.cuid2=e.cuid2,exports.custom=e.custom,exports.date=e.date,exports.decode=e.decode,exports.decodeAsync=e.decodeAsync,exports.deepPartial=e.deepPartial,exports.default=e.default,exports.describe=e.describe,exports.disableLogging=e.disableLogging,exports.discriminatedUnion=e.discriminatedUnion,exports.e164=e.e164,exports.email=e.email,exports.emoji=e.emoji,exports.enableDebug=e.enableDebug,exports.encode=e.encode,exports.encodeAsync=e.encodeAsync,exports.endsWith=e.endsWith,exports.enum=e.enum,exports.exactOptional=e.exactOptional,exports.file=e.file,exports.float32=e.float32,exports.float64=e.float64,exports.formatError=e.formatError,exports.fromJSONSchema=e.fromJSONSchema,exports.function=e._function,exports.getErrorMap=e.getErrorMap,exports.getLogger=e.getLogger,exports.gt=e.gt,exports.gte=e.gte,exports.guid=e.guid,exports.hash=e.hash,exports.hex=e.hex,exports.hexBytes=e.hexBytes,exports.hostname=e.hostname,exports.httpUrl=e.httpUrl,exports.includes=e.includes,exports.initLogger=e.initLogger,exports.input=e.input,exports.instanceof=e.instanceof,exports.int=e.int,exports.int32=e.int32,exports.int64=e.int64,exports.intersection=e.intersection,exports.ipv4=e.ipv4,exports.ipv6=e.ipv6,exports.iso=e.iso,exports.json=e.json,exports.jwt=e.jwt,exports.keyof=e.keyof,exports.ksuid=e.ksuid,exports.lazy=e.lazy,exports.length=e.length,exports.literal=e.literal,exports.locales=e.locales,exports.looseObject=e.looseObject,exports.looseRecord=e.looseRecord,exports.lowercase=e.lowercase,exports.lt=e.lt,exports.lte=e.lte,exports.mac=e.mac,exports.map=e.map,exports.mapSchema=e.mapSchema,exports.maxLength=e.maxLength,exports.maxSize=e.maxSize,exports.meta=e.meta,exports.mime=e.mime,exports.minLength=e.minLength,exports.minSize=e.minSize,exports.multipleOf=e.multipleOf,exports.nan=e.nan,exports.nanoid=e.nanoid,exports.nativeEnum=e.nativeEnum,exports.negative=e.negative,exports.never=e.never,exports.nonnegative=e.nonnegative,exports.nonoptional=e.nonoptional,exports.nonpositive=e.nonpositive,exports.normalize=e.normalize,exports.null=e.null,exports.nullable=e.nullable,exports.nullish=e.nullish,exports.number=e.number,exports.object=e.object,exports.optional=e.optional,exports.output=e.output,exports.overwrite=e.overwrite,exports.parse=e.parse,exports.parseAsync=e.parseAsync,exports.partialRecord=e.partialRecord,exports.pipe=e.pipe,exports.positive=e.positive,exports.prefault=e.prefault,exports.preprocess=e.preprocess,exports.promise=e.promise,exports.property=e.property,exports.readonly=e.readonly,exports.record=e.record,exports.refine=e.refine,exports.regex=e.regex,exports.regexes=e.regexes,exports.safeDecode=e.safeDecode,exports.safeDecodeAsync=e.safeDecodeAsync,exports.safeEncode=e.safeEncode,exports.safeEncodeAsync=e.safeEncodeAsync,exports.safeParse=e.safeParse,exports.safeParseAsync=e.safeParseAsync,exports.set=e.set,exports.setErrorMap=e.setErrorMap,exports.setLogLevel=e.setLogLevel,exports.size=e.size,exports.slugify=e.slugify,exports.startsWith=e.startsWith,exports.strictObject=e.strictObject,exports.string=e.string,exports.stringFormat=e.stringFormat,exports.stringbool=e.stringbool,exports.superRefine=e.superRefine,exports.symbol=e.symbol,exports.templateLiteral=e.templateLiteral,exports.toJSONSchema=e.toJSONSchema,exports.toLowerCase=e.toLowerCase,exports.toUpperCase=e.toUpperCase,exports.transform=e.transform,exports.trim=e.trim,exports.tuple=e.tuple,exports.uint32=e.uint32,exports.uint64=e.uint64,exports.uint8Array=e.uint8Array,exports.ulid=e.ulid,exports.undefined=e.undefined,exports.union=e.union,exports.unknown=e.unknown,exports.uppercase=e.uppercase,exports.url=e.url,exports.util=e.util,exports.uuid=e.uuid,exports.uuidv4=e.uuidv4,exports.uuidv6=e.uuidv6,exports.uuidv7=e.uuidv7,exports.v=e.default,exports.void=e.void,exports.xid=e.xid,exports.xor=e.xor,exports.z=e.z,exports.Err=r.Err,exports.Ok=r.Ok,exports.ResultUtils=r.ResultUtils,exports.all=r.all,exports.failure=r.failure,exports.flatMap=r.flatMap,exports.fromNullable=r.fromNullable,exports.isErr=r.isErr,exports.isOk=r.isOk,exports.isResult=r.isResult,exports.mapErr=r.mapErr,exports.match=r.match,exports.success=r.success,exports.tryCatch=r.tryCatch,exports.tryCatchAsync=r.tryCatchAsync,exports.unwrap=r.unwrap,exports.unwrapOr=r.unwrapOr,exports.VldBase=o.VldBase,exports.VldMeta=o.VldMeta,exports.ZodBranded=o.VldBrand,exports.ZodCatch=o.VldCatch,exports.ZodDefault=o.VldDefault,exports.ZodExactOptional=o.VldExactOptional,exports.ZodMeta=o.VldMeta,exports.ZodNonOptional=o.VldRefine,exports.ZodNullable=o.VldNullable,exports.ZodOptional=o.VldOptional,exports.ZodPipe=o.VldPipe,exports.ZodPrefault=o.VldPrefault,exports.ZodPreprocess=o.VldPreprocess,exports.ZodReadonly=o.VldReadonly,exports.ZodTransform=o.VldTransform,exports.ZodType=o.VldBase,exports.VldError=t.VldError,exports.ZodError=t.VldError,exports.ZodRealError=t.VldError,exports.VldIntersection=s.VldIntersection,exports.ZodIntersection=s.VldIntersection,exports.ZodAny=i.VldAny,exports.ZodArray=p.VldArray,exports.ZodBase64=a.VldStringFormat,exports.ZodBase64URL=a.VldStringFormat,exports.ZodCIDRv4=a.VldStringFormat,exports.ZodCIDRv6=a.VldStringFormat,exports.ZodCUID=a.VldStringFormat,exports.ZodCUID2=a.VldStringFormat,exports.ZodCreditCard=a.VldStringFormat,exports.ZodCustomStringFormat=a.VldStringFormat,exports.ZodE164=a.VldStringFormat,exports.ZodEmail=a.VldStringFormat,exports.ZodEmoji=a.VldStringFormat,exports.ZodGUID=a.VldStringFormat,exports.ZodIPv4=a.VldStringFormat,exports.ZodIPv6=a.VldStringFormat,exports.ZodISODate=a.VldStringFormat,exports.ZodISODateTime=a.VldStringFormat,exports.ZodISODuration=a.VldStringFormat,exports.ZodISOTime=a.VldStringFormat,exports.ZodJWT=a.VldStringFormat,exports.ZodKSUID=a.VldStringFormat,exports.ZodMAC=a.VldStringFormat,exports.ZodNanoID=a.VldStringFormat,exports.ZodStringFormat=a.VldStringFormat,exports.ZodULID=a.VldStringFormat,exports.ZodURL=a.VldStringFormat,exports.ZodUUID=a.VldStringFormat,exports.ZodXID=a.VldStringFormat,exports.ZodBigInt=l.VldBigInt,exports.ZodBigIntFormat=l.VldBigInt,exports.ZodBoolean=n.VldBoolean,exports.ZodCodec=x.VldCodec,exports.ZodCustom=d.VldCustom,exports.ZodSuccess=d.VldCustom,exports.ZodDate=c.VldDate,exports.ZodDiscriminatedUnion=u.VldDiscriminatedUnion,exports.ZodEnum=m.VldEnum,exports.ZodFile=g.VldFile,exports.ZodFunction=y.VldFunction,exports.ZodJSON=j.VldJson,exports.ZodLazy=V.VldLazy,exports.ZodLiteral=f.VldLiteral,exports.ZodMap=v.VldMap,exports.ZodNaN=Z.VldNan,exports.ZodNever=q.VldNever,exports.ZodNull=b.VldNull,exports.ZodNumber=h.VldNumber,exports.ZodNumberFormat=h.VldNumber,exports.ZodObject=S.VldObject,exports.ZodPromise=T.VldPromise,exports.ZodRecord=L.VldRecord,exports.ZodSet=E.VldSet,exports.ZodString=B.VldString,exports.ZodSymbol=U.VldSymbol,exports.ZodTemplateLiteral=F.VldTemplateLiteral,exports.ZodTuple=A.VldTuple,exports.ZodUndefined=C.VldUndefined,exports.ZodUnion=D.VldUnion,exports.ZodUnknown=O.VldUnknown,exports.ZodVoid=I.VldVoid,exports.ZodXor=P.VldXor,exports.base64Json=R.base64Json,exports.base64ToBytes=R.base64ToBytes,exports.base64ToUint8Array=R.base64ToUint8Array,exports.base64UrlToBytes=R.base64UrlToBytes,exports.base64urlToBytes=R.base64urlToBytes,exports.bytesToUtf8=R.bytesToUtf8,exports.epochMillisToDate=R.epochMillisToDate,exports.epochSecondsToDate=R.epochSecondsToDate,exports.hexLowerToBytes=R.hexLowerToBytes,exports.hexToBytes=R.hexToBytes,exports.hexToUint8Array=R.hexToUint8Array,exports.invertCodec=R.invertCodec,exports.isoDatetimeToDate=R.isoDatetimeToDate,exports.jsonCodec=R.jsonCodec,exports.jwtPayload=R.jwtPayload,exports.numberToBigInt=R.numberToBigInt,exports.stringToBigInt=R.stringToBigInt,exports.stringToBoolean=R.stringToBoolean,exports.stringToHttpURL=R.stringToHttpURL,exports.stringToInt=R.stringToInt,exports.stringToNumber=R.stringToNumber,exports.stringToURL=R.stringToURL,exports.stringToUint8Array=R.stringToUint8Array,exports.uint8ArrayToBase64=R.uint8ArrayToBase64,exports.uint8ArrayToBase64Url=R.uint8ArrayToBase64Url,exports.uint8ArrayToHex=R.uint8ArrayToHex,exports.uint8ArrayToString=R.uint8ArrayToString,exports.uriComponent=R.uriComponent,exports.utf8ToBytes=R.utf8ToBytes,exports.blue=w.blue,exports.bold=w.bold,exports.createTheme=w.createTheme,exports.cyan=w.cyan,exports.dim=w.dim,exports.gray=w.gray,exports.green=w.green,exports.grey=w.grey,exports.italic=w.italic,exports.magenta=w.magenta,exports.pigment=w.default,exports.red=w.red,exports.strip=w.strip,exports.supportsColor=w.supportsColor,exports.underline=w.underline,exports.vldTheme=w.vldTheme,exports.white=w.white,exports.yellow=w.yellow,exports.createEmitter=N.createEmitter,exports.createEventBus=N.createEventBus,exports.withEmitter=N.withEmitter,exports.createVldKernel=k.createVldKernel,exports.definePlugin=k.definePlugin,exports.getVldKernel=k.getVldKernel,exports.resetVldKernel=k.resetVldKernel,exports.usePlugin=k.usePlugin,exports.flattenError=M.flattenError,exports.prettifyError=M.prettifyError,exports.prettifyErrorColored=M.prettifyErrorColored,exports.prettifyErrorPlain=M.prettifyErrorPlain,exports.treeifyError=M.treeifyError,exports.getLocale=z.getLocale,exports.getMessages=z.getMessages,exports.getSupportedLocales=z.getSupportedLocales,exports.isLocaleLoaded=z.isLocaleLoaded,exports.isLocaleSupported=z.isLocaleSupported,exports.registerLocale=z.registerLocale,exports.setLocale=z.setLocale,exports.globalRegistry=J.globalRegistry,exports.registry=J.registry,exports.setLocaleAsync=K.setLocaleAsync,exports._default=(e,r)=>e.default("function"==typeof r?r():r);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../v4-mini/index.cjs"),r=require("../../index.cjs"),o=require("../../compat/result.cjs"),t=require("../../validators/base.cjs"),s=require("../../chunks/errors-core-DKPohm9I.cjs"),i=require("../../validators/intersection.cjs"),p=require("../../validators/any.cjs"),a=require("../../validators/array.cjs"),n=require("../../validators/string-formats.cjs"),d=require("../../validators/bigint.cjs"),l=require("../../validators/boolean.cjs"),x=require("../../validators/codec.cjs"),c=require("../../validators/custom.cjs"),u=require("../../validators/date.cjs"),m=require("../../validators/discriminated-union.cjs"),g=require("../../validators/enum.cjs"),V=require("../../validators/file.cjs"),Z=require("../../validators/function.cjs"),y=require("../../validators/json.cjs"),j=require("../../validators/lazy.cjs"),S=require("../../validators/literal.cjs"),f=require("../../validators/map.cjs"),v=require("../../validators/nan.cjs"),M=require("../../validators/never.cjs"),b=require("../../validators/null.cjs"),q=require("../../validators/number.cjs"),T=require("../../validators/object.cjs"),F=require("../../validators/promise.cjs"),h=require("../../validators/record.cjs"),L=require("../../validators/set.cjs"),E=require("../../validators/string.cjs"),U=require("../../validators/symbol.cjs"),I=require("../../validators/template-literal.cjs"),B=require("../../validators/tuple.cjs"),C=require("../../validators/undefined.cjs"),D=require("../../validators/union.cjs"),O=require("../../validators/unknown.cjs"),N=require("../../validators/void.cjs"),A=require("../../validators/xor.cjs"),R=require("../../chunks/index-ZjHAxYdA.cjs"),P=require("../../pigment.cjs"),w=require("../../compat/emitter.cjs"),k=require("../../kernel.cjs"),z=require("../../errors.cjs"),J=require("../../locales/runtime.cjs"),K=require("../../registry.cjs"),_=require("../../chunks/index-BEV9nG0N.cjs");require("../../validators/string-bool.cjs"),require("../../locales/en.cjs"),require("../../validators/base64.cjs"),require("../../validators/hex.cjs"),require("../../validators/uint8array.cjs"),require("../../coercion/index.cjs"),require("../../chunks/ip-validation-BZqPamPC.cjs"),require("../../chunks/security-aXZVI7qW.cjs"),require("../../locales/tr.cjs"),require("../../locales/es.cjs"),require("../../locales/fr.cjs"),require("../../locales/de.cjs"),require("../../locales/it.cjs"),require("../../locales/pt.cjs"),require("../../locales/ru.cjs"),require("../../locales/ja.cjs"),require("../../locales/ko.cjs"),require("../../locales/zh.cjs"),require("../../locales/ar.cjs"),require("../../locales/hi.cjs"),require("../../locales/nl.cjs"),require("../../locales/pl.cjs"),require("../../locales/da.cjs"),require("../../locales/sv.cjs"),require("../../locales/no.cjs"),require("../../locales/fi.cjs"),require("../../locales/th.cjs"),require("../../locales/vi.cjs"),require("../../locales/id.cjs"),require("../../locales/bn.cjs"),require("../../locales/sw.cjs"),require("../../locales/af.cjs"),require("../../locales/pt-BR.cjs"),require("../../locales/es-MX.cjs"),exports._default=e._default,exports.catchall=e.catchall,exports.extend=e.extend,exports.maximum=e.maximum,exports.merge=e.merge,exports.minimum=e.minimum,exports.omit=e.omit,exports.partial=e.partial,exports.pick=e.pick,exports.required=e.required,exports.safeExtend=e.safeExtend,exports.$brand=r.$brand,exports.$input=r.$input,exports.$output=r.$output,exports.NEVER=r.NEVER,exports.TimePrecision=r.TimePrecision,exports.ZodFirstPartyTypeKind=r.ZodFirstPartyTypeKind,exports.ZodIssueCode=r.ZodIssueCode,exports._ZodString=r._ZodString,exports._function=r._function,exports.any=r.any,exports.array=r.array,exports.base64=r.base64,exports.base64Bytes=r.base64Bytes,exports.base64url=r.base64url,exports.bigint=r.bigint,exports.boolean=r.boolean,exports.catch=r.catch,exports.check=r.check,exports.cidrv4=r.cidrv4,exports.cidrv6=r.cidrv6,exports.clone=r.clone,exports.codec=r.codec,exports.coerce=r.coerce,exports.config=r.config,exports.core=r.core,exports.createLogger=r.createLogger,exports.createNoOpLogger=r.createNoOpLogger,exports.creditCard=r.creditCard,exports.cuid=r.cuid,exports.cuid2=r.cuid2,exports.custom=r.custom,exports.date=r.date,exports.decode=r.decode,exports.decodeAsync=r.decodeAsync,exports.deepPartial=r.deepPartial,exports.default=r.default,exports.describe=r.describe,exports.disableLogging=r.disableLogging,exports.discriminatedUnion=r.discriminatedUnion,exports.e164=r.e164,exports.email=r.email,exports.emoji=r.emoji,exports.enableDebug=r.enableDebug,exports.encode=r.encode,exports.encodeAsync=r.encodeAsync,exports.endsWith=r.endsWith,exports.enum=r.enum,exports.exactOptional=r.exactOptional,exports.file=r.file,exports.float32=r.float32,exports.float64=r.float64,exports.formatError=r.formatError,exports.fromJSONSchema=r.fromJSONSchema,exports.function=r._function,exports.getErrorMap=r.getErrorMap,exports.getLogger=r.getLogger,exports.gt=r.gt,exports.gte=r.gte,exports.guid=r.guid,exports.hash=r.hash,exports.hex=r.hex,exports.hexBytes=r.hexBytes,exports.hostname=r.hostname,exports.httpUrl=r.httpUrl,exports.includes=r.includes,exports.initLogger=r.initLogger,exports.input=r.input,exports.instanceof=r.instanceof,exports.int=r.int,exports.int32=r.int32,exports.int64=r.int64,exports.intersection=r.intersection,exports.ipv4=r.ipv4,exports.ipv6=r.ipv6,exports.iso=r.iso,exports.json=r.json,exports.jwt=r.jwt,exports.keyof=r.keyof,exports.ksuid=r.ksuid,exports.lazy=r.lazy,exports.length=r.length,exports.literal=r.literal,exports.locales=r.locales,exports.looseObject=r.looseObject,exports.looseRecord=r.looseRecord,exports.lowercase=r.lowercase,exports.lt=r.lt,exports.lte=r.lte,exports.mac=r.mac,exports.map=r.map,exports.mapSchema=r.mapSchema,exports.maxLength=r.maxLength,exports.maxSize=r.maxSize,exports.meta=r.meta,exports.mime=r.mime,exports.minLength=r.minLength,exports.minSize=r.minSize,exports.multipleOf=r.multipleOf,exports.nan=r.nan,exports.nanoid=r.nanoid,exports.nativeEnum=r.nativeEnum,exports.negative=r.negative,exports.never=r.never,exports.nonnegative=r.nonnegative,exports.nonoptional=r.nonoptional,exports.nonpositive=r.nonpositive,exports.normalize=r.normalize,exports.null=r.null,exports.nullable=r.nullable,exports.nullish=r.nullish,exports.number=r.number,exports.object=r.object,exports.optional=r.optional,exports.output=r.output,exports.overwrite=r.overwrite,exports.parse=r.parse,exports.parseAsync=r.parseAsync,exports.partialRecord=r.partialRecord,exports.pipe=r.pipe,exports.positive=r.positive,exports.prefault=r.prefault,exports.preprocess=r.preprocess,exports.promise=r.promise,exports.property=r.property,exports.readonly=r.readonly,exports.record=r.record,exports.refine=r.refine,exports.regex=r.regex,exports.regexes=r.regexes,exports.safeDecode=r.safeDecode,exports.safeDecodeAsync=r.safeDecodeAsync,exports.safeEncode=r.safeEncode,exports.safeEncodeAsync=r.safeEncodeAsync,exports.safeParse=r.safeParse,exports.safeParseAsync=r.safeParseAsync,exports.set=r.set,exports.setErrorMap=r.setErrorMap,exports.setLogLevel=r.setLogLevel,exports.size=r.size,exports.slugify=r.slugify,exports.startsWith=r.startsWith,exports.strictObject=r.strictObject,exports.string=r.string,exports.stringFormat=r.stringFormat,exports.stringbool=r.stringbool,exports.superRefine=r.superRefine,exports.symbol=r.symbol,exports.templateLiteral=r.templateLiteral,exports.toJSONSchema=r.toJSONSchema,exports.toLowerCase=r.toLowerCase,exports.toUpperCase=r.toUpperCase,exports.transform=r.transform,exports.trim=r.trim,exports.tuple=r.tuple,exports.uint32=r.uint32,exports.uint64=r.uint64,exports.uint8Array=r.uint8Array,exports.ulid=r.ulid,exports.undefined=r.undefined,exports.union=r.union,exports.unknown=r.unknown,exports.uppercase=r.uppercase,exports.url=r.url,exports.util=r.util,exports.uuid=r.uuid,exports.uuidv4=r.uuidv4,exports.uuidv6=r.uuidv6,exports.uuidv7=r.uuidv7,exports.v=r.default,exports.void=r.void,exports.xid=r.xid,exports.xor=r.xor,exports.z=r.z,exports.Err=o.Err,exports.Ok=o.Ok,exports.ResultUtils=o.ResultUtils,exports.all=o.all,exports.failure=o.failure,exports.flatMap=o.flatMap,exports.fromNullable=o.fromNullable,exports.isErr=o.isErr,exports.isOk=o.isOk,exports.isResult=o.isResult,exports.mapErr=o.mapErr,exports.match=o.match,exports.success=o.success,exports.tryCatch=o.tryCatch,exports.tryCatchAsync=o.tryCatchAsync,exports.unwrap=o.unwrap,exports.unwrapOr=o.unwrapOr,exports.VldBase=t.VldBase,exports.VldMeta=t.VldMeta,exports.ZodBranded=t.VldBrand,exports.ZodCatch=t.VldCatch,exports.ZodDefault=t.VldDefault,exports.ZodExactOptional=t.VldExactOptional,exports.ZodMeta=t.VldMeta,exports.ZodMiniBrand=t.VldBrand,exports.ZodMiniCatch=t.VldCatch,exports.ZodMiniDefault=t.VldDefault,exports.ZodMiniExactOptional=t.VldExactOptional,exports.ZodMiniNonOptional=t.VldRefine,exports.ZodMiniNullable=t.VldNullable,exports.ZodMiniOptional=t.VldOptional,exports.ZodMiniPipe=t.VldPipe,exports.ZodMiniPrefault=t.VldPrefault,exports.ZodMiniReadonly=t.VldReadonly,exports.ZodMiniTransform=t.VldTransform,exports.ZodMiniType=t.VldBase,exports.ZodNonOptional=t.VldRefine,exports.ZodNullable=t.VldNullable,exports.ZodOptional=t.VldOptional,exports.ZodPipe=t.VldPipe,exports.ZodPrefault=t.VldPrefault,exports.ZodPreprocess=t.VldPreprocess,exports.ZodReadonly=t.VldReadonly,exports.ZodTransform=t.VldTransform,exports.ZodType=t.VldBase,exports.VldError=s.VldError,exports.ZodError=s.VldError,exports.ZodRealError=s.VldError,exports.VldIntersection=i.VldIntersection,exports.ZodIntersection=i.VldIntersection,exports.ZodMiniIntersection=i.VldIntersection,exports.ZodAny=p.VldAny,exports.ZodMiniAny=p.VldAny,exports.ZodArray=a.VldArray,exports.ZodMiniArray=a.VldArray,exports.ZodBase64=n.VldStringFormat,exports.ZodBase64URL=n.VldStringFormat,exports.ZodCIDRv4=n.VldStringFormat,exports.ZodCIDRv6=n.VldStringFormat,exports.ZodCUID=n.VldStringFormat,exports.ZodCUID2=n.VldStringFormat,exports.ZodCreditCard=n.VldStringFormat,exports.ZodCustomStringFormat=n.VldStringFormat,exports.ZodE164=n.VldStringFormat,exports.ZodEmail=n.VldStringFormat,exports.ZodEmoji=n.VldStringFormat,exports.ZodGUID=n.VldStringFormat,exports.ZodIPv4=n.VldStringFormat,exports.ZodIPv6=n.VldStringFormat,exports.ZodISODate=n.VldStringFormat,exports.ZodISODateTime=n.VldStringFormat,exports.ZodISODuration=n.VldStringFormat,exports.ZodISOTime=n.VldStringFormat,exports.ZodJWT=n.VldStringFormat,exports.ZodKSUID=n.VldStringFormat,exports.ZodMAC=n.VldStringFormat,exports.ZodMiniBase64=n.VldStringFormat,exports.ZodMiniBase64URL=n.VldStringFormat,exports.ZodMiniCIDRv4=n.VldStringFormat,exports.ZodMiniCIDRv6=n.VldStringFormat,exports.ZodMiniCUID=n.VldStringFormat,exports.ZodMiniCUID2=n.VldStringFormat,exports.ZodMiniCreditCard=n.VldStringFormat,exports.ZodMiniCustomStringFormat=n.VldStringFormat,exports.ZodMiniE164=n.VldStringFormat,exports.ZodMiniEmail=n.VldStringFormat,exports.ZodMiniEmoji=n.VldStringFormat,exports.ZodMiniGUID=n.VldStringFormat,exports.ZodMiniIPv4=n.VldStringFormat,exports.ZodMiniIPv6=n.VldStringFormat,exports.ZodMiniISODate=n.VldStringFormat,exports.ZodMiniISODateTime=n.VldStringFormat,exports.ZodMiniISODuration=n.VldStringFormat,exports.ZodMiniISOTime=n.VldStringFormat,exports.ZodMiniJWT=n.VldStringFormat,exports.ZodMiniKSUID=n.VldStringFormat,exports.ZodMiniMAC=n.VldStringFormat,exports.ZodMiniNanoID=n.VldStringFormat,exports.ZodMiniStringFormat=n.VldStringFormat,exports.ZodMiniULID=n.VldStringFormat,exports.ZodMiniURL=n.VldStringFormat,exports.ZodMiniUUID=n.VldStringFormat,exports.ZodMiniXID=n.VldStringFormat,exports.ZodNanoID=n.VldStringFormat,exports.ZodStringFormat=n.VldStringFormat,exports.ZodULID=n.VldStringFormat,exports.ZodURL=n.VldStringFormat,exports.ZodUUID=n.VldStringFormat,exports.ZodXID=n.VldStringFormat,exports.ZodBigInt=d.VldBigInt,exports.ZodBigIntFormat=d.VldBigInt,exports.ZodMiniBigInt=d.VldBigInt,exports.ZodMiniBigIntFormat=d.VldBigInt,exports.ZodBoolean=l.VldBoolean,exports.ZodMiniBoolean=l.VldBoolean,exports.ZodCodec=x.VldCodec,exports.ZodMiniCodec=x.VldCodec,exports.ZodCustom=c.VldCustom,exports.ZodMiniCustom=c.VldCustom,exports.ZodMiniSuccess=c.VldCustom,exports.ZodSuccess=c.VldCustom,exports.ZodDate=u.VldDate,exports.ZodMiniDate=u.VldDate,exports.ZodDiscriminatedUnion=m.VldDiscriminatedUnion,exports.ZodMiniDiscriminatedUnion=m.VldDiscriminatedUnion,exports.ZodEnum=g.VldEnum,exports.ZodMiniEnum=g.VldEnum,exports.ZodFile=V.VldFile,exports.ZodMiniFile=V.VldFile,exports.ZodFunction=Z.VldFunction,exports.ZodMiniFunction=Z.VldFunction,exports.ZodJSON=y.VldJson,exports.ZodLazy=j.VldLazy,exports.ZodMiniLazy=j.VldLazy,exports.ZodLiteral=S.VldLiteral,exports.ZodMiniLiteral=S.VldLiteral,exports.ZodMap=f.VldMap,exports.ZodMiniMap=f.VldMap,exports.ZodMiniNaN=v.VldNan,exports.ZodNaN=v.VldNan,exports.ZodMiniNever=M.VldNever,exports.ZodNever=M.VldNever,exports.ZodMiniNull=b.VldNull,exports.ZodNull=b.VldNull,exports.ZodMiniNumber=q.VldNumber,exports.ZodMiniNumberFormat=q.VldNumber,exports.ZodNumber=q.VldNumber,exports.ZodNumberFormat=q.VldNumber,exports.ZodMiniObject=T.VldObject,exports.ZodObject=T.VldObject,exports.ZodMiniPromise=F.VldPromise,exports.ZodPromise=F.VldPromise,exports.ZodMiniRecord=h.VldRecord,exports.ZodRecord=h.VldRecord,exports.ZodMiniSet=L.VldSet,exports.ZodSet=L.VldSet,exports.ZodMiniString=E.VldString,exports.ZodString=E.VldString,exports.ZodMiniSymbol=U.VldSymbol,exports.ZodSymbol=U.VldSymbol,exports.ZodMiniTemplateLiteral=I.VldTemplateLiteral,exports.ZodTemplateLiteral=I.VldTemplateLiteral,exports.ZodMiniTuple=B.VldTuple,exports.ZodTuple=B.VldTuple,exports.ZodMiniUndefined=C.VldUndefined,exports.ZodUndefined=C.VldUndefined,exports.ZodMiniUnion=D.VldUnion,exports.ZodUnion=D.VldUnion,exports.ZodMiniUnknown=O.VldUnknown,exports.ZodUnknown=O.VldUnknown,exports.ZodMiniVoid=N.VldVoid,exports.ZodVoid=N.VldVoid,exports.ZodMiniXor=A.VldXor,exports.ZodXor=A.VldXor,exports.base64Json=R.base64Json,exports.base64ToBytes=R.base64ToBytes,exports.base64ToUint8Array=R.base64ToUint8Array,exports.base64UrlToBytes=R.base64UrlToBytes,exports.base64urlToBytes=R.base64urlToBytes,exports.bytesToUtf8=R.bytesToUtf8,exports.epochMillisToDate=R.epochMillisToDate,exports.epochSecondsToDate=R.epochSecondsToDate,exports.hexLowerToBytes=R.hexLowerToBytes,exports.hexToBytes=R.hexToBytes,exports.hexToUint8Array=R.hexToUint8Array,exports.invertCodec=R.invertCodec,exports.isoDatetimeToDate=R.isoDatetimeToDate,exports.jsonCodec=R.jsonCodec,exports.jwtPayload=R.jwtPayload,exports.numberToBigInt=R.numberToBigInt,exports.stringToBigInt=R.stringToBigInt,exports.stringToBoolean=R.stringToBoolean,exports.stringToHttpURL=R.stringToHttpURL,exports.stringToInt=R.stringToInt,exports.stringToNumber=R.stringToNumber,exports.stringToURL=R.stringToURL,exports.stringToUint8Array=R.stringToUint8Array,exports.uint8ArrayToBase64=R.uint8ArrayToBase64,exports.uint8ArrayToBase64Url=R.uint8ArrayToBase64Url,exports.uint8ArrayToHex=R.uint8ArrayToHex,exports.uint8ArrayToString=R.uint8ArrayToString,exports.uriComponent=R.uriComponent,exports.utf8ToBytes=R.utf8ToBytes,exports.blue=P.blue,exports.bold=P.bold,exports.createTheme=P.createTheme,exports.cyan=P.cyan,exports.dim=P.dim,exports.gray=P.gray,exports.green=P.green,exports.grey=P.grey,exports.italic=P.italic,exports.magenta=P.magenta,exports.pigment=P.default,exports.red=P.red,exports.strip=P.strip,exports.supportsColor=P.supportsColor,exports.underline=P.underline,exports.vldTheme=P.vldTheme,exports.white=P.white,exports.yellow=P.yellow,exports.createEmitter=w.createEmitter,exports.createEventBus=w.createEventBus,exports.withEmitter=w.withEmitter,exports.createVldKernel=k.createVldKernel,exports.definePlugin=k.definePlugin,exports.getVldKernel=k.getVldKernel,exports.resetVldKernel=k.resetVldKernel,exports.usePlugin=k.usePlugin,exports.flattenError=z.flattenError,exports.prettifyError=z.prettifyError,exports.prettifyErrorColored=z.prettifyErrorColored,exports.prettifyErrorPlain=z.prettifyErrorPlain,exports.treeifyError=z.treeifyError,exports.getLocale=J.getLocale,exports.getMessages=J.getMessages,exports.getSupportedLocales=J.getSupportedLocales,exports.isLocaleLoaded=J.isLocaleLoaded,exports.isLocaleSupported=J.isLocaleSupported,exports.registerLocale=J.registerLocale,exports.setLocale=J.setLocale,exports.globalRegistry=K.globalRegistry,exports.registry=K.registry,exports.setLocaleAsync=_.setLocaleAsync;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../v4-mini/index.cjs"),r=require("../../index.cjs"),o=require("../../compat/result.cjs"),t=require("../../validators/base.cjs"),s=require("../../chunks/errors-core-DrydF46s.cjs"),i=require("../../validators/intersection.cjs"),p=require("../../validators/any.cjs"),a=require("../../validators/array.cjs"),n=require("../../validators/string-formats.cjs"),d=require("../../validators/bigint.cjs"),l=require("../../validators/boolean.cjs"),x=require("../../validators/codec.cjs"),c=require("../../validators/custom.cjs"),u=require("../../validators/date.cjs"),m=require("../../validators/discriminated-union.cjs"),g=require("../../validators/enum.cjs"),V=require("../../validators/file.cjs"),Z=require("../../validators/function.cjs"),y=require("../../validators/json.cjs"),j=require("../../validators/lazy.cjs"),S=require("../../validators/literal.cjs"),f=require("../../validators/map.cjs"),v=require("../../validators/nan.cjs"),M=require("../../validators/never.cjs"),b=require("../../validators/null.cjs"),q=require("../../validators/number.cjs"),T=require("../../validators/object.cjs"),F=require("../../validators/promise.cjs"),h=require("../../validators/record.cjs"),L=require("../../validators/set.cjs"),E=require("../../validators/string.cjs"),U=require("../../validators/symbol.cjs"),I=require("../../validators/template-literal.cjs"),B=require("../../validators/tuple.cjs"),C=require("../../validators/undefined.cjs"),D=require("../../validators/union.cjs"),O=require("../../validators/unknown.cjs"),N=require("../../validators/void.cjs"),A=require("../../validators/xor.cjs"),R=require("../../chunks/index-ZjHAxYdA.cjs"),P=require("../../pigment.cjs"),w=require("../../compat/emitter.cjs"),k=require("../../kernel.cjs"),z=require("../../errors.cjs"),J=require("../../locales/runtime.cjs"),K=require("../../registry.cjs"),_=require("../../chunks/index-BEV9nG0N.cjs");require("../../validators/string-bool.cjs"),require("../../locales/en.cjs"),require("../../validators/base64.cjs"),require("../../validators/hex.cjs"),require("../../validators/uint8array.cjs"),require("../../coercion/index.cjs"),require("../../chunks/ip-validation-BZqPamPC.cjs"),require("../../chunks/security-aXZVI7qW.cjs"),require("../../locales/tr.cjs"),require("../../locales/es.cjs"),require("../../locales/fr.cjs"),require("../../locales/de.cjs"),require("../../locales/it.cjs"),require("../../locales/pt.cjs"),require("../../locales/ru.cjs"),require("../../locales/ja.cjs"),require("../../locales/ko.cjs"),require("../../locales/zh.cjs"),require("../../locales/ar.cjs"),require("../../locales/hi.cjs"),require("../../locales/nl.cjs"),require("../../locales/pl.cjs"),require("../../locales/da.cjs"),require("../../locales/sv.cjs"),require("../../locales/no.cjs"),require("../../locales/fi.cjs"),require("../../locales/th.cjs"),require("../../locales/vi.cjs"),require("../../locales/id.cjs"),require("../../locales/bn.cjs"),require("../../locales/sw.cjs"),require("../../locales/af.cjs"),require("../../locales/pt-BR.cjs"),require("../../locales/es-MX.cjs"),exports._default=e._default,exports.catchall=e.catchall,exports.extend=e.extend,exports.maximum=e.maximum,exports.merge=e.merge,exports.minimum=e.minimum,exports.omit=e.omit,exports.partial=e.partial,exports.pick=e.pick,exports.required=e.required,exports.safeExtend=e.safeExtend,exports.$brand=r.$brand,exports.$input=r.$input,exports.$output=r.$output,exports.NEVER=r.NEVER,exports.TimePrecision=r.TimePrecision,exports.ZodFirstPartyTypeKind=r.ZodFirstPartyTypeKind,exports.ZodIssueCode=r.ZodIssueCode,exports._ZodString=r._ZodString,exports._function=r._function,exports.any=r.any,exports.array=r.array,exports.base64=r.base64,exports.base64Bytes=r.base64Bytes,exports.base64url=r.base64url,exports.bigint=r.bigint,exports.boolean=r.boolean,exports.catch=r.catch,exports.check=r.check,exports.cidrv4=r.cidrv4,exports.cidrv6=r.cidrv6,exports.clone=r.clone,exports.codec=r.codec,exports.coerce=r.coerce,exports.config=r.config,exports.core=r.core,exports.createLogger=r.createLogger,exports.createNoOpLogger=r.createNoOpLogger,exports.creditCard=r.creditCard,exports.cuid=r.cuid,exports.cuid2=r.cuid2,exports.custom=r.custom,exports.date=r.date,exports.decode=r.decode,exports.decodeAsync=r.decodeAsync,exports.deepPartial=r.deepPartial,exports.default=r.default,exports.describe=r.describe,exports.disableLogging=r.disableLogging,exports.discriminatedUnion=r.discriminatedUnion,exports.e164=r.e164,exports.email=r.email,exports.emoji=r.emoji,exports.enableDebug=r.enableDebug,exports.encode=r.encode,exports.encodeAsync=r.encodeAsync,exports.endsWith=r.endsWith,exports.enum=r.enum,exports.exactOptional=r.exactOptional,exports.file=r.file,exports.float32=r.float32,exports.float64=r.float64,exports.formatError=r.formatError,exports.fromJSONSchema=r.fromJSONSchema,exports.function=r._function,exports.getErrorMap=r.getErrorMap,exports.getLogger=r.getLogger,exports.gt=r.gt,exports.gte=r.gte,exports.guid=r.guid,exports.hash=r.hash,exports.hex=r.hex,exports.hexBytes=r.hexBytes,exports.hostname=r.hostname,exports.httpUrl=r.httpUrl,exports.includes=r.includes,exports.initLogger=r.initLogger,exports.input=r.input,exports.instanceof=r.instanceof,exports.int=r.int,exports.int32=r.int32,exports.int64=r.int64,exports.intersection=r.intersection,exports.ipv4=r.ipv4,exports.ipv6=r.ipv6,exports.iso=r.iso,exports.json=r.json,exports.jwt=r.jwt,exports.keyof=r.keyof,exports.ksuid=r.ksuid,exports.lazy=r.lazy,exports.length=r.length,exports.literal=r.literal,exports.locales=r.locales,exports.looseObject=r.looseObject,exports.looseRecord=r.looseRecord,exports.lowercase=r.lowercase,exports.lt=r.lt,exports.lte=r.lte,exports.mac=r.mac,exports.map=r.map,exports.mapSchema=r.mapSchema,exports.maxLength=r.maxLength,exports.maxSize=r.maxSize,exports.meta=r.meta,exports.mime=r.mime,exports.minLength=r.minLength,exports.minSize=r.minSize,exports.multipleOf=r.multipleOf,exports.nan=r.nan,exports.nanoid=r.nanoid,exports.nativeEnum=r.nativeEnum,exports.negative=r.negative,exports.never=r.never,exports.nonnegative=r.nonnegative,exports.nonoptional=r.nonoptional,exports.nonpositive=r.nonpositive,exports.normalize=r.normalize,exports.null=r.null,exports.nullable=r.nullable,exports.nullish=r.nullish,exports.number=r.number,exports.object=r.object,exports.optional=r.optional,exports.output=r.output,exports.overwrite=r.overwrite,exports.parse=r.parse,exports.parseAsync=r.parseAsync,exports.partialRecord=r.partialRecord,exports.pipe=r.pipe,exports.positive=r.positive,exports.prefault=r.prefault,exports.preprocess=r.preprocess,exports.promise=r.promise,exports.property=r.property,exports.readonly=r.readonly,exports.record=r.record,exports.refine=r.refine,exports.regex=r.regex,exports.regexes=r.regexes,exports.safeDecode=r.safeDecode,exports.safeDecodeAsync=r.safeDecodeAsync,exports.safeEncode=r.safeEncode,exports.safeEncodeAsync=r.safeEncodeAsync,exports.safeParse=r.safeParse,exports.safeParseAsync=r.safeParseAsync,exports.set=r.set,exports.setErrorMap=r.setErrorMap,exports.setLogLevel=r.setLogLevel,exports.size=r.size,exports.slugify=r.slugify,exports.startsWith=r.startsWith,exports.strictObject=r.strictObject,exports.string=r.string,exports.stringFormat=r.stringFormat,exports.stringbool=r.stringbool,exports.superRefine=r.superRefine,exports.symbol=r.symbol,exports.templateLiteral=r.templateLiteral,exports.toJSONSchema=r.toJSONSchema,exports.toLowerCase=r.toLowerCase,exports.toUpperCase=r.toUpperCase,exports.transform=r.transform,exports.trim=r.trim,exports.tuple=r.tuple,exports.uint32=r.uint32,exports.uint64=r.uint64,exports.uint8Array=r.uint8Array,exports.ulid=r.ulid,exports.undefined=r.undefined,exports.union=r.union,exports.unknown=r.unknown,exports.uppercase=r.uppercase,exports.url=r.url,exports.util=r.util,exports.uuid=r.uuid,exports.uuidv4=r.uuidv4,exports.uuidv6=r.uuidv6,exports.uuidv7=r.uuidv7,exports.v=r.default,exports.void=r.void,exports.xid=r.xid,exports.xor=r.xor,exports.z=r.z,exports.Err=o.Err,exports.Ok=o.Ok,exports.ResultUtils=o.ResultUtils,exports.all=o.all,exports.failure=o.failure,exports.flatMap=o.flatMap,exports.fromNullable=o.fromNullable,exports.isErr=o.isErr,exports.isOk=o.isOk,exports.isResult=o.isResult,exports.mapErr=o.mapErr,exports.match=o.match,exports.success=o.success,exports.tryCatch=o.tryCatch,exports.tryCatchAsync=o.tryCatchAsync,exports.unwrap=o.unwrap,exports.unwrapOr=o.unwrapOr,exports.VldBase=t.VldBase,exports.VldMeta=t.VldMeta,exports.ZodBranded=t.VldBrand,exports.ZodCatch=t.VldCatch,exports.ZodDefault=t.VldDefault,exports.ZodExactOptional=t.VldExactOptional,exports.ZodMeta=t.VldMeta,exports.ZodMiniBrand=t.VldBrand,exports.ZodMiniCatch=t.VldCatch,exports.ZodMiniDefault=t.VldDefault,exports.ZodMiniExactOptional=t.VldExactOptional,exports.ZodMiniNonOptional=t.VldRefine,exports.ZodMiniNullable=t.VldNullable,exports.ZodMiniOptional=t.VldOptional,exports.ZodMiniPipe=t.VldPipe,exports.ZodMiniPrefault=t.VldPrefault,exports.ZodMiniReadonly=t.VldReadonly,exports.ZodMiniTransform=t.VldTransform,exports.ZodMiniType=t.VldBase,exports.ZodNonOptional=t.VldRefine,exports.ZodNullable=t.VldNullable,exports.ZodOptional=t.VldOptional,exports.ZodPipe=t.VldPipe,exports.ZodPrefault=t.VldPrefault,exports.ZodPreprocess=t.VldPreprocess,exports.ZodReadonly=t.VldReadonly,exports.ZodTransform=t.VldTransform,exports.ZodType=t.VldBase,exports.VldError=s.VldError,exports.ZodError=s.VldError,exports.ZodRealError=s.VldError,exports.VldIntersection=i.VldIntersection,exports.ZodIntersection=i.VldIntersection,exports.ZodMiniIntersection=i.VldIntersection,exports.ZodAny=p.VldAny,exports.ZodMiniAny=p.VldAny,exports.ZodArray=a.VldArray,exports.ZodMiniArray=a.VldArray,exports.ZodBase64=n.VldStringFormat,exports.ZodBase64URL=n.VldStringFormat,exports.ZodCIDRv4=n.VldStringFormat,exports.ZodCIDRv6=n.VldStringFormat,exports.ZodCUID=n.VldStringFormat,exports.ZodCUID2=n.VldStringFormat,exports.ZodCreditCard=n.VldStringFormat,exports.ZodCustomStringFormat=n.VldStringFormat,exports.ZodE164=n.VldStringFormat,exports.ZodEmail=n.VldStringFormat,exports.ZodEmoji=n.VldStringFormat,exports.ZodGUID=n.VldStringFormat,exports.ZodIPv4=n.VldStringFormat,exports.ZodIPv6=n.VldStringFormat,exports.ZodISODate=n.VldStringFormat,exports.ZodISODateTime=n.VldStringFormat,exports.ZodISODuration=n.VldStringFormat,exports.ZodISOTime=n.VldStringFormat,exports.ZodJWT=n.VldStringFormat,exports.ZodKSUID=n.VldStringFormat,exports.ZodMAC=n.VldStringFormat,exports.ZodMiniBase64=n.VldStringFormat,exports.ZodMiniBase64URL=n.VldStringFormat,exports.ZodMiniCIDRv4=n.VldStringFormat,exports.ZodMiniCIDRv6=n.VldStringFormat,exports.ZodMiniCUID=n.VldStringFormat,exports.ZodMiniCUID2=n.VldStringFormat,exports.ZodMiniCreditCard=n.VldStringFormat,exports.ZodMiniCustomStringFormat=n.VldStringFormat,exports.ZodMiniE164=n.VldStringFormat,exports.ZodMiniEmail=n.VldStringFormat,exports.ZodMiniEmoji=n.VldStringFormat,exports.ZodMiniGUID=n.VldStringFormat,exports.ZodMiniIPv4=n.VldStringFormat,exports.ZodMiniIPv6=n.VldStringFormat,exports.ZodMiniISODate=n.VldStringFormat,exports.ZodMiniISODateTime=n.VldStringFormat,exports.ZodMiniISODuration=n.VldStringFormat,exports.ZodMiniISOTime=n.VldStringFormat,exports.ZodMiniJWT=n.VldStringFormat,exports.ZodMiniKSUID=n.VldStringFormat,exports.ZodMiniMAC=n.VldStringFormat,exports.ZodMiniNanoID=n.VldStringFormat,exports.ZodMiniStringFormat=n.VldStringFormat,exports.ZodMiniULID=n.VldStringFormat,exports.ZodMiniURL=n.VldStringFormat,exports.ZodMiniUUID=n.VldStringFormat,exports.ZodMiniXID=n.VldStringFormat,exports.ZodNanoID=n.VldStringFormat,exports.ZodStringFormat=n.VldStringFormat,exports.ZodULID=n.VldStringFormat,exports.ZodURL=n.VldStringFormat,exports.ZodUUID=n.VldStringFormat,exports.ZodXID=n.VldStringFormat,exports.ZodBigInt=d.VldBigInt,exports.ZodBigIntFormat=d.VldBigInt,exports.ZodMiniBigInt=d.VldBigInt,exports.ZodMiniBigIntFormat=d.VldBigInt,exports.ZodBoolean=l.VldBoolean,exports.ZodMiniBoolean=l.VldBoolean,exports.ZodCodec=x.VldCodec,exports.ZodMiniCodec=x.VldCodec,exports.ZodCustom=c.VldCustom,exports.ZodMiniCustom=c.VldCustom,exports.ZodMiniSuccess=c.VldCustom,exports.ZodSuccess=c.VldCustom,exports.ZodDate=u.VldDate,exports.ZodMiniDate=u.VldDate,exports.ZodDiscriminatedUnion=m.VldDiscriminatedUnion,exports.ZodMiniDiscriminatedUnion=m.VldDiscriminatedUnion,exports.ZodEnum=g.VldEnum,exports.ZodMiniEnum=g.VldEnum,exports.ZodFile=V.VldFile,exports.ZodMiniFile=V.VldFile,exports.ZodFunction=Z.VldFunction,exports.ZodMiniFunction=Z.VldFunction,exports.ZodJSON=y.VldJson,exports.ZodLazy=j.VldLazy,exports.ZodMiniLazy=j.VldLazy,exports.ZodLiteral=S.VldLiteral,exports.ZodMiniLiteral=S.VldLiteral,exports.ZodMap=f.VldMap,exports.ZodMiniMap=f.VldMap,exports.ZodMiniNaN=v.VldNan,exports.ZodNaN=v.VldNan,exports.ZodMiniNever=M.VldNever,exports.ZodNever=M.VldNever,exports.ZodMiniNull=b.VldNull,exports.ZodNull=b.VldNull,exports.ZodMiniNumber=q.VldNumber,exports.ZodMiniNumberFormat=q.VldNumber,exports.ZodNumber=q.VldNumber,exports.ZodNumberFormat=q.VldNumber,exports.ZodMiniObject=T.VldObject,exports.ZodObject=T.VldObject,exports.ZodMiniPromise=F.VldPromise,exports.ZodPromise=F.VldPromise,exports.ZodMiniRecord=h.VldRecord,exports.ZodRecord=h.VldRecord,exports.ZodMiniSet=L.VldSet,exports.ZodSet=L.VldSet,exports.ZodMiniString=E.VldString,exports.ZodString=E.VldString,exports.ZodMiniSymbol=U.VldSymbol,exports.ZodSymbol=U.VldSymbol,exports.ZodMiniTemplateLiteral=I.VldTemplateLiteral,exports.ZodTemplateLiteral=I.VldTemplateLiteral,exports.ZodMiniTuple=B.VldTuple,exports.ZodTuple=B.VldTuple,exports.ZodMiniUndefined=C.VldUndefined,exports.ZodUndefined=C.VldUndefined,exports.ZodMiniUnion=D.VldUnion,exports.ZodUnion=D.VldUnion,exports.ZodMiniUnknown=O.VldUnknown,exports.ZodUnknown=O.VldUnknown,exports.ZodMiniVoid=N.VldVoid,exports.ZodVoid=N.VldVoid,exports.ZodMiniXor=A.VldXor,exports.ZodXor=A.VldXor,exports.base64Json=R.base64Json,exports.base64ToBytes=R.base64ToBytes,exports.base64ToUint8Array=R.base64ToUint8Array,exports.base64UrlToBytes=R.base64UrlToBytes,exports.base64urlToBytes=R.base64urlToBytes,exports.bytesToUtf8=R.bytesToUtf8,exports.epochMillisToDate=R.epochMillisToDate,exports.epochSecondsToDate=R.epochSecondsToDate,exports.hexLowerToBytes=R.hexLowerToBytes,exports.hexToBytes=R.hexToBytes,exports.hexToUint8Array=R.hexToUint8Array,exports.invertCodec=R.invertCodec,exports.isoDatetimeToDate=R.isoDatetimeToDate,exports.jsonCodec=R.jsonCodec,exports.jwtPayload=R.jwtPayload,exports.numberToBigInt=R.numberToBigInt,exports.stringToBigInt=R.stringToBigInt,exports.stringToBoolean=R.stringToBoolean,exports.stringToHttpURL=R.stringToHttpURL,exports.stringToInt=R.stringToInt,exports.stringToNumber=R.stringToNumber,exports.stringToURL=R.stringToURL,exports.stringToUint8Array=R.stringToUint8Array,exports.uint8ArrayToBase64=R.uint8ArrayToBase64,exports.uint8ArrayToBase64Url=R.uint8ArrayToBase64Url,exports.uint8ArrayToHex=R.uint8ArrayToHex,exports.uint8ArrayToString=R.uint8ArrayToString,exports.uriComponent=R.uriComponent,exports.utf8ToBytes=R.utf8ToBytes,exports.blue=P.blue,exports.bold=P.bold,exports.createTheme=P.createTheme,exports.cyan=P.cyan,exports.dim=P.dim,exports.gray=P.gray,exports.green=P.green,exports.grey=P.grey,exports.italic=P.italic,exports.magenta=P.magenta,exports.pigment=P.default,exports.red=P.red,exports.strip=P.strip,exports.supportsColor=P.supportsColor,exports.underline=P.underline,exports.vldTheme=P.vldTheme,exports.white=P.white,exports.yellow=P.yellow,exports.createEmitter=w.createEmitter,exports.createEventBus=w.createEventBus,exports.withEmitter=w.withEmitter,exports.createVldKernel=k.createVldKernel,exports.definePlugin=k.definePlugin,exports.getVldKernel=k.getVldKernel,exports.resetVldKernel=k.resetVldKernel,exports.usePlugin=k.usePlugin,exports.flattenError=z.flattenError,exports.prettifyError=z.prettifyError,exports.prettifyErrorColored=z.prettifyErrorColored,exports.prettifyErrorPlain=z.prettifyErrorPlain,exports.treeifyError=z.treeifyError,exports.getLocale=J.getLocale,exports.getMessages=J.getMessages,exports.getSupportedLocales=J.getSupportedLocales,exports.isLocaleLoaded=J.isLocaleLoaded,exports.isLocaleSupported=J.isLocaleSupported,exports.registerLocale=J.registerLocale,exports.setLocale=J.setLocale,exports.globalRegistry=K.globalRegistry,exports.registry=K.registry,exports.setLocaleAsync=_.setLocaleAsync;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../index.cjs"),r=require("../compat/result.cjs"),o=require("../validators/base.cjs"),t=require("../chunks/errors-core-DKPohm9I.cjs"),s=require("../validators/intersection.cjs"),i=require("../validators/any.cjs"),p=require("../validators/array.cjs"),n=require("../validators/string-formats.cjs"),a=require("../validators/bigint.cjs"),d=require("../validators/boolean.cjs"),l=require("../validators/codec.cjs"),x=require("../validators/custom.cjs"),c=require("../validators/date.cjs"),u=require("../validators/discriminated-union.cjs"),m=require("../validators/enum.cjs"),g=require("../validators/file.cjs"),V=require("../validators/function.cjs"),Z=require("../validators/json.cjs"),y=require("../validators/lazy.cjs"),f=require("../validators/literal.cjs"),j=require("../validators/map.cjs"),S=require("../validators/nan.cjs"),v=require("../validators/never.cjs"),M=require("../validators/null.cjs"),b=require("../validators/number.cjs"),q=require("../validators/object.cjs"),T=require("../validators/promise.cjs"),F=require("../validators/record.cjs"),h=require("../validators/set.cjs"),L=require("../validators/string.cjs"),E=require("../validators/symbol.cjs"),U=require("../validators/template-literal.cjs"),I=require("../validators/tuple.cjs"),B=require("../validators/undefined.cjs"),C=require("../validators/union.cjs"),D=require("../validators/unknown.cjs"),O=require("../validators/void.cjs"),N=require("../validators/xor.cjs"),A=require("../chunks/index-ZjHAxYdA.cjs"),R=require("../pigment.cjs"),P=require("../compat/emitter.cjs"),w=require("../kernel.cjs"),k=require("../errors.cjs"),z=require("../locales/runtime.cjs"),J=require("../registry.cjs"),K=require("../chunks/index-BEV9nG0N.cjs");function _(e){return Object.keys(e).filter(r=>e[r])}function X(e){return"string"==typeof e?e:e?.message||e?.error}require("../validators/string-bool.cjs"),require("../locales/en.cjs"),require("../validators/base64.cjs"),require("../validators/hex.cjs"),require("../validators/uint8array.cjs"),require("../coercion/index.cjs"),require("../chunks/ip-validation-BZqPamPC.cjs"),require("../chunks/security-aXZVI7qW.cjs"),require("../locales/tr.cjs"),require("../locales/es.cjs"),require("../locales/fr.cjs"),require("../locales/de.cjs"),require("../locales/it.cjs"),require("../locales/pt.cjs"),require("../locales/ru.cjs"),require("../locales/ja.cjs"),require("../locales/ko.cjs"),require("../locales/zh.cjs"),require("../locales/ar.cjs"),require("../locales/hi.cjs"),require("../locales/nl.cjs"),require("../locales/pl.cjs"),require("../locales/da.cjs"),require("../locales/sv.cjs"),require("../locales/no.cjs"),require("../locales/fi.cjs"),require("../locales/th.cjs"),require("../locales/vi.cjs"),require("../locales/id.cjs"),require("../locales/bn.cjs"),require("../locales/sw.cjs"),require("../locales/af.cjs"),require("../locales/pt-BR.cjs"),require("../locales/es-MX.cjs");exports.$brand=e.$brand,exports.$input=e.$input,exports.$output=e.$output,exports.NEVER=e.NEVER,exports.TimePrecision=e.TimePrecision,exports.ZodFirstPartyTypeKind=e.ZodFirstPartyTypeKind,exports.ZodIssueCode=e.ZodIssueCode,exports._ZodString=e._ZodString,exports._function=e._function,exports.any=e.any,exports.array=e.array,exports.base64=e.base64,exports.base64Bytes=e.base64Bytes,exports.base64url=e.base64url,exports.bigint=e.bigint,exports.boolean=e.boolean,exports.catch=e.catch,exports.check=e.check,exports.cidrv4=e.cidrv4,exports.cidrv6=e.cidrv6,exports.clone=e.clone,exports.codec=e.codec,exports.coerce=e.coerce,exports.config=e.config,exports.core=e.core,exports.createLogger=e.createLogger,exports.createNoOpLogger=e.createNoOpLogger,exports.creditCard=e.creditCard,exports.cuid=e.cuid,exports.cuid2=e.cuid2,exports.custom=e.custom,exports.date=e.date,exports.decode=e.decode,exports.decodeAsync=e.decodeAsync,exports.deepPartial=e.deepPartial,exports.default=e.default,exports.describe=e.describe,exports.disableLogging=e.disableLogging,exports.discriminatedUnion=e.discriminatedUnion,exports.e164=e.e164,exports.email=e.email,exports.emoji=e.emoji,exports.enableDebug=e.enableDebug,exports.encode=e.encode,exports.encodeAsync=e.encodeAsync,exports.endsWith=e.endsWith,exports.enum=e.enum,exports.exactOptional=e.exactOptional,exports.file=e.file,exports.float32=e.float32,exports.float64=e.float64,exports.formatError=e.formatError,exports.fromJSONSchema=e.fromJSONSchema,exports.function=e._function,exports.getErrorMap=e.getErrorMap,exports.getLogger=e.getLogger,exports.gt=e.gt,exports.gte=e.gte,exports.guid=e.guid,exports.hash=e.hash,exports.hex=e.hex,exports.hexBytes=e.hexBytes,exports.hostname=e.hostname,exports.httpUrl=e.httpUrl,exports.includes=e.includes,exports.initLogger=e.initLogger,exports.input=e.input,exports.instanceof=e.instanceof,exports.int=e.int,exports.int32=e.int32,exports.int64=e.int64,exports.intersection=e.intersection,exports.ipv4=e.ipv4,exports.ipv6=e.ipv6,exports.iso=e.iso,exports.json=e.json,exports.jwt=e.jwt,exports.keyof=e.keyof,exports.ksuid=e.ksuid,exports.lazy=e.lazy,exports.length=e.length,exports.literal=e.literal,exports.locales=e.locales,exports.looseObject=e.looseObject,exports.looseRecord=e.looseRecord,exports.lowercase=e.lowercase,exports.lt=e.lt,exports.lte=e.lte,exports.mac=e.mac,exports.map=e.map,exports.mapSchema=e.mapSchema,exports.maxLength=e.maxLength,exports.maxSize=e.maxSize,exports.meta=e.meta,exports.mime=e.mime,exports.minLength=e.minLength,exports.minSize=e.minSize,exports.multipleOf=e.multipleOf,exports.nan=e.nan,exports.nanoid=e.nanoid,exports.nativeEnum=e.nativeEnum,exports.negative=e.negative,exports.never=e.never,exports.nonnegative=e.nonnegative,exports.nonoptional=e.nonoptional,exports.nonpositive=e.nonpositive,exports.normalize=e.normalize,exports.null=e.null,exports.nullable=e.nullable,exports.nullish=e.nullish,exports.number=e.number,exports.object=e.object,exports.optional=e.optional,exports.output=e.output,exports.overwrite=e.overwrite,exports.parse=e.parse,exports.parseAsync=e.parseAsync,exports.partialRecord=e.partialRecord,exports.pipe=e.pipe,exports.positive=e.positive,exports.prefault=e.prefault,exports.preprocess=e.preprocess,exports.promise=e.promise,exports.property=e.property,exports.readonly=e.readonly,exports.record=e.record,exports.refine=e.refine,exports.regex=e.regex,exports.regexes=e.regexes,exports.safeDecode=e.safeDecode,exports.safeDecodeAsync=e.safeDecodeAsync,exports.safeEncode=e.safeEncode,exports.safeEncodeAsync=e.safeEncodeAsync,exports.safeParse=e.safeParse,exports.safeParseAsync=e.safeParseAsync,exports.set=e.set,exports.setErrorMap=e.setErrorMap,exports.setLogLevel=e.setLogLevel,exports.size=e.size,exports.slugify=e.slugify,exports.startsWith=e.startsWith,exports.strictObject=e.strictObject,exports.string=e.string,exports.stringFormat=e.stringFormat,exports.stringbool=e.stringbool,exports.superRefine=e.superRefine,exports.symbol=e.symbol,exports.templateLiteral=e.templateLiteral,exports.toJSONSchema=e.toJSONSchema,exports.toLowerCase=e.toLowerCase,exports.toUpperCase=e.toUpperCase,exports.transform=e.transform,exports.trim=e.trim,exports.tuple=e.tuple,exports.uint32=e.uint32,exports.uint64=e.uint64,exports.uint8Array=e.uint8Array,exports.ulid=e.ulid,exports.undefined=e.undefined,exports.union=e.union,exports.unknown=e.unknown,exports.uppercase=e.uppercase,exports.url=e.url,exports.util=e.util,exports.uuid=e.uuid,exports.uuidv4=e.uuidv4,exports.uuidv6=e.uuidv6,exports.uuidv7=e.uuidv7,exports.v=e.default,exports.void=e.void,exports.xid=e.xid,exports.xor=e.xor,exports.z=e.z,exports.Err=r.Err,exports.Ok=r.Ok,exports.ResultUtils=r.ResultUtils,exports.all=r.all,exports.failure=r.failure,exports.flatMap=r.flatMap,exports.fromNullable=r.fromNullable,exports.isErr=r.isErr,exports.isOk=r.isOk,exports.isResult=r.isResult,exports.mapErr=r.mapErr,exports.match=r.match,exports.success=r.success,exports.tryCatch=r.tryCatch,exports.tryCatchAsync=r.tryCatchAsync,exports.unwrap=r.unwrap,exports.unwrapOr=r.unwrapOr,exports.VldBase=o.VldBase,exports.VldMeta=o.VldMeta,exports.ZodBranded=o.VldBrand,exports.ZodCatch=o.VldCatch,exports.ZodDefault=o.VldDefault,exports.ZodExactOptional=o.VldExactOptional,exports.ZodMeta=o.VldMeta,exports.ZodMiniBrand=o.VldBrand,exports.ZodMiniCatch=o.VldCatch,exports.ZodMiniDefault=o.VldDefault,exports.ZodMiniExactOptional=o.VldExactOptional,exports.ZodMiniNonOptional=o.VldRefine,exports.ZodMiniNullable=o.VldNullable,exports.ZodMiniOptional=o.VldOptional,exports.ZodMiniPipe=o.VldPipe,exports.ZodMiniPrefault=o.VldPrefault,exports.ZodMiniReadonly=o.VldReadonly,exports.ZodMiniTransform=o.VldTransform,exports.ZodMiniType=o.VldBase,exports.ZodNonOptional=o.VldRefine,exports.ZodNullable=o.VldNullable,exports.ZodOptional=o.VldOptional,exports.ZodPipe=o.VldPipe,exports.ZodPrefault=o.VldPrefault,exports.ZodPreprocess=o.VldPreprocess,exports.ZodReadonly=o.VldReadonly,exports.ZodTransform=o.VldTransform,exports.ZodType=o.VldBase,exports.VldError=t.VldError,exports.ZodError=t.VldError,exports.ZodRealError=t.VldError,exports.VldIntersection=s.VldIntersection,exports.ZodIntersection=s.VldIntersection,exports.ZodMiniIntersection=s.VldIntersection,exports.ZodAny=i.VldAny,exports.ZodMiniAny=i.VldAny,exports.ZodArray=p.VldArray,exports.ZodMiniArray=p.VldArray,exports.ZodBase64=n.VldStringFormat,exports.ZodBase64URL=n.VldStringFormat,exports.ZodCIDRv4=n.VldStringFormat,exports.ZodCIDRv6=n.VldStringFormat,exports.ZodCUID=n.VldStringFormat,exports.ZodCUID2=n.VldStringFormat,exports.ZodCreditCard=n.VldStringFormat,exports.ZodCustomStringFormat=n.VldStringFormat,exports.ZodE164=n.VldStringFormat,exports.ZodEmail=n.VldStringFormat,exports.ZodEmoji=n.VldStringFormat,exports.ZodGUID=n.VldStringFormat,exports.ZodIPv4=n.VldStringFormat,exports.ZodIPv6=n.VldStringFormat,exports.ZodISODate=n.VldStringFormat,exports.ZodISODateTime=n.VldStringFormat,exports.ZodISODuration=n.VldStringFormat,exports.ZodISOTime=n.VldStringFormat,exports.ZodJWT=n.VldStringFormat,exports.ZodKSUID=n.VldStringFormat,exports.ZodMAC=n.VldStringFormat,exports.ZodMiniBase64=n.VldStringFormat,exports.ZodMiniBase64URL=n.VldStringFormat,exports.ZodMiniCIDRv4=n.VldStringFormat,exports.ZodMiniCIDRv6=n.VldStringFormat,exports.ZodMiniCUID=n.VldStringFormat,exports.ZodMiniCUID2=n.VldStringFormat,exports.ZodMiniCreditCard=n.VldStringFormat,exports.ZodMiniCustomStringFormat=n.VldStringFormat,exports.ZodMiniE164=n.VldStringFormat,exports.ZodMiniEmail=n.VldStringFormat,exports.ZodMiniEmoji=n.VldStringFormat,exports.ZodMiniGUID=n.VldStringFormat,exports.ZodMiniIPv4=n.VldStringFormat,exports.ZodMiniIPv6=n.VldStringFormat,exports.ZodMiniISODate=n.VldStringFormat,exports.ZodMiniISODateTime=n.VldStringFormat,exports.ZodMiniISODuration=n.VldStringFormat,exports.ZodMiniISOTime=n.VldStringFormat,exports.ZodMiniJWT=n.VldStringFormat,exports.ZodMiniKSUID=n.VldStringFormat,exports.ZodMiniMAC=n.VldStringFormat,exports.ZodMiniNanoID=n.VldStringFormat,exports.ZodMiniStringFormat=n.VldStringFormat,exports.ZodMiniULID=n.VldStringFormat,exports.ZodMiniURL=n.VldStringFormat,exports.ZodMiniUUID=n.VldStringFormat,exports.ZodMiniXID=n.VldStringFormat,exports.ZodNanoID=n.VldStringFormat,exports.ZodStringFormat=n.VldStringFormat,exports.ZodULID=n.VldStringFormat,exports.ZodURL=n.VldStringFormat,exports.ZodUUID=n.VldStringFormat,exports.ZodXID=n.VldStringFormat,exports.ZodBigInt=a.VldBigInt,exports.ZodBigIntFormat=a.VldBigInt,exports.ZodMiniBigInt=a.VldBigInt,exports.ZodMiniBigIntFormat=a.VldBigInt,exports.ZodBoolean=d.VldBoolean,exports.ZodMiniBoolean=d.VldBoolean,exports.ZodCodec=l.VldCodec,exports.ZodMiniCodec=l.VldCodec,exports.ZodCustom=x.VldCustom,exports.ZodMiniCustom=x.VldCustom,exports.ZodMiniSuccess=x.VldCustom,exports.ZodSuccess=x.VldCustom,exports.ZodDate=c.VldDate,exports.ZodMiniDate=c.VldDate,exports.ZodDiscriminatedUnion=u.VldDiscriminatedUnion,exports.ZodMiniDiscriminatedUnion=u.VldDiscriminatedUnion,exports.ZodEnum=m.VldEnum,exports.ZodMiniEnum=m.VldEnum,exports.ZodFile=g.VldFile,exports.ZodMiniFile=g.VldFile,exports.ZodFunction=V.VldFunction,exports.ZodMiniFunction=V.VldFunction,exports.ZodJSON=Z.VldJson,exports.ZodLazy=y.VldLazy,exports.ZodMiniLazy=y.VldLazy,exports.ZodLiteral=f.VldLiteral,exports.ZodMiniLiteral=f.VldLiteral,exports.ZodMap=j.VldMap,exports.ZodMiniMap=j.VldMap,exports.ZodMiniNaN=S.VldNan,exports.ZodNaN=S.VldNan,exports.ZodMiniNever=v.VldNever,exports.ZodNever=v.VldNever,exports.ZodMiniNull=M.VldNull,exports.ZodNull=M.VldNull,exports.ZodMiniNumber=b.VldNumber,exports.ZodMiniNumberFormat=b.VldNumber,exports.ZodNumber=b.VldNumber,exports.ZodNumberFormat=b.VldNumber,exports.ZodMiniObject=q.VldObject,exports.ZodObject=q.VldObject,exports.ZodMiniPromise=T.VldPromise,exports.ZodPromise=T.VldPromise,exports.ZodMiniRecord=F.VldRecord,exports.ZodRecord=F.VldRecord,exports.ZodMiniSet=h.VldSet,exports.ZodSet=h.VldSet,exports.ZodMiniString=L.VldString,exports.ZodString=L.VldString,exports.ZodMiniSymbol=E.VldSymbol,exports.ZodSymbol=E.VldSymbol,exports.ZodMiniTemplateLiteral=U.VldTemplateLiteral,exports.ZodTemplateLiteral=U.VldTemplateLiteral,exports.ZodMiniTuple=I.VldTuple,exports.ZodTuple=I.VldTuple,exports.ZodMiniUndefined=B.VldUndefined,exports.ZodUndefined=B.VldUndefined,exports.ZodMiniUnion=C.VldUnion,exports.ZodUnion=C.VldUnion,exports.ZodMiniUnknown=D.VldUnknown,exports.ZodUnknown=D.VldUnknown,exports.ZodMiniVoid=O.VldVoid,exports.ZodVoid=O.VldVoid,exports.ZodMiniXor=N.VldXor,exports.ZodXor=N.VldXor,exports.base64Json=A.base64Json,exports.base64ToBytes=A.base64ToBytes,exports.base64ToUint8Array=A.base64ToUint8Array,exports.base64UrlToBytes=A.base64UrlToBytes,exports.base64urlToBytes=A.base64urlToBytes,exports.bytesToUtf8=A.bytesToUtf8,exports.epochMillisToDate=A.epochMillisToDate,exports.epochSecondsToDate=A.epochSecondsToDate,exports.hexLowerToBytes=A.hexLowerToBytes,exports.hexToBytes=A.hexToBytes,exports.hexToUint8Array=A.hexToUint8Array,exports.invertCodec=A.invertCodec,exports.isoDatetimeToDate=A.isoDatetimeToDate,exports.jsonCodec=A.jsonCodec,exports.jwtPayload=A.jwtPayload,exports.numberToBigInt=A.numberToBigInt,exports.stringToBigInt=A.stringToBigInt,exports.stringToBoolean=A.stringToBoolean,exports.stringToHttpURL=A.stringToHttpURL,exports.stringToInt=A.stringToInt,exports.stringToNumber=A.stringToNumber,exports.stringToURL=A.stringToURL,exports.stringToUint8Array=A.stringToUint8Array,exports.uint8ArrayToBase64=A.uint8ArrayToBase64,exports.uint8ArrayToBase64Url=A.uint8ArrayToBase64Url,exports.uint8ArrayToHex=A.uint8ArrayToHex,exports.uint8ArrayToString=A.uint8ArrayToString,exports.uriComponent=A.uriComponent,exports.utf8ToBytes=A.utf8ToBytes,exports.blue=R.blue,exports.bold=R.bold,exports.createTheme=R.createTheme,exports.cyan=R.cyan,exports.dim=R.dim,exports.gray=R.gray,exports.green=R.green,exports.grey=R.grey,exports.italic=R.italic,exports.magenta=R.magenta,exports.pigment=R.default,exports.red=R.red,exports.strip=R.strip,exports.supportsColor=R.supportsColor,exports.underline=R.underline,exports.vldTheme=R.vldTheme,exports.white=R.white,exports.yellow=R.yellow,exports.createEmitter=P.createEmitter,exports.createEventBus=P.createEventBus,exports.withEmitter=P.withEmitter,exports.createVldKernel=w.createVldKernel,exports.definePlugin=w.definePlugin,exports.getVldKernel=w.getVldKernel,exports.resetVldKernel=w.resetVldKernel,exports.usePlugin=w.usePlugin,exports.flattenError=k.flattenError,exports.prettifyError=k.prettifyError,exports.prettifyErrorColored=k.prettifyErrorColored,exports.prettifyErrorPlain=k.prettifyErrorPlain,exports.treeifyError=k.treeifyError,exports.getLocale=z.getLocale,exports.getMessages=z.getMessages,exports.getSupportedLocales=z.getSupportedLocales,exports.isLocaleLoaded=z.isLocaleLoaded,exports.isLocaleSupported=z.isLocaleSupported,exports.registerLocale=z.registerLocale,exports.setLocale=z.setLocale,exports.globalRegistry=J.globalRegistry,exports.registry=J.registry,exports.setLocaleAsync=K.setLocaleAsync,exports._default=(e,r)=>e.default("function"==typeof r?r():r),exports.catchall=(e,r)=>e.catchall(r),exports.extend=(e,r)=>e.extend(r),exports.maximum=(r,o)=>{const t=X(o);return e.number().max(r,t)},exports.merge=(e,r)=>r&&"function"==typeof r.parse?e.merge(r):e.extend(r),exports.minimum=(r,o)=>{const t=X(o);return e.number().min(r,t)},exports.omit=(e,r)=>e.omit(..._(r)),exports.partial=e=>e.partial(),exports.pick=(e,r)=>e.pick(..._(r)),exports.required=e=>e.required(),exports.safeExtend=(e,r)=>e.safeExtend(r);
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../index.cjs"),r=require("../compat/result.cjs"),o=require("../validators/base.cjs"),t=require("../chunks/errors-core-DrydF46s.cjs"),s=require("../validators/intersection.cjs"),i=require("../validators/any.cjs"),p=require("../validators/array.cjs"),n=require("../validators/string-formats.cjs"),a=require("../validators/bigint.cjs"),d=require("../validators/boolean.cjs"),l=require("../validators/codec.cjs"),x=require("../validators/custom.cjs"),c=require("../validators/date.cjs"),u=require("../validators/discriminated-union.cjs"),m=require("../validators/enum.cjs"),g=require("../validators/file.cjs"),V=require("../validators/function.cjs"),Z=require("../validators/json.cjs"),y=require("../validators/lazy.cjs"),f=require("../validators/literal.cjs"),j=require("../validators/map.cjs"),S=require("../validators/nan.cjs"),v=require("../validators/never.cjs"),M=require("../validators/null.cjs"),b=require("../validators/number.cjs"),q=require("../validators/object.cjs"),T=require("../validators/promise.cjs"),F=require("../validators/record.cjs"),h=require("../validators/set.cjs"),L=require("../validators/string.cjs"),E=require("../validators/symbol.cjs"),U=require("../validators/template-literal.cjs"),I=require("../validators/tuple.cjs"),B=require("../validators/undefined.cjs"),C=require("../validators/union.cjs"),D=require("../validators/unknown.cjs"),O=require("../validators/void.cjs"),N=require("../validators/xor.cjs"),A=require("../chunks/index-ZjHAxYdA.cjs"),R=require("../pigment.cjs"),P=require("../compat/emitter.cjs"),w=require("../kernel.cjs"),k=require("../errors.cjs"),z=require("../locales/runtime.cjs"),J=require("../registry.cjs"),K=require("../chunks/index-BEV9nG0N.cjs");function _(e){return Object.keys(e).filter(r=>e[r])}function X(e){return"string"==typeof e?e:e?.message||e?.error}require("../validators/string-bool.cjs"),require("../locales/en.cjs"),require("../validators/base64.cjs"),require("../validators/hex.cjs"),require("../validators/uint8array.cjs"),require("../coercion/index.cjs"),require("../chunks/ip-validation-BZqPamPC.cjs"),require("../chunks/security-aXZVI7qW.cjs"),require("../locales/tr.cjs"),require("../locales/es.cjs"),require("../locales/fr.cjs"),require("../locales/de.cjs"),require("../locales/it.cjs"),require("../locales/pt.cjs"),require("../locales/ru.cjs"),require("../locales/ja.cjs"),require("../locales/ko.cjs"),require("../locales/zh.cjs"),require("../locales/ar.cjs"),require("../locales/hi.cjs"),require("../locales/nl.cjs"),require("../locales/pl.cjs"),require("../locales/da.cjs"),require("../locales/sv.cjs"),require("../locales/no.cjs"),require("../locales/fi.cjs"),require("../locales/th.cjs"),require("../locales/vi.cjs"),require("../locales/id.cjs"),require("../locales/bn.cjs"),require("../locales/sw.cjs"),require("../locales/af.cjs"),require("../locales/pt-BR.cjs"),require("../locales/es-MX.cjs");exports.$brand=e.$brand,exports.$input=e.$input,exports.$output=e.$output,exports.NEVER=e.NEVER,exports.TimePrecision=e.TimePrecision,exports.ZodFirstPartyTypeKind=e.ZodFirstPartyTypeKind,exports.ZodIssueCode=e.ZodIssueCode,exports._ZodString=e._ZodString,exports._function=e._function,exports.any=e.any,exports.array=e.array,exports.base64=e.base64,exports.base64Bytes=e.base64Bytes,exports.base64url=e.base64url,exports.bigint=e.bigint,exports.boolean=e.boolean,exports.catch=e.catch,exports.check=e.check,exports.cidrv4=e.cidrv4,exports.cidrv6=e.cidrv6,exports.clone=e.clone,exports.codec=e.codec,exports.coerce=e.coerce,exports.config=e.config,exports.core=e.core,exports.createLogger=e.createLogger,exports.createNoOpLogger=e.createNoOpLogger,exports.creditCard=e.creditCard,exports.cuid=e.cuid,exports.cuid2=e.cuid2,exports.custom=e.custom,exports.date=e.date,exports.decode=e.decode,exports.decodeAsync=e.decodeAsync,exports.deepPartial=e.deepPartial,exports.default=e.default,exports.describe=e.describe,exports.disableLogging=e.disableLogging,exports.discriminatedUnion=e.discriminatedUnion,exports.e164=e.e164,exports.email=e.email,exports.emoji=e.emoji,exports.enableDebug=e.enableDebug,exports.encode=e.encode,exports.encodeAsync=e.encodeAsync,exports.endsWith=e.endsWith,exports.enum=e.enum,exports.exactOptional=e.exactOptional,exports.file=e.file,exports.float32=e.float32,exports.float64=e.float64,exports.formatError=e.formatError,exports.fromJSONSchema=e.fromJSONSchema,exports.function=e._function,exports.getErrorMap=e.getErrorMap,exports.getLogger=e.getLogger,exports.gt=e.gt,exports.gte=e.gte,exports.guid=e.guid,exports.hash=e.hash,exports.hex=e.hex,exports.hexBytes=e.hexBytes,exports.hostname=e.hostname,exports.httpUrl=e.httpUrl,exports.includes=e.includes,exports.initLogger=e.initLogger,exports.input=e.input,exports.instanceof=e.instanceof,exports.int=e.int,exports.int32=e.int32,exports.int64=e.int64,exports.intersection=e.intersection,exports.ipv4=e.ipv4,exports.ipv6=e.ipv6,exports.iso=e.iso,exports.json=e.json,exports.jwt=e.jwt,exports.keyof=e.keyof,exports.ksuid=e.ksuid,exports.lazy=e.lazy,exports.length=e.length,exports.literal=e.literal,exports.locales=e.locales,exports.looseObject=e.looseObject,exports.looseRecord=e.looseRecord,exports.lowercase=e.lowercase,exports.lt=e.lt,exports.lte=e.lte,exports.mac=e.mac,exports.map=e.map,exports.mapSchema=e.mapSchema,exports.maxLength=e.maxLength,exports.maxSize=e.maxSize,exports.meta=e.meta,exports.mime=e.mime,exports.minLength=e.minLength,exports.minSize=e.minSize,exports.multipleOf=e.multipleOf,exports.nan=e.nan,exports.nanoid=e.nanoid,exports.nativeEnum=e.nativeEnum,exports.negative=e.negative,exports.never=e.never,exports.nonnegative=e.nonnegative,exports.nonoptional=e.nonoptional,exports.nonpositive=e.nonpositive,exports.normalize=e.normalize,exports.null=e.null,exports.nullable=e.nullable,exports.nullish=e.nullish,exports.number=e.number,exports.object=e.object,exports.optional=e.optional,exports.output=e.output,exports.overwrite=e.overwrite,exports.parse=e.parse,exports.parseAsync=e.parseAsync,exports.partialRecord=e.partialRecord,exports.pipe=e.pipe,exports.positive=e.positive,exports.prefault=e.prefault,exports.preprocess=e.preprocess,exports.promise=e.promise,exports.property=e.property,exports.readonly=e.readonly,exports.record=e.record,exports.refine=e.refine,exports.regex=e.regex,exports.regexes=e.regexes,exports.safeDecode=e.safeDecode,exports.safeDecodeAsync=e.safeDecodeAsync,exports.safeEncode=e.safeEncode,exports.safeEncodeAsync=e.safeEncodeAsync,exports.safeParse=e.safeParse,exports.safeParseAsync=e.safeParseAsync,exports.set=e.set,exports.setErrorMap=e.setErrorMap,exports.setLogLevel=e.setLogLevel,exports.size=e.size,exports.slugify=e.slugify,exports.startsWith=e.startsWith,exports.strictObject=e.strictObject,exports.string=e.string,exports.stringFormat=e.stringFormat,exports.stringbool=e.stringbool,exports.superRefine=e.superRefine,exports.symbol=e.symbol,exports.templateLiteral=e.templateLiteral,exports.toJSONSchema=e.toJSONSchema,exports.toLowerCase=e.toLowerCase,exports.toUpperCase=e.toUpperCase,exports.transform=e.transform,exports.trim=e.trim,exports.tuple=e.tuple,exports.uint32=e.uint32,exports.uint64=e.uint64,exports.uint8Array=e.uint8Array,exports.ulid=e.ulid,exports.undefined=e.undefined,exports.union=e.union,exports.unknown=e.unknown,exports.uppercase=e.uppercase,exports.url=e.url,exports.util=e.util,exports.uuid=e.uuid,exports.uuidv4=e.uuidv4,exports.uuidv6=e.uuidv6,exports.uuidv7=e.uuidv7,exports.v=e.default,exports.void=e.void,exports.xid=e.xid,exports.xor=e.xor,exports.z=e.z,exports.Err=r.Err,exports.Ok=r.Ok,exports.ResultUtils=r.ResultUtils,exports.all=r.all,exports.failure=r.failure,exports.flatMap=r.flatMap,exports.fromNullable=r.fromNullable,exports.isErr=r.isErr,exports.isOk=r.isOk,exports.isResult=r.isResult,exports.mapErr=r.mapErr,exports.match=r.match,exports.success=r.success,exports.tryCatch=r.tryCatch,exports.tryCatchAsync=r.tryCatchAsync,exports.unwrap=r.unwrap,exports.unwrapOr=r.unwrapOr,exports.VldBase=o.VldBase,exports.VldMeta=o.VldMeta,exports.ZodBranded=o.VldBrand,exports.ZodCatch=o.VldCatch,exports.ZodDefault=o.VldDefault,exports.ZodExactOptional=o.VldExactOptional,exports.ZodMeta=o.VldMeta,exports.ZodMiniBrand=o.VldBrand,exports.ZodMiniCatch=o.VldCatch,exports.ZodMiniDefault=o.VldDefault,exports.ZodMiniExactOptional=o.VldExactOptional,exports.ZodMiniNonOptional=o.VldRefine,exports.ZodMiniNullable=o.VldNullable,exports.ZodMiniOptional=o.VldOptional,exports.ZodMiniPipe=o.VldPipe,exports.ZodMiniPrefault=o.VldPrefault,exports.ZodMiniReadonly=o.VldReadonly,exports.ZodMiniTransform=o.VldTransform,exports.ZodMiniType=o.VldBase,exports.ZodNonOptional=o.VldRefine,exports.ZodNullable=o.VldNullable,exports.ZodOptional=o.VldOptional,exports.ZodPipe=o.VldPipe,exports.ZodPrefault=o.VldPrefault,exports.ZodPreprocess=o.VldPreprocess,exports.ZodReadonly=o.VldReadonly,exports.ZodTransform=o.VldTransform,exports.ZodType=o.VldBase,exports.VldError=t.VldError,exports.ZodError=t.VldError,exports.ZodRealError=t.VldError,exports.VldIntersection=s.VldIntersection,exports.ZodIntersection=s.VldIntersection,exports.ZodMiniIntersection=s.VldIntersection,exports.ZodAny=i.VldAny,exports.ZodMiniAny=i.VldAny,exports.ZodArray=p.VldArray,exports.ZodMiniArray=p.VldArray,exports.ZodBase64=n.VldStringFormat,exports.ZodBase64URL=n.VldStringFormat,exports.ZodCIDRv4=n.VldStringFormat,exports.ZodCIDRv6=n.VldStringFormat,exports.ZodCUID=n.VldStringFormat,exports.ZodCUID2=n.VldStringFormat,exports.ZodCreditCard=n.VldStringFormat,exports.ZodCustomStringFormat=n.VldStringFormat,exports.ZodE164=n.VldStringFormat,exports.ZodEmail=n.VldStringFormat,exports.ZodEmoji=n.VldStringFormat,exports.ZodGUID=n.VldStringFormat,exports.ZodIPv4=n.VldStringFormat,exports.ZodIPv6=n.VldStringFormat,exports.ZodISODate=n.VldStringFormat,exports.ZodISODateTime=n.VldStringFormat,exports.ZodISODuration=n.VldStringFormat,exports.ZodISOTime=n.VldStringFormat,exports.ZodJWT=n.VldStringFormat,exports.ZodKSUID=n.VldStringFormat,exports.ZodMAC=n.VldStringFormat,exports.ZodMiniBase64=n.VldStringFormat,exports.ZodMiniBase64URL=n.VldStringFormat,exports.ZodMiniCIDRv4=n.VldStringFormat,exports.ZodMiniCIDRv6=n.VldStringFormat,exports.ZodMiniCUID=n.VldStringFormat,exports.ZodMiniCUID2=n.VldStringFormat,exports.ZodMiniCreditCard=n.VldStringFormat,exports.ZodMiniCustomStringFormat=n.VldStringFormat,exports.ZodMiniE164=n.VldStringFormat,exports.ZodMiniEmail=n.VldStringFormat,exports.ZodMiniEmoji=n.VldStringFormat,exports.ZodMiniGUID=n.VldStringFormat,exports.ZodMiniIPv4=n.VldStringFormat,exports.ZodMiniIPv6=n.VldStringFormat,exports.ZodMiniISODate=n.VldStringFormat,exports.ZodMiniISODateTime=n.VldStringFormat,exports.ZodMiniISODuration=n.VldStringFormat,exports.ZodMiniISOTime=n.VldStringFormat,exports.ZodMiniJWT=n.VldStringFormat,exports.ZodMiniKSUID=n.VldStringFormat,exports.ZodMiniMAC=n.VldStringFormat,exports.ZodMiniNanoID=n.VldStringFormat,exports.ZodMiniStringFormat=n.VldStringFormat,exports.ZodMiniULID=n.VldStringFormat,exports.ZodMiniURL=n.VldStringFormat,exports.ZodMiniUUID=n.VldStringFormat,exports.ZodMiniXID=n.VldStringFormat,exports.ZodNanoID=n.VldStringFormat,exports.ZodStringFormat=n.VldStringFormat,exports.ZodULID=n.VldStringFormat,exports.ZodURL=n.VldStringFormat,exports.ZodUUID=n.VldStringFormat,exports.ZodXID=n.VldStringFormat,exports.ZodBigInt=a.VldBigInt,exports.ZodBigIntFormat=a.VldBigInt,exports.ZodMiniBigInt=a.VldBigInt,exports.ZodMiniBigIntFormat=a.VldBigInt,exports.ZodBoolean=d.VldBoolean,exports.ZodMiniBoolean=d.VldBoolean,exports.ZodCodec=l.VldCodec,exports.ZodMiniCodec=l.VldCodec,exports.ZodCustom=x.VldCustom,exports.ZodMiniCustom=x.VldCustom,exports.ZodMiniSuccess=x.VldCustom,exports.ZodSuccess=x.VldCustom,exports.ZodDate=c.VldDate,exports.ZodMiniDate=c.VldDate,exports.ZodDiscriminatedUnion=u.VldDiscriminatedUnion,exports.ZodMiniDiscriminatedUnion=u.VldDiscriminatedUnion,exports.ZodEnum=m.VldEnum,exports.ZodMiniEnum=m.VldEnum,exports.ZodFile=g.VldFile,exports.ZodMiniFile=g.VldFile,exports.ZodFunction=V.VldFunction,exports.ZodMiniFunction=V.VldFunction,exports.ZodJSON=Z.VldJson,exports.ZodLazy=y.VldLazy,exports.ZodMiniLazy=y.VldLazy,exports.ZodLiteral=f.VldLiteral,exports.ZodMiniLiteral=f.VldLiteral,exports.ZodMap=j.VldMap,exports.ZodMiniMap=j.VldMap,exports.ZodMiniNaN=S.VldNan,exports.ZodNaN=S.VldNan,exports.ZodMiniNever=v.VldNever,exports.ZodNever=v.VldNever,exports.ZodMiniNull=M.VldNull,exports.ZodNull=M.VldNull,exports.ZodMiniNumber=b.VldNumber,exports.ZodMiniNumberFormat=b.VldNumber,exports.ZodNumber=b.VldNumber,exports.ZodNumberFormat=b.VldNumber,exports.ZodMiniObject=q.VldObject,exports.ZodObject=q.VldObject,exports.ZodMiniPromise=T.VldPromise,exports.ZodPromise=T.VldPromise,exports.ZodMiniRecord=F.VldRecord,exports.ZodRecord=F.VldRecord,exports.ZodMiniSet=h.VldSet,exports.ZodSet=h.VldSet,exports.ZodMiniString=L.VldString,exports.ZodString=L.VldString,exports.ZodMiniSymbol=E.VldSymbol,exports.ZodSymbol=E.VldSymbol,exports.ZodMiniTemplateLiteral=U.VldTemplateLiteral,exports.ZodTemplateLiteral=U.VldTemplateLiteral,exports.ZodMiniTuple=I.VldTuple,exports.ZodTuple=I.VldTuple,exports.ZodMiniUndefined=B.VldUndefined,exports.ZodUndefined=B.VldUndefined,exports.ZodMiniUnion=C.VldUnion,exports.ZodUnion=C.VldUnion,exports.ZodMiniUnknown=D.VldUnknown,exports.ZodUnknown=D.VldUnknown,exports.ZodMiniVoid=O.VldVoid,exports.ZodVoid=O.VldVoid,exports.ZodMiniXor=N.VldXor,exports.ZodXor=N.VldXor,exports.base64Json=A.base64Json,exports.base64ToBytes=A.base64ToBytes,exports.base64ToUint8Array=A.base64ToUint8Array,exports.base64UrlToBytes=A.base64UrlToBytes,exports.base64urlToBytes=A.base64urlToBytes,exports.bytesToUtf8=A.bytesToUtf8,exports.epochMillisToDate=A.epochMillisToDate,exports.epochSecondsToDate=A.epochSecondsToDate,exports.hexLowerToBytes=A.hexLowerToBytes,exports.hexToBytes=A.hexToBytes,exports.hexToUint8Array=A.hexToUint8Array,exports.invertCodec=A.invertCodec,exports.isoDatetimeToDate=A.isoDatetimeToDate,exports.jsonCodec=A.jsonCodec,exports.jwtPayload=A.jwtPayload,exports.numberToBigInt=A.numberToBigInt,exports.stringToBigInt=A.stringToBigInt,exports.stringToBoolean=A.stringToBoolean,exports.stringToHttpURL=A.stringToHttpURL,exports.stringToInt=A.stringToInt,exports.stringToNumber=A.stringToNumber,exports.stringToURL=A.stringToURL,exports.stringToUint8Array=A.stringToUint8Array,exports.uint8ArrayToBase64=A.uint8ArrayToBase64,exports.uint8ArrayToBase64Url=A.uint8ArrayToBase64Url,exports.uint8ArrayToHex=A.uint8ArrayToHex,exports.uint8ArrayToString=A.uint8ArrayToString,exports.uriComponent=A.uriComponent,exports.utf8ToBytes=A.utf8ToBytes,exports.blue=R.blue,exports.bold=R.bold,exports.createTheme=R.createTheme,exports.cyan=R.cyan,exports.dim=R.dim,exports.gray=R.gray,exports.green=R.green,exports.grey=R.grey,exports.italic=R.italic,exports.magenta=R.magenta,exports.pigment=R.default,exports.red=R.red,exports.strip=R.strip,exports.supportsColor=R.supportsColor,exports.underline=R.underline,exports.vldTheme=R.vldTheme,exports.white=R.white,exports.yellow=R.yellow,exports.createEmitter=P.createEmitter,exports.createEventBus=P.createEventBus,exports.withEmitter=P.withEmitter,exports.createVldKernel=w.createVldKernel,exports.definePlugin=w.definePlugin,exports.getVldKernel=w.getVldKernel,exports.resetVldKernel=w.resetVldKernel,exports.usePlugin=w.usePlugin,exports.flattenError=k.flattenError,exports.prettifyError=k.prettifyError,exports.prettifyErrorColored=k.prettifyErrorColored,exports.prettifyErrorPlain=k.prettifyErrorPlain,exports.treeifyError=k.treeifyError,exports.getLocale=z.getLocale,exports.getMessages=z.getMessages,exports.getSupportedLocales=z.getSupportedLocales,exports.isLocaleLoaded=z.isLocaleLoaded,exports.isLocaleSupported=z.isLocaleSupported,exports.registerLocale=z.registerLocale,exports.setLocale=z.setLocale,exports.globalRegistry=J.globalRegistry,exports.registry=J.registry,exports.setLocaleAsync=K.setLocaleAsync,exports._default=(e,r)=>e.default("function"==typeof r?r():r),exports.catchall=(e,r)=>e.catchall(r),exports.extend=(e,r)=>e.extend(r),exports.maximum=(r,o)=>{const t=X(o);return e.number().max(r,t)},exports.merge=(e,r)=>r&&"function"==typeof r.parse?e.merge(r):e.extend(r),exports.minimum=(r,o)=>{const t=X(o);return e.number().min(r,t)},exports.omit=(e,r)=>e.omit(..._(r)),exports.partial=e=>e.partial(),exports.pick=(e,r)=>e.pick(..._(r)),exports.required=e=>e.required(),exports.safeExtend=(e,r)=>e.safeExtend(r);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./base.cjs");require("../registry.cjs");class VldAny extends e.VldBase{constructor(){super(e.VLD_VALIDATOR_TYPES.ANY)}static create(){return new VldAny}get isSimple(){return!0}parse(e){return e}safeParse(e){return{success:!0,data:e}}}exports.VldAny=VldAny;
|
|
1
|
+
"use strict";var e=require("./base.cjs");require("../registry.cjs"),require("../chunks/errors-core-DrydF46s.cjs");class VldAny extends e.VldBase{constructor(){super(e.VLD_VALIDATOR_TYPES.ANY)}static create(){return new VldAny}get isSimple(){return!0}parse(e){return e}safeParse(e){return{success:!0,data:e}}}exports.VldAny=VldAny;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./base.cjs"),r=require("../locales/runtime.cjs"),t=require("../chunks/errors-core-
|
|
1
|
+
"use strict";var e=require("./base.cjs"),r=require("../locales/runtime.cjs"),t=require("../chunks/errors-core-DrydF46s.cjs");function n(e){return new t.VldError([{code:"invalid_array",path:[],message:e}])}function s(e,r){return new t.VldError([{code:"too_small",path:[],origin:"array",minimum:e,inclusive:!0,message:r}])}require("../registry.cjs"),require("../locales/en.cjs");class VldArray extends e.VldBase{constructor(r){super(e.VLD_VALIDATOR_TYPES.ARRAY),this.config=r,this._simpleItemMode=this.getSimpleItemMode(r.itemValidator)}getSimpleItemMode(r){if(!0===r.isSimple)switch(r.validatorType){case e.VLD_VALIDATOR_TYPES.STRING:return"string";case e.VLD_VALIDATOR_TYPES.NUMBER:return"number";case e.VLD_VALIDATOR_TYPES.BOOLEAN:return"boolean";default:return}}static create(e){return new VldArray({itemValidator:e})}get element(){return this.config.itemValidator}unwrap(){return this.config.itemValidator}parse(e){if(!Array.isArray(e)){const n=this.config.errorMessage||r.getMessages().invalidArray;throw new t.VldError([t.createInvalidTypeIssue("array",t.getTypeName(e),n)])}return this.parseArrayValue(e)}parseKnownArray(e){return this.parseArrayValue(e)}parseArrayValue(e){if(void 0!==this.config.exactLength&&e.length!==this.config.exactLength)throw s(this.config.exactLength,this.config.errorMessage||r.getMessages().arrayLength(this.config.exactLength));if(void 0!==this.config.minLength&&e.length<this.config.minLength)throw s(this.config.minLength,this.config.errorMessage||r.getMessages().arrayMin(this.config.minLength));if(void 0!==this.config.maxLength&&e.length>this.config.maxLength)throw n=this.config.maxLength,i=this.config.errorMessage||r.getMessages().arrayMax(this.config.maxLength),new t.VldError([{code:"too_big",path:[],origin:"array",maximum:n,inclusive:!0,message:i}]);var n,i;const a=e.length,o=new Array(a),g=this._simpleItemMode;if(void 0!==g){for(let t=0;t<a;t++){const n=e[t];switch(g){case"string":if("string"!=typeof n)throw new Error(r.getMessages().arrayItem(t,r.getMessages().invalidString));o[t]=n;break;case"number":if("number"!=typeof n||isNaN(n))throw new Error(r.getMessages().arrayItem(t,r.getMessages().invalidNumber));o[t]=n;break;case"boolean":if("boolean"!=typeof n)throw new Error(r.getMessages().arrayItem(t,r.getMessages().invalidBoolean));o[t]=n}}return this.config.unique&&this.checkUnique(o),o}for(let t=0;t<a;t++)try{o[t]=this.config.itemValidator.parse(e[t])}catch(e){const n=e instanceof Error?e.message:String(e);throw new Error(r.getMessages().arrayItem(t,n))}return this.config.unique&&this.checkUnique(o),o}safeParse(e){try{return{success:!0,data:this.parse(e)}}catch(e){return e instanceof t.VldError?{success:!1,error:e}:{success:!1,error:n(e.message)}}}encode(e){this.validateEncodedArray(e);const r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=this.config.itemValidator.encode(e[t]);return r}safeEncode(e){try{return{success:!0,data:this.encode(e)}}catch(e){return{success:!1,error:n(e.message)}}}async encodeAsync(e){this.validateEncodedArray(e);const r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=await this.config.itemValidator.encodeAsync(e[t]);return r}async safeEncodeAsync(e){try{return{success:!0,data:await this.encodeAsync(e)}}catch(e){return{success:!1,error:n(e.message)}}}validateEncodedArray(e){if(!Array.isArray(e))throw new Error(this.config.errorMessage||r.getMessages().invalidArray);if(void 0!==this.config.exactLength&&e.length!==this.config.exactLength)throw new Error(this.config.errorMessage);if(void 0!==this.config.minLength&&e.length<this.config.minLength)throw new Error(this.config.errorMessage);if(void 0!==this.config.maxLength&&e.length>this.config.maxLength)throw new Error(this.config.errorMessage);this.config.unique&&this.checkUnique(e)}checkUnique(e){const r=new Set,t=new WeakMap;for(const n of e){let e;if("object"==typeof n&&null!==n){const r=t.get(n);if(void 0!==r)e=r;else{const r=this.stableStringify(n);e=r,t.set(n,r)}}else e=n;if(r.has(e))throw new Error("Array must contain unique items");r.add(e)}}stableStringify(e){const r=new WeakSet,t=(e,n=0)=>{if(n>100)return'"[Max Depth Exceeded]"';if(null===e)return"null";if(void 0===e)return"undefined";if("object"!=typeof e)return JSON.stringify(e);if(r.has(e))return'"[Circular]"';r.add(e);try{if(Array.isArray(e)){return`[${e.map(e=>t(e,n+1)).join(",")}]`}const r=Object.keys(e).sort();return`{${r.map(r=>`${JSON.stringify(r)}:${t(e[r],n+1)}`).join(",")}}`}finally{r.delete(e)}};try{return t(e)}catch{return String(e)}}min(e,t){return new VldArray({...this.config,minLength:e,errorMessage:t||r.getMessages().arrayMin(e)})}max(e,t){return new VldArray({...this.config,maxLength:e,errorMessage:t||r.getMessages().arrayMax(e)})}length(e,t){return new VldArray({...this.config,exactLength:e,minLength:void 0,maxLength:void 0,errorMessage:t||r.getMessages().arrayLength(e)})}nonempty(e){return new VldArray({...this.config,minLength:1,errorMessage:e||r.getMessages().arrayEmpty})}unique(e){return new VldArray({...this.config,unique:!0,errorMessage:e||"Array must contain unique items"})}between(e,r,t){return new VldArray({...this.config,minLength:e,maxLength:r,errorMessage:t||`Array length must be between ${e} and ${r}`})}}exports.VldArray=VldArray;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../registry.cjs");const s={STRING:"string",STRING_FORMAT:"stringFormat",STRING_BOOL:"stringBool",NUMBER:"number",BOOLEAN:"boolean",DATE:"date",BIGINT:"bigint",UNDEFINED:"undefined",NULL:"null",UNKNOWN:"unknown",ANY:"any",VOID:"void",NEVER:"never",SYMBOL:"symbol",NAN:"nan",HEX:"hex",BASE64:"base64",UINT8_ARRAY:"uint8Array",COERCE_STRING:"coerceString",COERCE_NUMBER:"coerceNumber",COERCE_BOOLEAN:"coerceBoolean",COERCE_DATE:"coerceDate",COERCE_BIGINT:"coerceBigint",OBJECT:"object",ARRAY:"array",TUPLE:"tuple",SET:"set",MAP:"map",RECORD:"record",UNION:"union",DISCRIMINATED_UNION:"discriminatedUnion",INTERSECTION:"intersection",XOR:"xor",ENUM:"enum",LITERAL:"literal",LAZY:"lazy",CUSTOM:"custom",FUNCTION:"function",FILE:"file",JSON:"json",TEMPLATE_LITERAL:"templateLiteral",PROMISE:"promise",OPTIONAL:"optional",NULLABLE:"nullable",NULLISH:"nullish",EXACT_OPTIONAL:"exactOptional",DEFAULT:"default",CATCH:"catch",REFINE:"refine",TRANSFORM:"transform",PIPE:"pipe",PREPROCESS:"preprocess",SUPER_REFINE:"superRefine",BRAND:"brand",READONLY:"readonly",META:"meta",PREFAULT:"prefault",PREFault:"prefault",CODEC:"codec"};function r(e,s){return"string"==typeof e?e:"string"==typeof e?.error?e.error:"function"==typeof e?.error?e.error({})||s:"string"==typeof e?.message?e.message:s}function t(e){return null!==e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}let a;function n(e){return"function"==typeof e?e():function(e){if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(null!==e&&"object"==typeof e){const s=Object.getPrototypeOf(e);if(s===Object.prototype||null===s)return{...e}}return e}(e)}function i(e){if(!0===e.isSimple)switch(e.validatorType){case s.STRING:return"string";case s.NUMBER:return"number";case s.BOOLEAN:return"boolean";case s.BIGINT:return"bigint";case s.SYMBOL:return"symbol";default:return}}function o(e,s){switch(e){case"string":return"string"==typeof s?s:void 0;case"number":return"number"!=typeof s||isNaN(s)?void 0:s;case"boolean":return"boolean"==typeof s?s:void 0;case"bigint":return"bigint"==typeof s?s:void 0;case"symbol":return"symbol"==typeof s?s:void 0;default:return}}class VldBase{constructor(e="unknown"){this.validatorType=e}get"~standard"(){return{version:1,vendor:"vld",validate:e=>{const s=this.safeParse(e);return s.success?{value:s.data}:{issues:[{message:s.error.message}]}},types:void 0}}async parseAsync(e){return this.parse(e)}async safeParseAsync(e){try{return{success:!0,data:await this.parseAsync(e)}}catch(e){return{success:!1,error:e}}}decode(e){return this.parse(e)}safeDecode(e){return this.safeParse(e)}async decodeAsync(e){return this.parseAsync(e)}async safeDecodeAsync(e){return this.safeParseAsync(e)}encode(e){return this.parse(e)}safeEncode(e){const s=this.safeParse(e);return s.success?{success:!0,data:s.data}:s}async encodeAsync(e){return this.parseAsync(e)}async safeEncodeAsync(e){const s=await this.safeParseAsync(e);return s.success?{success:!0,data:s.data}:s}spa(e){return this.safeParseAsync(e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}clone(){return this}isValid(e){return this.safeParse(e).success}parseOrDefault(e,s){const r=this.safeParse(e);if(r.success)return r.data;const t=this.safeParse(s);if(!t.success)throw new Error(`Invalid default value provided: ${t.error.message}`);return t.data}refine(e,s){return new VldRefine(this,e,s)}superRefine(e){return new VldSuperRefine(this,e)}transform(e){return new VldTransform(this,e)}default(e){return new VldDefault(this,e)}prefault(e){return new VldPrefault(this,e)}nonoptional(e){return new VldRefine(this,e=>void 0!==e,r(e,"Expected non-optional value"))}array(){return a.array(this)}or(e){return a.union(this,e)}and(e){return a.intersection(this,e)}overwrite(e){return new VldTransform(this,e)}with(...e){return new VldSuperRefine(this,(s,r)=>{const a={value:s,issues:[]},n=[];for(const s of e){const e="function"==typeof s?s:s._zod?.check;if(!e)continue;const r=e(a);t(r)&&n.push(Promise.resolve(r))}const i=()=>{for(const e of a.issues)r.addIssue(void 0===e.code?{message:e.message||"Custom check failed"}:{message:e.message||"Custom check failed",code:e.code})};if(n.length>0)return Promise.all(n).then(i);i()})}toJSONSchema(e){return a.toJSONSchema(this,e)}catch(e){return new VldCatch(this,e)}optional(){return new VldOptional(this)}nullable(){return new VldNullable(this)}nullish(){return new VldNullish(this)}exactOptional(){return new VldExactOptional(this)}pipe(e){return new VldPipe(this,e)}readonly(){return new VldReadonly(this)}brand(){return new VldBrand(this)}apply(e){return e(this)}check(e,s){return new VldRefine(this,e,s)}meta(s){if(void 0===s)return e.globalRegistry.get(this);const r=new VldMeta(this,s);return e.globalRegistry.add(r,s),r}register(e,s){return e.add(this,s),this}describe(e){return this.meta({description:e})}get description(){return this.meta()?.description}}class VldMeta extends VldBase{constructor(e,r){super(s.META),this.baseValidator=e,this.metadata=r}parse(e){return this.baseValidator.parse(e)}safeParse(e){return this.baseValidator.safeParse(e)}getMeta(){return{...this.metadata}}meta(s){if(void 0===s)return{...this.metadata,...e.globalRegistry.get(this)};const r=new VldMeta(this.baseValidator,{...this.metadata,...s});return e.globalRegistry.add(r,r.getMeta()),r}describe(e){return this.meta({description:e})}}class VldReadonly extends VldBase{constructor(e){super(s.READONLY),this.baseValidator=e}parse(e){return this.baseValidator.parse(e)}safeParse(e){const s=this.baseValidator.safeParse(e);return s.success?{success:!0,data:s.data}:{success:!1,error:s.error}}}class VldBrand extends VldBase{constructor(e){super(s.BRAND),this.baseValidator=e}parse(e){return this.baseValidator.parse(e)}safeParse(e){const s=this.baseValidator.safeParse(e);return s.success?{success:!0,data:s.data}:{success:!1,error:s.error}}}class VldRefine extends VldBase{constructor(e,r,t){super(s.REFINE),this.baseValidator=e,this.predicate=r,this.customMessage=t}parse(e){const s=this.baseValidator.parse(e),r=this.predicate(s);if(t(r))throw new Error("Use parseAsync for async refinements");if(!r)throw new Error(this.customMessage||"Refinement check failed");return s}safeParse(e){try{return{success:!0,data:this.parse(e)}}catch(e){return{success:!1,error:e}}}async parseAsync(e){const s=await this.baseValidator.parseAsync(e);if(!await this.predicate(s))throw new Error(this.customMessage||"Refinement check failed");return s}}class VldTransform extends VldBase{constructor(e,r){super(s.TRANSFORM),this.baseValidator=e,this.transformer=r}parse(e){const s=this.baseValidator.parse(e);try{const e=this.transformer(s);if(t(e))throw new Error("Use parseAsync for async transforms");return e}catch(e){throw new Error(`Transform failed: ${e.message}`)}}safeParse(e){try{return{success:!0,data:this.parse(e)}}catch(e){return{success:!1,error:e}}}async parseAsync(e){const s=await this.baseValidator.parseAsync(e);try{return await this.transformer(s)}catch(e){throw new Error(`Transform failed: ${e.message}`)}}}class VldDefault extends VldBase{constructor(e,r){super(s.DEFAULT),this.baseValidator=e,this.defaultValue=r}parse(e){return void 0===e?n(this.defaultValue):this.baseValidator.parse(e)}safeParse(e){return void 0===e?{success:!0,data:n(this.defaultValue)}:this.baseValidator.safeParse(e)}prefault(e){return new VldPrefault(this.baseValidator,void 0===e?this.defaultValue:e)}unwrap(){return this.baseValidator}removeDefault(){return this.baseValidator}}class VldPrefault extends VldBase{constructor(e,r){super(s.PREFAULT),this.baseValidator=e,this.defaultValue=r}parse(e){return void 0===e?this.baseValidator.parse(n(this.defaultValue)):this.baseValidator.parse(e)}safeParse(e){return void 0===e?this.baseValidator.safeParse(n(this.defaultValue)):this.baseValidator.safeParse(e)}prefault(e){return void 0===e?this:new VldPrefault(this.baseValidator,e)}unwrap(){return this.baseValidator}}class VldCatch extends VldBase{constructor(e,r){super(s.CATCH),this.baseValidator=e,this.fallbackValue=r,this.simpleMode=i(e);const t=e.safeParse(r);if(!t.success)throw new Error(`Invalid fallback value: ${t.error.message}`)}parse(e){const s=o(this.simpleMode,e);if(void 0!==s)return s;if(void 0!==this.simpleMode)return this.fallbackValue;try{return this.baseValidator.parse(e)}catch{return this.fallbackValue}}safeParse(e){const s=o(this.simpleMode,e);if(void 0!==s)return{success:!0,data:s};if(void 0!==this.simpleMode)return{success:!0,data:this.fallbackValue};const r=this.baseValidator.safeParse(e);return r.success?r:{success:!0,data:this.fallbackValue}}}class VldOptional extends VldBase{constructor(e){super(s.OPTIONAL),this.baseValidator=e,this.simpleMode=i(e)}parseSimpleValue(e){return o(this.simpleMode,e)}static create(e){return new VldOptional(e)}parse(e){if(void 0===e)return;const s=this.parseSimpleValue(e);return void 0!==s?s:this.baseValidator.parse(e)}safeParse(e){if(void 0===e)return{success:!0,data:void 0};const s=this.parseSimpleValue(e);return void 0!==s?{success:!0,data:s}:this.baseValidator.safeParse(e)}unwrap(){return this.baseValidator}}class VldExactOptional extends VldBase{constructor(e){super(s.EXACT_OPTIONAL),this.baseValidator=e,this.simpleMode=i(e)}static create(e){return new VldExactOptional(e)}parse(e){if(void 0===e)return;const s=o(this.simpleMode,e);return void 0!==s?s:this.baseValidator.parse(e)}safeParse(e){if(void 0===e)return{success:!0,data:void 0};const s=o(this.simpleMode,e);return void 0!==s?{success:!0,data:s}:this.baseValidator.safeParse(e)}unwrap(){return this.baseValidator}}class VldNullable extends VldBase{constructor(e){super(s.NULLABLE),this.baseValidator=e,this.simpleMode=i(e)}static create(e){return new VldNullable(e)}parse(e){if(null===e)return null;const s=o(this.simpleMode,e);return void 0!==s?s:this.baseValidator.parse(e)}safeParse(e){if(null===e)return{success:!0,data:null};const s=o(this.simpleMode,e);return void 0!==s?{success:!0,data:s}:this.baseValidator.safeParse(e)}unwrap(){return this.baseValidator}}class VldNullish extends VldBase{constructor(e){super(s.NULLISH),this.baseValidator=e,this.simpleMode=i(e)}static create(e){return new VldNullish(e)}parse(e){if(null==e)return e;const s=o(this.simpleMode,e);return void 0!==s?s:this.baseValidator.parse(e)}safeParse(e){if(null==e)return{success:!0,data:e};const s=o(this.simpleMode,e);return void 0!==s?{success:!0,data:s}:this.baseValidator.safeParse(e)}unwrap(){return this.baseValidator}}class VldPipe extends VldBase{constructor(e,r){super(s.PIPE),this.first=e,this.second=r}parse(e){const s=this.first.parse(e);return this.second.parse(s)}safeParse(e){const s=this.first.safeParse(e);return s.success?this.second.safeParse(s.data):{success:!1,error:s.error}}}class VldSuperRefine extends VldBase{constructor(e,r){super(s.SUPER_REFINE),this._inner=e,this._refinement=r}parse(e){const s=this._inner.parse(e),r=[],t={addIssue:e=>r.push(e),path:[]};if(this._refinement(s,t)instanceof Promise)throw new Error("Use parseAsync for async refinements");if(r.length>0)throw new Error(r.map(e=>e.message).join("; "));return s}safeParse(e){const s=this._inner.safeParse(e);if(!s.success)return{success:!1,error:s.error};const r=[],t={addIssue:e=>r.push(e),path:[]};if(this._refinement(s.data,t)instanceof Promise)throw new Error("Use safeParseAsync for async refinements");return r.length>0?{success:!1,error:new Error(r.map(e=>e.message).join("; "))}:s}async parseAsync(e){const s=await this._inner.parseAsync(e),r=[],t={addIssue:e=>r.push(e),path:[]};if(await this._refinement(s,t),r.length>0)throw new Error(r.map(e=>e.message).join("; "));return s}async safeParseAsync(e){try{return{success:!0,data:await this.parseAsync(e)}}catch(e){return{success:!1,error:e}}}}class VldPreprocess extends VldBase{constructor(e,r){super(s.PREPROCESS),this._preprocessor=e,this._schema=r}static create(e,s){return new VldPreprocess(e,s)}parse(e){const s=this._preprocessor(e);return this._schema.parse(s)}safeParse(e){try{const s=this._preprocessor(e);return this._schema.safeParse(s)}catch(e){return{success:!1,error:e}}}}exports.VLD_VALIDATOR_TYPES=s,exports.VldBase=VldBase,exports.VldBrand=VldBrand,exports.VldCatch=VldCatch,exports.VldDefault=VldDefault,exports.VldExactOptional=VldExactOptional,exports.VldMeta=VldMeta,exports.VldNullable=VldNullable,exports.VldNullish=VldNullish,exports.VldOptional=VldOptional,exports.VldPipe=VldPipe,exports.VldPrefault=VldPrefault,exports.VldPreprocess=VldPreprocess,exports.VldReadonly=VldReadonly,exports.VldRefine=VldRefine,exports.VldSuperRefine=VldSuperRefine,exports.VldTransform=VldTransform,exports.configureSchemaCompositionFactories=function(e){a=e},exports.resolveErrorMessage=r;
|
|
1
|
+
"use strict";var e=require("../registry.cjs"),t=require("../chunks/errors-core-DrydF46s.cjs");function s(e){if(e instanceof t.VldError)return e;const s=e instanceof Error?e.message:String(e);return new t.VldError([{code:"custom",path:[],message:s}])}const r={STRING:"string",STRING_FORMAT:"stringFormat",STRING_BOOL:"stringBool",NUMBER:"number",BOOLEAN:"boolean",DATE:"date",BIGINT:"bigint",UNDEFINED:"undefined",NULL:"null",UNKNOWN:"unknown",ANY:"any",VOID:"void",NEVER:"never",SYMBOL:"symbol",NAN:"nan",HEX:"hex",BASE64:"base64",UINT8_ARRAY:"uint8Array",COERCE_STRING:"coerceString",COERCE_NUMBER:"coerceNumber",COERCE_BOOLEAN:"coerceBoolean",COERCE_DATE:"coerceDate",COERCE_BIGINT:"coerceBigint",OBJECT:"object",ARRAY:"array",TUPLE:"tuple",SET:"set",MAP:"map",RECORD:"record",UNION:"union",DISCRIMINATED_UNION:"discriminatedUnion",INTERSECTION:"intersection",XOR:"xor",ENUM:"enum",LITERAL:"literal",LAZY:"lazy",CUSTOM:"custom",FUNCTION:"function",FILE:"file",JSON:"json",TEMPLATE_LITERAL:"templateLiteral",PROMISE:"promise",OPTIONAL:"optional",NULLABLE:"nullable",NULLISH:"nullish",EXACT_OPTIONAL:"exactOptional",DEFAULT:"default",CATCH:"catch",REFINE:"refine",TRANSFORM:"transform",PIPE:"pipe",PREPROCESS:"preprocess",SUPER_REFINE:"superRefine",BRAND:"brand",READONLY:"readonly",META:"meta",PREFAULT:"prefault",PREFault:"prefault",CODEC:"codec"};function a(e,t){if("string"==typeof e)return e;if("function"==typeof e){const s=e(void 0);return"string"==typeof s?s:"object"==typeof s&&s?.message?s.message:t}if("object"==typeof e&&null!==e){if("string"==typeof e.error)return e.error;if("function"==typeof e.error)return e.error({})||t;if("string"==typeof e.message)return e.message}return t}function i(e){return null!==e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}let n;function o(e){return"function"==typeof e?e():function(e){if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(null!==e&&"object"==typeof e){const t=Object.getPrototypeOf(e);if(t===Object.prototype||null===t)return{...e}}return e}(e)}function h(e){if(!0===e.isSimple)switch(e.validatorType){case r.STRING:return"string";case r.NUMBER:return"number";case r.BOOLEAN:return"boolean";case r.BIGINT:return"bigint";case r.SYMBOL:return"symbol";default:return}}function l(e,t){switch(e){case"string":return"string"==typeof t?t:void 0;case"number":return"number"!=typeof t||isNaN(t)?void 0:t;case"boolean":return"boolean"==typeof t?t:void 0;case"bigint":return"bigint"==typeof t?t:void 0;case"symbol":return"symbol"==typeof t?t:void 0;default:return}}class VldBase{constructor(e="unknown"){this.validatorType=e}get type(){return this.validatorType}get _def(){return{typeName:"Zod"+this.validatorType.charAt(0).toUpperCase()+this.validatorType.slice(1),...this.config||{}}}get def(){return this._def}get _zod(){return this._def}get"~standard"(){return{version:1,vendor:"vld",validate:e=>{const t=this.safeParse(e);return t.success?{value:t.data}:{issues:[{message:t.error.message}]}},types:void 0}}async parseAsync(e){return this.parse(e)}async safeParseAsync(e){try{return{success:!0,data:await this.parseAsync(e)}}catch(e){return{success:!1,error:s(e)}}}decode(e){return this.parse(e)}safeDecode(e){return this.safeParse(e)}async decodeAsync(e){return this.parseAsync(e)}async safeDecodeAsync(e){return this.safeParseAsync(e)}encode(e){return this.parse(e)}safeEncode(e){const t=this.safeParse(e);return t.success?{success:!0,data:t.data}:t}async encodeAsync(e){return this.parseAsync(e)}async safeEncodeAsync(e){const t=await this.safeParseAsync(e);return t.success?{success:!0,data:t.data}:t}spa(e){return this.safeParseAsync(e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}clone(){return this}isValid(e){return this.safeParse(e).success}parseOrDefault(e,t){const s=this.safeParse(e);if(s.success)return s.data;const r=this.safeParse(t);if(!r.success)throw new Error(`Invalid default value provided: ${r.error.message}`);return r.data}refine(e,t){return new VldRefine(this,e,t)}superRefine(e){return new VldSuperRefine(this,e)}transform(e){return new VldTransform(this,e)}default(e){return new VldDefault(this,e)}prefault(e){return new VldPrefault(this,e)}nonoptional(e){return new VldRefine(this,e=>void 0!==e,a(e,"Expected non-optional value"))}array(){return n.array(this)}or(e){return n.union(this,e)}and(e){return n.intersection(this,e)}overwrite(e){return new VldTransform(this,e)}with(...e){return new VldSuperRefine(this,(t,s)=>{const r={value:t,issues:[]},a=[];for(const t of e){const e="function"==typeof t?t:t._zod?.check;if(!e)continue;const s=e(r);i(s)&&a.push(Promise.resolve(s))}const n=()=>{for(const e of r.issues)s.addIssue(void 0===e.code?{message:e.message||"Custom check failed"}:{message:e.message||"Custom check failed",code:e.code})};if(a.length>0)return Promise.all(a).then(n);n()})}toJSONSchema(e){return n.toJSONSchema(this,e)}catch(e){return new VldCatch(this,e)}optional(){return new VldOptional(this)}nullable(){return new VldNullable(this)}nullish(){return new VldNullish(this)}exactOptional(){return new VldExactOptional(this)}pipe(e){return new VldPipe(this,e)}readonly(){return new VldReadonly(this)}brand(){return new VldBrand(this)}apply(e){return e(this)}check(e,t){return this.refine(e,t)}meta(t){if(void 0===t)return e.globalRegistry.get(this)??this.baseValidator?.meta?.()??this.schema?.meta?.()??this.inner?.meta?.();const s=new VldMeta(this,t);return e.globalRegistry.add(s,t),s}register(e,t){return e.add(this,t),this}describe(e){return this.meta({description:e})}get description(){return this.meta()?.description??this.baseValidator?.description??this.schema?.description??this.inner?.description}}class VldMeta extends VldBase{constructor(e,t){super(r.META),this.baseValidator=e,this.metadata=t}parse(e){return this.baseValidator.parse(e)}safeParse(e){return this.baseValidator.safeParse(e)}getMeta(){return{...this.metadata}}meta(t){if(void 0===t)return{...this.metadata,...e.globalRegistry.get(this)};const s=new VldMeta(this.baseValidator,{...this.metadata,...t});return e.globalRegistry.add(s,s.getMeta()),s}describe(e){return this.meta({description:e})}}class VldReadonly extends VldBase{constructor(e){super(r.READONLY),this.baseValidator=e}parse(e){return this.baseValidator.parse(e)}safeParse(e){const t=this.baseValidator.safeParse(e);return t.success?{success:!0,data:t.data}:{success:!1,error:t.error}}}class VldBrand extends VldBase{constructor(e){super(r.BRAND),this.baseValidator=e}parse(e){return this.baseValidator.parse(e)}safeParse(e){const t=this.baseValidator.safeParse(e);return t.success?{success:!0,data:t.data}:{success:!1,error:t.error}}}class VldRefine extends VldBase{constructor(e,t,s){super(r.REFINE),this.baseValidator=e,this.predicate=t,this.customMessage=s??"Refinement check failed","object"==typeof s&&null!==s&&"path"in s&&Array.isArray(s.path)&&(this.refinePath=s.path)}_createIssue(e){if("function"==typeof this.customMessage){const t=this.customMessage(e);return"string"==typeof t?{code:"custom",path:this.refinePath??[],message:t}:{code:"custom",path:t?.path??this.refinePath??[],message:t?.message??"Refinement check failed"}}if("object"==typeof this.customMessage&&null!==this.customMessage){const e=this.customMessage.message??this.customMessage.error,t="function"==typeof e?e({}):"string"==typeof e?e:"Refinement check failed";return{code:"custom",path:this.customMessage.path??this.refinePath??[],message:t}}return{code:"custom",path:this.refinePath??[],message:"string"==typeof this.customMessage?this.customMessage:"Refinement check failed"}}parse(e){const s=this.baseValidator.parse(e),r=this.predicate(s);if(i(r))throw new Error("Use parseAsync for async refinements");if(!r)throw new t.VldError([this._createIssue(s)]);return s}safeParse(e){try{return{success:!0,data:this.parse(e)}}catch(e){return{success:!1,error:s(e)}}}async parseAsync(e){const s=await this.baseValidator.parseAsync(e);if(!await this.predicate(s))throw new t.VldError([this._createIssue(s)]);return s}async safeParseAsync(e){try{return{success:!0,data:await this.parseAsync(e)}}catch(e){return{success:!1,error:s(e)}}}_wrap(e){return new VldRefine(e,this.predicate,this.customMessage)}min(e,t){return this._wrap(this.baseValidator.min?.(e,t)??this.baseValidator)}max(e,t){return this._wrap(this.baseValidator.max?.(e,t)??this.baseValidator)}length(e,t){return this._wrap(this.baseValidator.length?.(e,t)??this.baseValidator)}email(e){return this._wrap(this.baseValidator.email?.(e)??this.baseValidator)}url(e){return this._wrap(this.baseValidator.url?.(e)??this.baseValidator)}uuid(e){return this._wrap(this.baseValidator.uuid?.(e)??this.baseValidator)}regex(e,t){return this._wrap(this.baseValidator.regex?.(e,t)??this.baseValidator)}startsWith(e,t){return this._wrap(this.baseValidator.startsWith?.(e,t)??this.baseValidator)}endsWith(e,t){return this._wrap(this.baseValidator.endsWith?.(e,t)??this.baseValidator)}includes(e,t){return this._wrap(this.baseValidator.includes?.(e,t)??this.baseValidator)}ip(e){return this._wrap(this.baseValidator.ip?.(e)??this.baseValidator)}ipv4(e){return this._wrap(this.baseValidator.ipv4?.(e)??this.baseValidator)}ipv6(e){return this._wrap(this.baseValidator.ipv6?.(e)??this.baseValidator)}nonempty(e){return this._wrap(this.baseValidator.nonempty?.(e)??this.baseValidator)}trim(){return this._wrap(this.baseValidator.trim?.()??this.baseValidator)}toLowerCase(){return this._wrap(this.baseValidator.toLowerCase?.()??this.baseValidator)}lowercase(){return this.toLowerCase()}toUpperCase(){return this._wrap(this.baseValidator.toUpperCase?.()??this.baseValidator)}uppercase(){return this.toUpperCase()}positive(e){return this._wrap(this.baseValidator.positive?.(e)??this.baseValidator)}negative(e){return this._wrap(this.baseValidator.negative?.(e)??this.baseValidator)}nonnegative(e){return this._wrap(this.baseValidator.nonnegative?.(e)??this.baseValidator)}nonpositive(e){return this._wrap(this.baseValidator.nonpositive?.(e)??this.baseValidator)}int(e){return this._wrap(this.baseValidator.int?.(e)??this.baseValidator)}finite(e){return this._wrap(this.baseValidator.finite?.(e)??this.baseValidator)}safe(e){return this._wrap(this.baseValidator.safe?.(e)??this.baseValidator)}multipleOf(e,t){return this._wrap(this.baseValidator.multipleOf?.(e,t)??this.baseValidator)}step(e,t){return this._wrap(this.baseValidator.step?.(e,t)??this.baseValidator)}gt(e,t){return this._wrap(this.baseValidator.gt?.(e,t)??this.baseValidator)}gte(e,t){return this._wrap(this.baseValidator.gte?.(e,t)??this.baseValidator)}lt(e,t){return this._wrap(this.baseValidator.lt?.(e,t)??this.baseValidator)}lte(e,t){return this._wrap(this.baseValidator.lte?.(e,t)??this.baseValidator)}extend(e){return this._wrap(this.baseValidator.extend?.(e)??this.baseValidator)}merge(e){return this._wrap(this.baseValidator.merge?.(e)??this.baseValidator)}pick(...e){return this._wrap(this.baseValidator.pick?.(...e)??this.baseValidator)}omit(...e){return this._wrap(this.baseValidator.omit?.(...e)??this.baseValidator)}partial(){return this._wrap(this.baseValidator.partial?.()??this.baseValidator)}required(){return this._wrap(this.baseValidator.required?.()??this.baseValidator)}strict(e){return this._wrap(this.baseValidator.strict?.(e)??this.baseValidator)}passthrough(){return this._wrap(this.baseValidator.passthrough?.()??this.baseValidator)}strip(){return this._wrap(this.baseValidator.strip?.()??this.baseValidator)}catchall(e){return this._wrap(this.baseValidator.catchall?.(e)??this.baseValidator)}get shape(){return this.baseValidator.shape}get keyof(){return this.baseValidator.keyof}unwrap(){return this.baseValidator.unwrap?this.baseValidator.unwrap():this.baseValidator}get element(){return this.baseValidator.element}}class VldTransform extends VldBase{constructor(e,t){super(r.TRANSFORM),this.baseValidator=e,this.transformer=t}parse(e){const t=this.baseValidator.parse(e);try{const e=this.transformer(t);if(i(e))throw new Error("Use parseAsync for async transforms");return e}catch(e){throw new Error(`Transform failed: ${e.message}`)}}safeParse(e){try{return{success:!0,data:this.parse(e)}}catch(e){return{success:!1,error:s(e)}}}async parseAsync(e){const t=await this.baseValidator.parseAsync(e);try{return await this.transformer(t)}catch(e){throw new Error(`Transform failed: ${e.message}`)}}}class VldDefault extends VldBase{constructor(e,t){super(r.DEFAULT),this.baseValidator=e,this.defaultValue=t}parse(e){return void 0===e?o(this.defaultValue):this.baseValidator.parse(e)}safeParse(e){return void 0===e?{success:!0,data:o(this.defaultValue)}:this.baseValidator.safeParse(e)}prefault(e){return new VldPrefault(this.baseValidator,void 0===e?this.defaultValue:e)}unwrap(){return this.baseValidator}removeDefault(){return this.baseValidator}}class VldPrefault extends VldBase{constructor(e,t){super(r.PREFAULT),this.baseValidator=e,this.defaultValue=t}parse(e){return void 0===e?this.baseValidator.parse(o(this.defaultValue)):this.baseValidator.parse(e)}safeParse(e){return void 0===e?this.baseValidator.safeParse(o(this.defaultValue)):this.baseValidator.safeParse(e)}prefault(e){return void 0===e?this:new VldPrefault(this.baseValidator,e)}unwrap(){return this.baseValidator}}class VldCatch extends VldBase{constructor(e,t){super(r.CATCH),this.baseValidator=e,this.fallbackValue=t,this.simpleMode=h(e);const s=e.safeParse(t);if(!s.success)throw new Error(`Invalid fallback value: ${s.error.message}`)}parse(e){const t=l(this.simpleMode,e);if(void 0!==t)return t;if(void 0!==this.simpleMode)return this.fallbackValue;try{return this.baseValidator.parse(e)}catch{return this.fallbackValue}}safeParse(e){const t=l(this.simpleMode,e);if(void 0!==t)return{success:!0,data:t};if(void 0!==this.simpleMode)return{success:!0,data:this.fallbackValue};const s=this.baseValidator.safeParse(e);return s.success?s:{success:!0,data:this.fallbackValue}}}class VldOptional extends VldBase{constructor(e){super(r.OPTIONAL),this.baseValidator=e,this.simpleMode=h(e)}parseSimpleValue(e){return l(this.simpleMode,e)}static create(e){return new VldOptional(e)}parse(e){if(void 0===e)return;const t=this.parseSimpleValue(e);return void 0!==t?t:this.baseValidator.parse(e)}safeParse(e){if(void 0===e)return{success:!0,data:void 0};const t=this.parseSimpleValue(e);return void 0!==t?{success:!0,data:t}:this.baseValidator.safeParse(e)}unwrap(){return this.baseValidator}}class VldExactOptional extends VldBase{constructor(e){super(r.EXACT_OPTIONAL),this.baseValidator=e,this.simpleMode=h(e)}static create(e){return new VldExactOptional(e)}parse(e){if(void 0===e)return;const t=l(this.simpleMode,e);return void 0!==t?t:this.baseValidator.parse(e)}safeParse(e){if(void 0===e)return{success:!0,data:void 0};const t=l(this.simpleMode,e);return void 0!==t?{success:!0,data:t}:this.baseValidator.safeParse(e)}unwrap(){return this.baseValidator}}class VldNullable extends VldBase{constructor(e){super(r.NULLABLE),this.baseValidator=e,this.simpleMode=h(e)}static create(e){return new VldNullable(e)}parse(e){if(null===e)return null;const t=l(this.simpleMode,e);return void 0!==t?t:this.baseValidator.parse(e)}safeParse(e){if(null===e)return{success:!0,data:null};const t=l(this.simpleMode,e);return void 0!==t?{success:!0,data:t}:this.baseValidator.safeParse(e)}unwrap(){return this.baseValidator}}class VldNullish extends VldBase{constructor(e){super(r.NULLISH),this.baseValidator=e,this.simpleMode=h(e)}static create(e){return new VldNullish(e)}parse(e){if(null==e)return e;const t=l(this.simpleMode,e);return void 0!==t?t:this.baseValidator.parse(e)}safeParse(e){if(null==e)return{success:!0,data:e};const t=l(this.simpleMode,e);return void 0!==t?{success:!0,data:t}:this.baseValidator.safeParse(e)}unwrap(){return this.baseValidator}}class VldPipe extends VldBase{constructor(e,t){super(r.PIPE),this.first=e,this.second=t}parse(e){const t=this.first.parse(e);return this.second.parse(t)}safeParse(e){const t=this.first.safeParse(e);return t.success?this.second.safeParse(t.data):{success:!1,error:t.error}}}class VldSuperRefine extends VldBase{constructor(e,t){super(r.SUPER_REFINE),this._inner=e,this._refinement=t}parse(e){const s=this._inner.parse(e),r=[],a={addIssue:e=>{r.push({code:e.code||"custom",path:e.path??[],message:e.message||"Validation error"})},path:[]};if(this._refinement(s,a)instanceof Promise)throw new Error("Use parseAsync for async refinements");if(r.length>0)throw new t.VldError(r,r.map(e=>e.message).join("; "));return s}safeParse(e){const r=this._inner.safeParse(e);if(!r.success)return{success:!1,error:s(r.error)};const a=[],i={addIssue:e=>{a.push({code:e.code||"custom",path:e.path??[],message:e.message||"Validation error"})},path:[]};if(this._refinement(r.data,i)instanceof Promise)throw new Error("Use safeParseAsync for async refinements");return a.length>0?{success:!1,error:new t.VldError(a,a.map(e=>e.message).join("; "))}:r}async parseAsync(e){const s=await this._inner.parseAsync(e),r=[],a={addIssue:e=>{r.push({code:e.code||"custom",path:e.path??[],message:e.message||"Validation error"})},path:[]};if(await this._refinement(s,a),r.length>0)throw new t.VldError(r,r.map(e=>e.message).join("; "));return s}async safeParseAsync(e){try{return{success:!0,data:await this.parseAsync(e)}}catch(e){return{success:!1,error:s(e)}}}_wrap(e){return new VldSuperRefine(e,this._refinement)}min(e,t){return this._wrap(this._inner.min?.(e,t)??this._inner)}max(e,t){return this._wrap(this._inner.max?.(e,t)??this._inner)}length(e,t){return this._wrap(this._inner.length?.(e,t)??this._inner)}email(e){return this._wrap(this._inner.email?.(e)??this._inner)}url(e){return this._wrap(this._inner.url?.(e)??this._inner)}uuid(e){return this._wrap(this._inner.uuid?.(e)??this._inner)}regex(e,t){return this._wrap(this._inner.regex?.(e,t)??this._inner)}startsWith(e,t){return this._wrap(this._inner.startsWith?.(e,t)??this._inner)}endsWith(e,t){return this._wrap(this._inner.endsWith?.(e,t)??this._inner)}includes(e,t){return this._wrap(this._inner.includes?.(e,t)??this._inner)}ip(e){return this._wrap(this._inner.ip?.(e)??this._inner)}ipv4(e){return this._wrap(this._inner.ipv4?.(e)??this._inner)}ipv6(e){return this._wrap(this._inner.ipv6?.(e)??this._inner)}nonempty(e){return this._wrap(this._inner.nonempty?.(e)??this._inner)}trim(){return this._wrap(this._inner.trim?.()??this._inner)}toLowerCase(){return this._wrap(this._inner.toLowerCase?.()??this._inner)}lowercase(){return this.toLowerCase()}toUpperCase(){return this._wrap(this._inner.toUpperCase?.()??this._inner)}uppercase(){return this.toUpperCase()}positive(e){return this._wrap(this._inner.positive?.(e)??this._inner)}negative(e){return this._wrap(this._inner.negative?.(e)??this._inner)}nonnegative(e){return this._wrap(this._inner.nonnegative?.(e)??this._inner)}nonpositive(e){return this._wrap(this._inner.nonpositive?.(e)??this._inner)}int(e){return this._wrap(this._inner.int?.(e)??this._inner)}finite(e){return this._wrap(this._inner.finite?.(e)??this._inner)}safe(e){return this._wrap(this._inner.safe?.(e)??this._inner)}multipleOf(e,t){return this._wrap(this._inner.multipleOf?.(e,t)??this._inner)}step(e,t){return this._wrap(this._inner.step?.(e,t)??this._inner)}gt(e,t){return this._wrap(this._inner.gt?.(e,t)??this._inner)}gte(e,t){return this._wrap(this._inner.gte?.(e,t)??this._inner)}lt(e,t){return this._wrap(this._inner.lt?.(e,t)??this._inner)}lte(e,t){return this._wrap(this._inner.lte?.(e,t)??this._inner)}extend(e){return this._wrap(this._inner.extend?.(e)??this._inner)}merge(e){return this._wrap(this._inner.merge?.(e)??this._inner)}pick(...e){return this._wrap(this._inner.pick?.(...e)??this._inner)}omit(...e){return this._wrap(this._inner.omit?.(...e)??this._inner)}partial(){return this._wrap(this._inner.partial?.()??this._inner)}required(){return this._wrap(this._inner.required?.()??this._inner)}strict(e){return this._wrap(this._inner.strict?.(e)??this._inner)}passthrough(){return this._wrap(this._inner.passthrough?.()??this._inner)}strip(){return this._wrap(this._inner.strip?.()??this._inner)}catchall(e){return this._wrap(this._inner.catchall?.(e)??this._inner)}get shape(){return this._inner.shape}get keyof(){return this._inner.keyof}unwrap(){return this._inner.unwrap?this._inner.unwrap():this._inner}get element(){return this._inner.element}}class VldPreprocess extends VldBase{constructor(e,t){super(r.PREPROCESS),this._preprocessor=e,this._schema=t}static create(e,t){return new VldPreprocess(e,t)}parse(e){const t=this._preprocessor(e);return this._schema.parse(t)}safeParse(e){try{const t=this._preprocessor(e);return this._schema.safeParse(t)}catch(e){return{success:!1,error:s(e)}}}}exports.VLD_VALIDATOR_TYPES=r,exports.VldBase=VldBase,exports.VldBrand=VldBrand,exports.VldCatch=VldCatch,exports.VldDefault=VldDefault,exports.VldExactOptional=VldExactOptional,exports.VldMeta=VldMeta,exports.VldNullable=VldNullable,exports.VldNullish=VldNullish,exports.VldOptional=VldOptional,exports.VldPipe=VldPipe,exports.VldPrefault=VldPrefault,exports.VldPreprocess=VldPreprocess,exports.VldReadonly=VldReadonly,exports.VldRefine=VldRefine,exports.VldSuperRefine=VldSuperRefine,exports.VldTransform=VldTransform,exports.configureSchemaCompositionFactories=function(e){n=e},exports.ensureVldError=s,exports.isPromiseLike=i,exports.resolveErrorMessage=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./base.cjs"),s=require("../errors.cjs"),r=require("../locales/runtime.cjs"),a=require("../chunks/errors-core-
|
|
1
|
+
"use strict";var e=require("./base.cjs"),s=require("../errors.cjs"),r=require("../locales/runtime.cjs"),a=require("../chunks/errors-core-DrydF46s.cjs");require("../registry.cjs"),require("../pigment.cjs"),require("../locales/en.cjs");class VldBase64 extends e.VldBase{constructor(s=!1){super(e.VLD_VALIDATOR_TYPES.BASE64),this.urlSafe=s}parse(e){const s=this.safeParse(e);if(!s.success)throw s.error;return s.data}safeParse(e){if("string"!=typeof e)return{success:!1,error:new a.VldError([s.createIssue("invalid_type",[],r.getMessages().expectedString)])};return(this.urlSafe?VldBase64.BASE64_URL_REGEX:VldBase64.BASE64_REGEX).test(e)?!this.urlSafe&&e.length>0&&e.length%4!=0?{success:!1,error:new a.VldError([s.createIssue("custom",[],r.getMessages().invalidBase64)])}:{success:!0,data:e}:{success:!1,error:new a.VldError([s.createIssue("custom",[],r.getMessages().invalidBase64)])}}urlSafeMode(){return new VldBase64(!0)}static create(e=!1){return new VldBase64(e)}}VldBase64.BASE64_REGEX=/^[A-Za-z0-9+/]*={0,2}$/,VldBase64.BASE64_URL_REGEX=/^[A-Za-z0-9_-]*={0,2}$/,exports.VldBase64=VldBase64;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./base.cjs"),i=require("../locales/runtime.cjs"),n=require("../chunks/errors-core-
|
|
1
|
+
"use strict";var e=require("./base.cjs"),i=require("../locales/runtime.cjs"),n=require("../chunks/errors-core-DrydF46s.cjs");function t(e){return new n.VldError([{code:"invalid_type",path:[],message:e}])}require("../registry.cjs"),require("../locales/en.cjs");class VldBigInt extends e.VldBase{constructor(i){super(i?.validatorType||e.VLD_VALIDATOR_TYPES.BIGINT),this.config={checks:i?.checks||[],errorMessage:i?.errorMessage,jsonSchema:i?.jsonSchema},this._checks=this.config.checks,this._fastCheckMode=this.detectFastCheckMode()}get jsonSchema(){return this.config.jsonSchema}get isSimple(){return 0===this._checks.length}get minValue(){return this.config.jsonSchema?.minimum?BigInt(this.config.jsonSchema.minimum):null}get maxValue(){return this.config.jsonSchema?.maximum?BigInt(this.config.jsonSchema.maximum):null}get format(){return this.config.jsonSchema?.format??null}static create(){return new VldBigInt}detectFastCheckMode(){if(0===this._checks.length)return"none";if(1!==this._checks.length)return;const e=this.config.jsonSchema;return 0n===e?.exclusiveMinimum&&void 0===e.minimum&&void 0===e.maximum?"positive":0n===e?.exclusiveMaximum&&void 0===e.minimum&&void 0===e.maximum?"negative":0n===e?.minimum&&void 0===e.maximum&&void 0===e.exclusiveMaximum?"nonnegative":0n===e?.maximum&&void 0===e.minimum&&void 0===e.exclusiveMinimum?"nonpositive":void 0}getValidationError(){return new Error(this.config.errorMessage||i.getMessages().invalidBigint)}parse(e){if("bigint"!=typeof e)throw this.getValidationError();return this.parseKnownBigInt(e)}parseKnownBigInt(e){switch(this._fastCheckMode){case"none":return e;case"positive":if(e>0n)return e;throw this.getValidationError();case"negative":if(e<0n)return e;throw this.getValidationError();case"nonnegative":if(e>=0n)return e;throw this.getValidationError();case"nonpositive":if(e<=0n)return e;throw this.getValidationError()}for(const i of this._checks)if(!i(e))throw this.getValidationError();return e}safeParse(e){if("bigint"!=typeof e)return{success:!1,error:t(this.getValidationError().message)};try{return{success:!0,data:this.parseKnownBigInt(e)}}catch(e){return{success:!1,error:t(e.message)}}}min(e,i){return new VldBigInt({...this.config,checks:[...this.config.checks,i=>i>=e],errorMessage:i||`BigInt must be at least ${e}`,jsonSchema:{...this.config.jsonSchema,minimum:e}})}max(e,i){return new VldBigInt({...this.config,checks:[...this.config.checks,i=>i<=e],errorMessage:i||`BigInt must be at most ${e}`,jsonSchema:{...this.config.jsonSchema,maximum:e}})}positive(e){return new VldBigInt({...this.config,checks:[...this.config.checks,e=>e>0n],errorMessage:e||"BigInt must be positive",jsonSchema:{...this.config.jsonSchema,exclusiveMinimum:0n}})}negative(e){return new VldBigInt({...this.config,checks:[...this.config.checks,e=>e<0n],errorMessage:e||"BigInt must be negative",jsonSchema:{...this.config.jsonSchema,exclusiveMaximum:0n}})}nonnegative(e){return new VldBigInt({...this.config,checks:[...this.config.checks,e=>e>=0n],errorMessage:e||"BigInt must be non-negative",jsonSchema:{...this.config.jsonSchema,minimum:0n}})}nonpositive(e){return new VldBigInt({...this.config,checks:[...this.config.checks,e=>e<=0n],errorMessage:e||"BigInt must be non-positive",jsonSchema:{...this.config.jsonSchema,maximum:0n}})}gt(e,i){const n="bigint"==typeof e?e:BigInt(e);return new VldBigInt({...this.config,checks:[...this.config.checks,e=>e>n],errorMessage:i||`BigInt must be greater than ${n}`,jsonSchema:{...this.config.jsonSchema,exclusiveMinimum:n}})}lt(e,i){const n="bigint"==typeof e?e:BigInt(e);return new VldBigInt({...this.config,checks:[...this.config.checks,e=>e<n],errorMessage:i||`BigInt must be less than ${n}`,jsonSchema:{...this.config.jsonSchema,exclusiveMaximum:n}})}gte(e,i){const n="bigint"==typeof e?e:BigInt(e);return this.min(n,i)}lte(e,i){const n="bigint"==typeof e?e:BigInt(e);return this.max(n,i)}multipleOf(e,i){return new VldBigInt({...this.config,checks:[...this.config.checks,i=>i%e===0n],errorMessage:i||`BigInt must be a multiple of ${e}`,jsonSchema:{...this.config.jsonSchema,multipleOf:e}})}}exports.VldBigInt=VldBigInt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./base.cjs"),s=require("../chunks/errors-core-
|
|
1
|
+
"use strict";var e=require("./base.cjs"),s=require("../chunks/errors-core-DrydF46s.cjs");require("../registry.cjs");class VldBoolean extends e.VldBase{constructor(s,r){super(r||e.VLD_VALIDATOR_TYPES.BOOLEAN),this.errorMessage=s}get isSimple(){return!0}static create(){return new VldBoolean}parse(e){if("boolean"!=typeof e)throw new s.VldError([s.createInvalidTypeIssue("boolean",s.getTypeName(e),this.errorMessage)]);return e}parseKnownBoolean(e){return e}safeParse(e){return"boolean"==typeof e?{success:!0,data:e}:{success:!1,error:new s.VldError([s.createInvalidTypeIssue("boolean",s.getTypeName(e),this.errorMessage)])}}true(e){return new VldTrue(e||"Value must be true")}false(e){return new VldFalse(e||"Value must be false")}}class VldTrue extends VldBoolean{constructor(e){super(e),this.message=e}get isSimple(){return!1}parse(e){if(!0!==e)throw new s.VldError([{code:"custom",path:[],message:this.message}]);return!0}parseKnownBoolean(e){if(!0!==e)throw new s.VldError([{code:"custom",path:[],message:this.message}]);return!0}safeParse(e){return!0!==e?{success:!1,error:new s.VldError([{code:"custom",path:[],message:this.message}])}:{success:!0,data:!0}}}class VldFalse extends VldBoolean{constructor(e){super(e),this.message=e}get isSimple(){return!1}parse(e){if(!1!==e)throw new s.VldError([{code:"custom",path:[],message:this.message}]);return!1}parseKnownBoolean(e){if(!1!==e)throw new s.VldError([{code:"custom",path:[],message:this.message}]);return!1}safeParse(e){return!1!==e?{success:!1,error:new s.VldError([{code:"custom",path:[],message:this.message}])}:{success:!0,data:!1}}}exports.VldBoolean=VldBoolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./base.cjs"),r=require("../errors.cjs"),s=require("../locales/runtime.cjs"),c=require("../chunks/errors-core-
|
|
1
|
+
"use strict";var e=require("./base.cjs"),r=require("../errors.cjs"),s=require("../locales/runtime.cjs"),c=require("../chunks/errors-core-DrydF46s.cjs");require("../registry.cjs"),require("../pigment.cjs"),require("../locales/en.cjs");class VldCodec extends e.VldBase{constructor(r,s,c){super(e.VLD_VALIDATOR_TYPES.CODEC),this.inputValidator=r,this.outputValidator=s,this.codecTransform=c}parse(e){const r=this.safeParse(e);if(!r.success)throw r.error;return r.data}safeParse(e){const t=this.inputValidator.safeParse(e);if(!t.success)return{success:!1,error:t.error};try{const e=this.codecTransform.decode(t.data);if(e instanceof Promise)throw new c.VldError([r.createIssue("custom",[],s.getMessages().codecAsyncNotSupported)]);return this.outputValidator.safeParse(e)}catch(e){return e instanceof c.VldError?{success:!1,error:e}:{success:!1,error:new c.VldError([r.createIssue("custom",[],s.getMessages().codecDecodeFailed)])}}}invert(){return new VldCodec(this.outputValidator,this.inputValidator,{decode:this.codecTransform.encode,encode:this.codecTransform.decode})}encode(e){const r=this.safeEncode(e);if(!r.success)throw r.error;return r.data}safeEncode(e){const t=this.outputValidator.safeParse(e);if(!t.success)return{success:!1,error:t.error};try{const e=this.codecTransform.encode(t.data);if(e instanceof Promise)throw new c.VldError([r.createIssue("custom",[],s.getMessages().codecAsyncNotSupported)]);return this.inputValidator.safeParse(e)}catch(e){return e instanceof c.VldError?{success:!1,error:e}:{success:!1,error:new c.VldError([r.createIssue("custom",[],s.getMessages().codecEncodeFailed)])}}}async parseAsync(e){const r=await this.safeParseAsync(e);if(!r.success)throw r.error;return r.data}async safeParseAsync(e){const t=this.inputValidator.safeParse(e);if(!t.success)return{success:!1,error:t.error};try{const e=await this.codecTransform.decode(t.data);return this.outputValidator.safeParse(e)}catch(e){return e instanceof c.VldError?{success:!1,error:e}:{success:!1,error:new c.VldError([r.createIssue("custom",[],s.getMessages().codecDecodeFailed)])}}}async encodeAsync(e){const r=await this.safeEncodeAsync(e);if(!r.success)throw r.error;return r.data}async safeEncodeAsync(e){const t=this.outputValidator.safeParse(e);if(!t.success)return{success:!1,error:t.error};try{const e=await this.codecTransform.encode(t.data);return this.inputValidator.safeParse(e)}catch(e){return e instanceof c.VldError?{success:!1,error:e}:{success:!1,error:new c.VldError([r.createIssue("custom",[],s.getMessages().codecEncodeFailed)])}}}static create(e,r,s){return new VldCodec(e,r,s)}static invert(e){return e.invert()}}exports.VldCodec=VldCodec;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var s=require("./base.cjs");require("../registry.cjs");class VldCustom extends s.VldBase{constructor(
|
|
1
|
+
"use strict";var s=require("./base.cjs");require("../registry.cjs"),require("../chunks/errors-core-DrydF46s.cjs");class VldCustom extends s.VldBase{constructor(r){super(s.VLD_VALIDATOR_TYPES.CUSTOM),this._parseFn=r.parse,this._parseAsyncFn=r.parseAsync||(s=>Promise.resolve(this._parseFn(s))),this._safeParseFn=r.safeParse?e=>{const a=r.safeParse(e);return a.success?{success:!0,data:a.data}:{success:!1,error:s.ensureVldError(a.error)}}:r=>{try{return{success:!0,data:this._parseFn(r)}}catch(r){return{success:!1,error:s.ensureVldError(r)}}},this._safeParseAsyncFn=r.safeParseAsync?async e=>{const a=await r.safeParseAsync(e);return a.success?{success:!0,data:a.data}:{success:!1,error:s.ensureVldError(a.error)}}:async r=>{try{return{success:!0,data:await this._parseAsyncFn(r)}}catch(r){return{success:!1,error:s.ensureVldError(r)}}}}static create(s){return new VldCustom(s)}parse(s){return this._parseFn(s)}safeParse(s){return this._safeParseFn(s)}async parseAsync(s){return this._parseAsyncFn(s)}async safeParseAsync(s){return this._safeParseAsyncFn(s)}}exports.VldCustom=VldCustom,exports.custom=function(r,e){if("function"==typeof r){const a=r;return VldCustom.create({parse:r=>{if(!a(r))throw s.ensureVldError(s.resolveErrorMessage(e,"Custom validation failed"));return r}})}return r?VldCustom.create(r):VldCustom.create({parse:s=>s})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./base.cjs"),t=require("../locales/runtime.cjs"),s=require("../chunks/errors-core-
|
|
1
|
+
"use strict";var e=require("./base.cjs"),t=require("../locales/runtime.cjs"),s=require("../chunks/errors-core-DrydF46s.cjs");function n(e){return new s.VldError([{code:"invalid_date",path:[],message:e}])}require("../registry.cjs"),require("../locales/en.cjs");class VldDate extends e.VldBase{constructor(t){super(t?.validatorType||e.VLD_VALIDATOR_TYPES.DATE),this.config={checks:t?.checks||[],errorMessage:t?.errorMessage,jsonSchema:t?.jsonSchema},this._checks=this.config.checks,this._isSimple=0===this._checks.length}get jsonSchema(){return this.config.jsonSchema}get minDate(){const e=this.config.jsonSchema?.formatMinimum??this.config.jsonSchema?.minimum;return e?new Date(e):null}get maxDate(){const e=this.config.jsonSchema?.formatMaximum??this.config.jsonSchema?.maximum;return e?new Date(e):null}static create(){return new VldDate}parse(e){let s;if(e instanceof Date)s=e;else{if("string"!=typeof e&&"number"!=typeof e)throw new Error(this.config.errorMessage||t.getMessages().invalidDate);s=new Date(e)}if(isNaN(s.getTime()))throw new Error(this.config.errorMessage||t.getMessages().invalidDate);return this.parseValidDate(s)}parseKnownDate(e){if(isNaN(e.getTime()))throw new Error(this.config.errorMessage||t.getMessages().invalidDate);return this.parseValidDate(e)}parseValidDate(e){if(this._isSimple)return e;for(const t of this._checks)if(!t.fn(e))throw new Error(t.message);return e}safeParse(e){if(e instanceof Date)try{return{success:!0,data:this.parseKnownDate(e)}}catch(e){return{success:!1,error:n(e.message)}}try{return{success:!0,data:this.parse(e)}}catch(e){return{success:!1,error:n(e.message)}}}min(e,s){const n=e instanceof Date?e:new Date(e);if(isNaN(n.getTime()))throw new Error(`Invalid date provided to min(): ${e}`);return new VldDate({...this.config,checks:[...this.config.checks,{fn:e=>e>=n,message:s||t.getMessages().dateMin(n)}],jsonSchema:{...this.config.jsonSchema,formatMinimum:n.toISOString()}})}max(e,s){const n=e instanceof Date?e:new Date(e);if(isNaN(n.getTime()))throw new Error(`Invalid date provided to max(): ${e}`);return new VldDate({...this.config,checks:[...this.config.checks,{fn:e=>e<=n,message:s||t.getMessages().dateMax(n)}],jsonSchema:{...this.config.jsonSchema,formatMaximum:n.toISOString()}})}between(e,t,s){const n=e instanceof Date?e:new Date(e),a=t instanceof Date?t:new Date(t);if(isNaN(n.getTime()))throw new Error(`Invalid min date provided to between(): ${e}`);if(isNaN(a.getTime()))throw new Error(`Invalid max date provided to between(): ${t}`);return new VldDate({...this.config,checks:[...this.config.checks,{fn:e=>e>=n&&e<=a,message:s||`Date must be between ${n.toISOString()} and ${a.toISOString()}`}],jsonSchema:{...this.config.jsonSchema,formatMinimum:n.toISOString(),formatMaximum:a.toISOString()}})}past(e){const t=new Date;return new VldDate({...this.config,checks:[...this.config.checks,{fn:e=>e<t,message:e||"Date must be in the past"}],jsonSchema:{...this.config.jsonSchema,formatExclusiveMaximum:t.toISOString()}})}future(e){const t=new Date;return new VldDate({...this.config,checks:[...this.config.checks,{fn:e=>e>t,message:e||"Date must be in the future"}],jsonSchema:{...this.config.jsonSchema,formatExclusiveMinimum:t.toISOString()}})}today(e){const t=new Date,s=t.getFullYear(),n=t.getMonth(),a=t.getDate();return new VldDate({...this.config,checks:[...this.config.checks,{fn:e=>e.getFullYear()===s&&e.getMonth()===n&&e.getDate()===a,message:e||"Date must be today"}]})}weekday(e){return new VldDate({...this.config,checks:[...this.config.checks,{fn:e=>{const t=e.getDay();return t>=1&&t<=5},message:e||"Date must be a weekday"}]})}weekend(e){return new VldDate({...this.config,checks:[...this.config.checks,{fn:e=>{const t=e.getDay();return 0===t||6===t},message:e||"Date must be a weekend"}]})}gt(e,t){const s=e instanceof Date?e:new Date(e);return new VldDate({...this.config,checks:[...this.config.checks,{fn:e=>e.getTime()>s.getTime(),message:t||`Date must be greater than ${s.toISOString()}`}],jsonSchema:{...this.config.jsonSchema,formatExclusiveMinimum:s.toISOString()}})}lt(e,t){const s=e instanceof Date?e:new Date(e);return new VldDate({...this.config,checks:[...this.config.checks,{fn:e=>e.getTime()<s.getTime(),message:t||`Date must be less than ${s.toISOString()}`}],jsonSchema:{...this.config.jsonSchema,formatExclusiveMaximum:s.toISOString()}})}}exports.VldDate=VldDate;
|