@nullix/zod-mongoose-studio 3.3.1 → 3.3.3
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{BCIlnd0g.js → 5ZXm4f56.js} +1 -1
- package/.output/public/_nuxt/{DcJ7oPvZ.js → B2fcLSyW.js} +1 -1
- package/.output/public/_nuxt/{B0N6xv5E.js → BBN7l5Hn.js} +1 -1
- package/.output/public/_nuxt/BBTTtb8r.js +41 -0
- package/.output/public/_nuxt/{5Tu2WUJz.js → BDbISGvP.js} +1 -1
- package/.output/public/_nuxt/{D87QMS6j.js → BijI4RNx.js} +1 -1
- package/.output/public/_nuxt/{C2BHp-MG.js → Bp9qkJ9m.js} +1 -1
- package/.output/public/_nuxt/{I3Ucam2s.js → Bu3-sqCf.js} +1 -1
- package/.output/public/_nuxt/{BO4hqv6q.js → C-FtTvwz.js} +1 -1
- package/.output/public/_nuxt/C02JV0Aj.js +1 -0
- package/.output/public/_nuxt/{sKEJiAHO.js → C1UkIsDc.js} +1 -1
- package/.output/public/_nuxt/{CKULsFUz.js → CJT28r6J.js} +1 -1
- package/.output/public/_nuxt/{BNDnV2op.js → CL7qtgl2.js} +3 -3
- package/.output/public/_nuxt/{DA0pQuyP.js → CRMd2YH2.js} +3 -3
- package/.output/public/_nuxt/{DpKrXpkK.js → CRkdQgFz.js} +1 -1
- package/.output/public/_nuxt/{B0cUlOSM.js → Cw1XFOz5.js} +1 -1
- package/.output/public/_nuxt/{CzbCpNnc.js → D5yWk6Ly.js} +1 -1
- package/.output/public/_nuxt/{BOsJJ_ZU.js → DA9GjKpR.js} +1 -1
- package/.output/public/_nuxt/{Dce9SnGa.js → DaWAlZhp.js} +1 -1
- package/.output/public/_nuxt/{tqQNlhT9.js → DafLMUHo.js} +1 -1
- package/.output/public/_nuxt/{ypRHVLFO.js → Dyaldc-t.js} +1 -1
- package/.output/public/_nuxt/{o-NCh2rp.js → UU9fpRNQ.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/717459d8-0da1-42ed-af0b-9ec5395e8fdc.json +1 -0
- package/.output/public/_nuxt/entry.CDPplHzk.css +1 -0
- package/.output/public/_nuxt/error-404.hPtlUQpd.css +1 -0
- package/.output/public/_nuxt/error-500.E-PXUb6B.css +1 -0
- package/.output/public/_nuxt/{CMH9iX_E.js → kFZJW2-u.js} +2 -2
- package/.output/public/_nuxt/{DsnIpnT9.js → u3DlT5Mh.js} +1 -1
- package/.output/server/chunks/_/error-500.mjs.map +1 -1
- package/.output/server/chunks/_/parse-request.mjs +29 -0
- package/.output/server/chunks/_/parse-request.mjs.map +1 -0
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/{error-404-KRkA0DPI.mjs → error-404-aQ5PiVuX.mjs} +6 -12
- package/.output/server/chunks/build/error-404-aQ5PiVuX.mjs.map +1 -0
- package/.output/server/chunks/build/error-404-styles.DIZfBVBR.mjs +8 -0
- package/.output/server/chunks/build/error-404-styles.DIZfBVBR.mjs.map +1 -0
- package/.output/server/chunks/build/{error-500-DIIFf55p.mjs → error-500-BY6ZAZZ2.mjs} +6 -12
- package/.output/server/chunks/build/error-500-BY6ZAZZ2.mjs.map +1 -0
- package/.output/server/chunks/build/error-500-styles.BZXgEzR5.mjs +8 -0
- package/.output/server/chunks/build/error-500-styles.BZXgEzR5.mjs.map +1 -0
- package/.output/server/chunks/build/index-57_mtIua.mjs +235 -0
- package/.output/server/chunks/build/index-57_mtIua.mjs.map +1 -0
- package/.output/server/chunks/build/{index-CB1N4gax.mjs → index-Qa-4KqCB.mjs} +7 -13
- package/.output/server/chunks/build/index-Qa-4KqCB.mjs.map +1 -0
- package/.output/server/chunks/build/server.mjs +3913 -3378
- package/.output/server/chunks/build/server.mjs.map +1 -1
- package/.output/server/chunks/build/styles.mjs +4 -4
- package/.output/server/chunks/nitro/nitro.mjs +652 -2278
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/editor-types.get.mjs +91 -28
- package/.output/server/chunks/routes/api/editor-types.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/parse.post.mjs +1599 -7
- package/.output/server/chunks/routes/api/parse.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/resolve.get.mjs +0 -6
- package/.output/server/chunks/routes/api/resolve.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/studio/run.post.mjs +50 -12
- package/.output/server/chunks/routes/api/studio/run.post.mjs.map +1 -1
- package/.output/server/chunks/routes/renderer.mjs +21 -44
- package/.output/server/chunks/routes/renderer.mjs.map +1 -1
- package/.output/server/index.mjs +1 -7
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/.nitro/@vue/compiler-core@3.5.43/dist/compiler-core.cjs.prod.js +6801 -0
- package/.output/server/node_modules/.nitro/@vue/compiler-core@3.5.43/package.json +58 -0
- package/.output/server/node_modules/.nitro/@vue/compiler-dom@3.5.43/dist/compiler-dom.cjs.prod.js +692 -0
- package/.output/server/node_modules/.nitro/@vue/compiler-dom@3.5.43/package.json +57 -0
- package/.output/server/node_modules/.nitro/@vue/reactivity@3.5.43/dist/reactivity.cjs.prod.js +1905 -0
- package/.output/server/node_modules/.nitro/@vue/reactivity@3.5.43/package.json +55 -0
- package/.output/server/node_modules/.nitro/@vue/runtime-core@3.5.43/dist/runtime-core.cjs.prod.js +7006 -0
- package/.output/server/node_modules/.nitro/@vue/runtime-core@3.5.43/package.json +52 -0
- package/.output/server/node_modules/.nitro/@vue/runtime-dom@3.5.43/dist/runtime-dom.cjs.prod.js +1867 -0
- package/.output/server/node_modules/.nitro/@vue/runtime-dom@3.5.43/package.json +60 -0
- package/.output/server/node_modules/.nitro/@vue/shared@3.5.43/dist/shared.cjs.prod.js +655 -0
- package/.output/server/node_modules/.nitro/@vue/shared@3.5.43/package.json +47 -0
- package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/array-set.js +121 -0
- package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/base64-vlq.js +140 -0
- package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/base64.js +67 -0
- package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/binary-search.js +111 -0
- package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/mapping-list.js +79 -0
- package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/quick-sort.js +141 -0
- package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/source-map-consumer.js +1236 -0
- package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/source-map-generator.js +446 -0
- package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/source-node.js +420 -0
- package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/util.js +594 -0
- package/.output/server/node_modules/.nitro/source-map-js@1.2.2/package.json +71 -0
- package/.output/server/node_modules/.nitro/source-map-js@1.2.2/source-map.js +8 -0
- package/.output/server/node_modules/.nitro/vue@3.5.43/dist/vue.cjs.js +80 -0
- package/.output/server/node_modules/.nitro/vue@3.5.43/dist/vue.cjs.prod.js +66 -0
- package/.output/server/node_modules/.nitro/vue@3.5.43/index.js +7 -0
- package/.output/server/node_modules/.nitro/vue@3.5.43/index.mjs +1 -0
- package/.output/server/node_modules/.nitro/vue@3.5.43/package.json +112 -0
- package/.output/server/node_modules/@babel/parser/lib/index.js +55 -21
- package/.output/server/node_modules/@babel/parser/package.json +7 -7
- package/.output/server/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
- package/.output/server/node_modules/@esbuild/linux-x64/package.json +1 -1
- package/.output/server/node_modules/@iconify/utils/lib/colors/index.js +19 -16
- package/.output/server/node_modules/@iconify/utils/lib/colors/keywords.js +3 -4
- package/.output/server/node_modules/@iconify/utils/lib/css/common.js +16 -16
- package/.output/server/node_modules/@iconify/utils/lib/css/format.js +1 -2
- package/.output/server/node_modules/@iconify/utils/lib/css/icon.js +11 -14
- package/.output/server/node_modules/@iconify/utils/lib/css/icons.js +13 -16
- package/.output/server/node_modules/@iconify/utils/lib/customisations/bool.js +1 -2
- package/.output/server/node_modules/@iconify/utils/lib/customisations/defaults.js +1 -3
- package/.output/server/node_modules/@iconify/utils/lib/customisations/flip.js +2 -5
- package/.output/server/node_modules/@iconify/utils/lib/customisations/merge.js +1 -3
- package/.output/server/node_modules/@iconify/utils/lib/customisations/rotate.js +4 -5
- package/.output/server/node_modules/@iconify/utils/lib/emoji/cleanup.js +1 -3
- package/.output/server/node_modules/@iconify/utils/lib/emoji/convert.js +9 -11
- package/.output/server/node_modules/@iconify/utils/lib/emoji/data.js +1 -2
- package/.output/server/node_modules/@iconify/utils/lib/emoji/format.js +1 -3
- package/.output/server/node_modules/@iconify/utils/lib/emoji/parse.js +1 -3
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/base.js +12 -18
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/create.js +3 -4
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/numbers.js +5 -7
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/similar.js +1 -8
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/tree.js +11 -12
- package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/find.js +5 -7
- package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/replace.js +1 -3
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/components.js +1 -3
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/missing.js +7 -7
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/name.js +2 -4
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/parse.js +5 -9
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/similar.js +3 -5
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/tree.js +2 -4
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/variations.js +7 -8
- package/.output/server/node_modules/@iconify/utils/lib/icon/defaults.js +1 -2
- package/.output/server/node_modules/@iconify/utils/lib/icon/merge.js +1 -3
- package/.output/server/node_modules/@iconify/utils/lib/icon/name.js +3 -4
- package/.output/server/node_modules/@iconify/utils/lib/icon/square.js +1 -2
- package/.output/server/node_modules/@iconify/utils/lib/icon/transformations.js +1 -2
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/convert-info.js +10 -15
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/expand.js +1 -3
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icon.js +3 -5
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icons.js +1 -3
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/minify.js +1 -3
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/parse.js +1 -3
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/tree.js +1 -2
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate-basic.js +1 -3
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate.js +21 -13
- package/.output/server/node_modules/@iconify/utils/lib/index.js +1 -2
- package/.output/server/node_modules/@iconify/utils/lib/loader/custom.js +3 -3
- package/.output/server/node_modules/@iconify/utils/lib/loader/hmr-utils.js +33 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/loader.js +22 -22
- package/.output/server/node_modules/@iconify/utils/lib/loader/modern.js +7 -22
- package/.output/server/node_modules/@iconify/utils/lib/loader/utils.js +60 -16
- package/.output/server/node_modules/@iconify/utils/lib/misc/objects.js +1 -2
- package/.output/server/node_modules/@iconify/utils/lib/misc/strings.js +1 -2
- package/.output/server/node_modules/@iconify/utils/lib/misc/title.js +1 -2
- package/.output/server/node_modules/@iconify/utils/lib/svg/build.js +9 -11
- package/.output/server/node_modules/@iconify/utils/lib/svg/defs.js +1 -2
- package/.output/server/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.js +1 -3
- package/.output/server/node_modules/@iconify/utils/lib/svg/html.js +1 -2
- package/.output/server/node_modules/@iconify/utils/lib/svg/id.js +1 -2
- package/.output/server/node_modules/@iconify/utils/lib/svg/inner-html.js +1 -2
- package/.output/server/node_modules/@iconify/utils/lib/svg/parse.js +3 -5
- package/.output/server/node_modules/@iconify/utils/lib/svg/pretty.js +5 -4
- package/.output/server/node_modules/@iconify/utils/lib/svg/size.js +1 -2
- package/.output/server/node_modules/@iconify/utils/lib/svg/trim.js +1 -2
- package/.output/server/node_modules/@iconify/utils/lib/svg/url.js +1 -2
- package/.output/server/node_modules/@iconify/utils/lib/svg/viewbox.js +2 -3
- package/.output/server/node_modules/@iconify/utils/package.json +15 -13
- package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +8 -1
- package/.output/server/node_modules/@vue/compiler-ssr/package.json +3 -3
- package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +34 -13
- package/.output/server/node_modules/@vue/server-renderer/package.json +4 -6
- package/.output/server/node_modules/devalue/index.js +15 -2
- package/.output/server/node_modules/devalue/package.json +5 -3
- package/.output/server/node_modules/devalue/src/base64.js +46 -96
- package/.output/server/node_modules/devalue/src/constants.js +5 -0
- package/.output/server/node_modules/devalue/src/operations.js +221 -0
- package/.output/server/node_modules/devalue/src/parse.js +76 -62
- package/.output/server/node_modules/devalue/src/stringify.js +164 -81
- package/.output/server/node_modules/devalue/src/uneval.js +312 -104
- package/.output/server/node_modules/devalue/src/utils.js +61 -19
- package/.output/server/node_modules/esbuild/lib/main.js +12 -8
- package/.output/server/node_modules/esbuild/package.json +50 -50
- package/.output/server/node_modules/hookable/dist/index.mjs +2 -11
- package/.output/server/node_modules/hookable/package.json +23 -22
- package/.output/server/node_modules/ip-address/dist/ipv4.js +7 -0
- package/.output/server/node_modules/ip-address/package.json +1 -1
- package/.output/server/node_modules/zod/package.json +20 -8
- package/.output/server/node_modules/zod/v4/classic/checks.js +1 -1
- package/.output/server/node_modules/zod/v4/classic/deep-partial.js +13 -0
- package/.output/server/node_modules/zod/v4/classic/errors.js +44 -35
- package/.output/server/node_modules/zod/v4/classic/external.js +5 -8
- package/.output/server/node_modules/zod/v4/classic/from-json-schema.js +375 -78
- package/.output/server/node_modules/zod/v4/classic/in-out.js +36 -0
- package/.output/server/node_modules/zod/v4/classic/index.js +2 -2
- package/.output/server/node_modules/zod/v4/classic/iso.js +2 -17
- package/.output/server/node_modules/zod/v4/classic/package.json +2 -1
- package/.output/server/node_modules/zod/v4/classic/parse.js +1 -0
- package/.output/server/node_modules/zod/v4/classic/schemas.js +601 -223
- package/.output/server/node_modules/zod/v4/core/api.js +51 -26
- package/.output/server/node_modules/zod/v4/core/checks.js +68 -127
- package/.output/server/node_modules/zod/v4/core/compile.js +1858 -0
- package/.output/server/node_modules/zod/v4/core/core.js +87 -22
- package/.output/server/node_modules/zod/v4/core/doc.js +12 -9
- package/.output/server/node_modules/zod/v4/core/errors.js +127 -42
- package/.output/server/node_modules/zod/v4/core/index.js +3 -0
- package/.output/server/node_modules/zod/v4/core/json-schema-generator.js +6 -2
- package/.output/server/node_modules/zod/v4/core/json-schema-processors.js +413 -175
- package/.output/server/node_modules/zod/v4/core/memoizer.js +311 -0
- package/.output/server/node_modules/zod/v4/core/package.json +2 -1
- package/.output/server/node_modules/zod/v4/core/parse.js +130 -48
- package/.output/server/node_modules/zod/v4/core/regexes.js +39 -16
- package/.output/server/node_modules/zod/v4/core/registries.js +2 -2
- package/.output/server/node_modules/zod/v4/core/schemas.js +895 -382
- package/.output/server/node_modules/zod/v4/core/to-json-schema.js +253 -39
- package/.output/server/node_modules/zod/v4/core/util.js +383 -175
- package/.output/server/node_modules/zod/v4/core/versions.js +2 -2
- package/.output/server/node_modules/zod/v4/core/visit.js +169 -0
- package/.output/server/node_modules/zod/v4/index.js +3 -2
- package/.output/server/node_modules/zod/v4/locales/ar.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/az.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/be.js +12 -0
- package/.output/server/node_modules/zod/v4/locales/bg.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/bn.js +113 -0
- package/.output/server/node_modules/zod/v4/locales/ca.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/ckb.js +133 -0
- package/.output/server/node_modules/zod/v4/locales/cs.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/da.js +7 -2
- package/.output/server/node_modules/zod/v4/locales/de.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/el.js +112 -0
- package/.output/server/node_modules/zod/v4/locales/en.js +20 -4
- package/.output/server/node_modules/zod/v4/locales/eo.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/es.js +4 -0
- package/.output/server/node_modules/zod/v4/locales/fa.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/fi.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/fr-CA.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/fr.js +38 -17
- package/.output/server/node_modules/zod/v4/locales/gu.js +113 -0
- package/.output/server/node_modules/zod/v4/locales/he.js +7 -0
- package/.output/server/node_modules/zod/v4/locales/hi.js +111 -0
- package/.output/server/node_modules/zod/v4/locales/hr.js +126 -0
- package/.output/server/node_modules/zod/v4/locales/hu.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/hy.js +11 -0
- package/.output/server/node_modules/zod/v4/locales/id.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/index.js +14 -0
- package/.output/server/node_modules/zod/v4/locales/is.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/it.js +6 -1
- package/.output/server/node_modules/zod/v4/locales/ja.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/ka.js +13 -8
- package/.output/server/node_modules/zod/v4/locales/km.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/kn.js +116 -0
- package/.output/server/node_modules/zod/v4/locales/ko.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/lt.js +4 -0
- package/.output/server/node_modules/zod/v4/locales/mk.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/ms.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/ne.js +111 -0
- package/.output/server/node_modules/zod/v4/locales/nl.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/nn.js +113 -0
- package/.output/server/node_modules/zod/v4/locales/no.js +7 -2
- package/.output/server/node_modules/zod/v4/locales/ota.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/package.json +2 -1
- package/.output/server/node_modules/zod/v4/locales/pl.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/ps.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/pt-BR.js +143 -0
- package/.output/server/node_modules/zod/v4/locales/pt.js +89 -55
- package/.output/server/node_modules/zod/v4/locales/ro.js +122 -0
- package/.output/server/node_modules/zod/v4/locales/ru.js +12 -0
- package/.output/server/node_modules/zod/v4/locales/sk.js +116 -0
- package/.output/server/node_modules/zod/v4/locales/sl.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/sv.js +7 -2
- package/.output/server/node_modules/zod/v4/locales/ta.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/tg.js +117 -0
- package/.output/server/node_modules/zod/v4/locales/th.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/tk.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/tr.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/uk.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/ur.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/uz.js +4 -0
- package/.output/server/node_modules/zod/v4/locales/vi.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/yo.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/zh-CN.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/zh-TW.js +5 -0
- package/.output/server/node_modules/zod/v4/package.json +2 -1
- package/.output/server/package.json +18 -18
- package/README.md +12 -1
- package/package.json +10 -9
- package/server/api/editor-types.get.ts +2 -23
- package/server/api/studio/run.post.ts +18 -6
- package/server/utils/editor-types.json +1 -0
- package/.output/public/_nuxt/B9paGgN0.js +0 -33
- package/.output/public/_nuxt/builds/meta/51f1351c-0667-4235-9ddc-16582a51ce03.json +0 -1
- package/.output/public/_nuxt/entry.B-vs1tRH.css +0 -1
- package/.output/public/_nuxt/error-404.CTSXlFYa.css +0 -1
- package/.output/public/_nuxt/error-500.DqEfQnVZ.css +0 -1
- package/.output/server/chunks/build/error-404-KRkA0DPI.mjs.map +0 -1
- package/.output/server/chunks/build/error-404-styles.I0NYw-Bn.mjs +0 -8
- package/.output/server/chunks/build/error-404-styles.I0NYw-Bn.mjs.map +0 -1
- package/.output/server/chunks/build/error-500-DIIFf55p.mjs.map +0 -1
- package/.output/server/chunks/build/error-500-styles.D1cs9hQy.mjs +0 -8
- package/.output/server/chunks/build/error-500-styles.D1cs9hQy.mjs.map +0 -1
- package/.output/server/chunks/build/index-CB1N4gax.mjs.map +0 -1
- /package/.output/server/node_modules/{@vue/compiler-core → .nitro/@vue/compiler-core@3.5.32}/dist/compiler-core.cjs.prod.js +0 -0
- /package/.output/server/node_modules/{@vue/compiler-core → .nitro/@vue/compiler-core@3.5.32}/package.json +0 -0
- /package/.output/server/node_modules/{@vue/compiler-dom → .nitro/@vue/compiler-dom@3.5.32}/dist/compiler-dom.cjs.prod.js +0 -0
- /package/.output/server/node_modules/{@vue/compiler-dom → .nitro/@vue/compiler-dom@3.5.32}/package.json +0 -0
- /package/.output/server/node_modules/{@vue/reactivity → .nitro/@vue/reactivity@3.5.32}/dist/reactivity.cjs.prod.js +0 -0
- /package/.output/server/node_modules/{@vue/reactivity → .nitro/@vue/reactivity@3.5.32}/package.json +0 -0
- /package/.output/server/node_modules/{@vue/runtime-core → .nitro/@vue/runtime-core@3.5.32}/dist/runtime-core.cjs.prod.js +0 -0
- /package/.output/server/node_modules/{@vue/runtime-core → .nitro/@vue/runtime-core@3.5.32}/package.json +0 -0
- /package/.output/server/node_modules/{@vue/runtime-dom → .nitro/@vue/runtime-dom@3.5.32}/dist/runtime-dom.cjs.prod.js +0 -0
- /package/.output/server/node_modules/{@vue/runtime-dom → .nitro/@vue/runtime-dom@3.5.32}/package.json +0 -0
- /package/.output/server/node_modules/{@vue/shared → .nitro/@vue/shared@3.5.32}/dist/shared.cjs.prod.js +0 -0
- /package/.output/server/node_modules/{@vue/shared → .nitro/@vue/shared@3.5.32}/package.json +0 -0
- /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/array-set.js +0 -0
- /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/base64-vlq.js +0 -0
- /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/base64.js +0 -0
- /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/binary-search.js +0 -0
- /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/mapping-list.js +0 -0
- /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/quick-sort.js +0 -0
- /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/source-map-consumer.js +0 -0
- /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/source-map-generator.js +0 -0
- /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/source-node.js +0 -0
- /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/util.js +0 -0
- /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/package.json +0 -0
- /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/source-map.js +0 -0
- /package/.output/server/node_modules/{vue → .nitro/vue@3.5.32}/dist/vue.cjs.js +0 -0
- /package/.output/server/node_modules/{vue → .nitro/vue@3.5.32}/dist/vue.cjs.prod.js +0 -0
- /package/.output/server/node_modules/{vue → .nitro/vue@3.5.32}/index.js +0 -0
- /package/.output/server/node_modules/{vue → .nitro/vue@3.5.32}/index.mjs +0 -0
- /package/.output/server/node_modules/{vue → .nitro/vue@3.5.32}/package.json +0 -0
- /package/.output/server/node_modules/{vue → .nitro/vue@3.5.43}/server-renderer/index.mjs +0 -0
|
@@ -1,159 +1,336 @@
|
|
|
1
1
|
import * as core from "../core/index.js";
|
|
2
2
|
import { util } from "../core/index.js";
|
|
3
3
|
import * as processors from "../core/json-schema-processors.js";
|
|
4
|
+
import * as regexes from "../core/regexes.js";
|
|
4
5
|
import { createStandardJSONSchemaMethod, createToJSONSchemaMethod } from "../core/to-json-schema.js";
|
|
6
|
+
import en from "../locales/en.js";
|
|
5
7
|
import * as checks from "./checks.js";
|
|
6
|
-
import * as iso from "./iso.js";
|
|
7
8
|
import * as parse from "./parse.js";
|
|
9
|
+
// Register English as the default locale on first ZodType construction. Hooked into the `ZodType` `$constructor` (rather than a top-level `config(en())` in `external.ts`) so bundlers honoring `sideEffects: false` can't tree-shake it out — see #5953, #5725. An explicit `z.config(z.locales.xx())` call wins regardless of order, since this only sets the default when none is present.
|
|
10
|
+
function _ensureDefaultLocale() {
|
|
11
|
+
if (!core.globalConfig.localeError)
|
|
12
|
+
core.config(en());
|
|
13
|
+
}
|
|
14
|
+
// the default memoizer is read by the core container init, which runs before `ZodType.init`, so each container calls this first
|
|
15
|
+
function _ensureDefaultMemoizer() {
|
|
16
|
+
if (!core.globalConfig.memoizer)
|
|
17
|
+
core.config({ memoizer: core.memoizer() });
|
|
18
|
+
}
|
|
8
19
|
export const ZodType = /*@__PURE__*/ core.$constructor("ZodType", (inst, def) => {
|
|
20
|
+
_ensureDefaultLocale();
|
|
9
21
|
core.$ZodType.init(inst, def);
|
|
10
|
-
Object.assign(inst["~standard"], {
|
|
11
|
-
jsonSchema: {
|
|
12
|
-
input: createStandardJSONSchemaMethod(inst, "input"),
|
|
13
|
-
output: createStandardJSONSchemaMethod(inst, "output"),
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
|
|
17
22
|
inst.def = def;
|
|
18
23
|
inst.type = def.type;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
return inst;
|
|
25
|
+
}, {
|
|
26
|
+
check(...chks) {
|
|
27
|
+
const def = this.def;
|
|
28
|
+
return this.clone(util.mergeDefs(def, {
|
|
23
29
|
checks: [
|
|
24
30
|
...(def.checks ?? []),
|
|
25
|
-
...
|
|
31
|
+
...chks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch),
|
|
26
32
|
],
|
|
27
|
-
}), {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
33
|
+
}), { parent: true });
|
|
34
|
+
},
|
|
35
|
+
with(...chks) {
|
|
36
|
+
return this.check(...chks);
|
|
37
|
+
},
|
|
38
|
+
clone(def, params) {
|
|
39
|
+
return core.clone(this, def, params);
|
|
40
|
+
},
|
|
41
|
+
brand() {
|
|
42
|
+
return this;
|
|
43
|
+
},
|
|
44
|
+
register(reg, meta) {
|
|
45
|
+
reg.add(this, meta);
|
|
46
|
+
return this;
|
|
47
|
+
},
|
|
48
|
+
refine(check, params) {
|
|
49
|
+
return this.check(refine(check, params));
|
|
50
|
+
},
|
|
51
|
+
superRefine(refinement, params) {
|
|
52
|
+
return this.check(superRefine(refinement, params));
|
|
53
|
+
},
|
|
54
|
+
overwrite(fn) {
|
|
55
|
+
return this.check(checks.overwrite(fn));
|
|
56
|
+
},
|
|
57
|
+
optional() {
|
|
58
|
+
return optional(this);
|
|
59
|
+
},
|
|
60
|
+
exactOptional() {
|
|
61
|
+
return exactOptional(this);
|
|
62
|
+
},
|
|
63
|
+
nullable() {
|
|
64
|
+
return nullable(this);
|
|
65
|
+
},
|
|
66
|
+
nullish() {
|
|
67
|
+
return optional(nullable(this));
|
|
68
|
+
},
|
|
69
|
+
nonoptional(params) {
|
|
70
|
+
return nonoptional(this, params);
|
|
71
|
+
},
|
|
72
|
+
array() {
|
|
73
|
+
return array(this);
|
|
74
|
+
},
|
|
75
|
+
or(arg) {
|
|
76
|
+
return union([this, arg]);
|
|
77
|
+
},
|
|
78
|
+
and(arg) {
|
|
79
|
+
return intersection(this, arg);
|
|
80
|
+
},
|
|
81
|
+
transform(tx) {
|
|
82
|
+
return pipe(this, transform(tx));
|
|
83
|
+
},
|
|
84
|
+
default(d) {
|
|
85
|
+
return _default(this, d);
|
|
86
|
+
},
|
|
87
|
+
prefault(d) {
|
|
88
|
+
return prefault(this, d);
|
|
89
|
+
},
|
|
90
|
+
catch(params) {
|
|
91
|
+
return _catch(this, params);
|
|
92
|
+
},
|
|
93
|
+
pipe(target) {
|
|
94
|
+
return pipe(this, target);
|
|
95
|
+
},
|
|
96
|
+
readonly() {
|
|
97
|
+
return readonly(this);
|
|
98
|
+
},
|
|
99
|
+
describe(description) {
|
|
100
|
+
const cl = this.clone();
|
|
76
101
|
core.globalRegistry.add(cl, { description });
|
|
77
102
|
return cl;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
});
|
|
85
|
-
inst.meta = (...args) => {
|
|
86
|
-
if (args.length === 0) {
|
|
87
|
-
return core.globalRegistry.get(inst);
|
|
88
|
-
}
|
|
89
|
-
const cl = inst.clone();
|
|
103
|
+
},
|
|
104
|
+
meta(...args) {
|
|
105
|
+
// overloaded: meta() returns the registered metadata, meta(data) returns a clone with `data` registered. The mapped type picks up the second overload, so we accept variadic any-args and return `any` to satisfy both at runtime.
|
|
106
|
+
if (args.length === 0)
|
|
107
|
+
return core.globalRegistry.get(this);
|
|
108
|
+
const cl = this.clone();
|
|
90
109
|
core.globalRegistry.add(cl, args[0]);
|
|
91
110
|
return cl;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
111
|
+
},
|
|
112
|
+
isOptional() {
|
|
113
|
+
return this.safeParse(undefined).success;
|
|
114
|
+
},
|
|
115
|
+
isNullable() {
|
|
116
|
+
return this.safeParse(null).success;
|
|
117
|
+
},
|
|
118
|
+
apply(fn, ...args) {
|
|
119
|
+
return args.length === 0 ? fn(this) : fn(this, ...args);
|
|
120
|
+
},
|
|
121
|
+
// Overrides core's `~standard` to add `jsonSchema`. Must stay a prototype entry: redefining it per instance demotes instances to dictionary mode.
|
|
122
|
+
get "~standard"() {
|
|
123
|
+
return util.hide(this, "~standard", {
|
|
124
|
+
...core.standardProps(this),
|
|
125
|
+
jsonSchema: {
|
|
126
|
+
input: createStandardJSONSchemaMethod(this, "input"),
|
|
127
|
+
output: createStandardJSONSchemaMethod(this, "output"),
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
},
|
|
131
|
+
set "~standard"(value) {
|
|
132
|
+
util.own(this, "~standard", value);
|
|
133
|
+
},
|
|
134
|
+
parse: function _parse(data, params) {
|
|
135
|
+
return parse.parse(this, data, params, { callee: _parse });
|
|
136
|
+
},
|
|
137
|
+
parseAsync: async function _parseAsync(data, params) {
|
|
138
|
+
return await parse.parseAsync(this, data, params, { callee: _parseAsync });
|
|
139
|
+
},
|
|
140
|
+
safeParse(data, params) {
|
|
141
|
+
return parse.safeParse(this, data, params);
|
|
142
|
+
},
|
|
143
|
+
async safeParseAsync(data, params) {
|
|
144
|
+
return parse.safeParseAsync(this, data, params);
|
|
145
|
+
},
|
|
146
|
+
// `spa` is an alias: same function object as `safeParseAsync`, as before.
|
|
147
|
+
get spa() {
|
|
148
|
+
return this?.safeParseAsync;
|
|
149
|
+
},
|
|
150
|
+
set spa(value) {
|
|
151
|
+
util.own(this, "spa", value);
|
|
152
|
+
},
|
|
153
|
+
validate(data, params) {
|
|
154
|
+
return parse.validate(this, data, params);
|
|
155
|
+
},
|
|
156
|
+
validateAsync(data, params) {
|
|
157
|
+
return parse.validateAsync(this, data, params);
|
|
158
|
+
},
|
|
159
|
+
encode: function _encode(data, params) {
|
|
160
|
+
return parse.encode(this, data, params, { callee: _encode });
|
|
161
|
+
},
|
|
162
|
+
decode: function _decode(data, params) {
|
|
163
|
+
return parse.decode(this, data, params, { callee: _decode });
|
|
164
|
+
},
|
|
165
|
+
encodeAsync: async function _encodeAsync(data, params) {
|
|
166
|
+
return await parse.encodeAsync(this, data, params, { callee: _encodeAsync });
|
|
167
|
+
},
|
|
168
|
+
decodeAsync: async function _decodeAsync(data, params) {
|
|
169
|
+
return await parse.decodeAsync(this, data, params, { callee: _decodeAsync });
|
|
170
|
+
},
|
|
171
|
+
safeEncode(data, params) {
|
|
172
|
+
return parse.safeEncode(this, data, params);
|
|
173
|
+
},
|
|
174
|
+
safeDecode(data, params) {
|
|
175
|
+
return parse.safeDecode(this, data, params);
|
|
176
|
+
},
|
|
177
|
+
async safeEncodeAsync(data, params) {
|
|
178
|
+
return parse.safeEncodeAsync(this, data, params);
|
|
179
|
+
},
|
|
180
|
+
async safeDecodeAsync(data, params) {
|
|
181
|
+
return parse.safeDecodeAsync(this, data, params);
|
|
182
|
+
},
|
|
183
|
+
toJSONSchema(params) {
|
|
184
|
+
return createToJSONSchemaMethod(this, {})(params);
|
|
185
|
+
},
|
|
186
|
+
// Reads through to the registry on every access, so it must not cache.
|
|
187
|
+
get description() {
|
|
188
|
+
return core.globalRegistry.get(this)?.description;
|
|
189
|
+
},
|
|
190
|
+
// No setter: `schema._def = x` throws, as it did when `_def` was a non-writable own property.
|
|
191
|
+
get _def() {
|
|
192
|
+
return this._zod.def;
|
|
193
|
+
},
|
|
98
194
|
});
|
|
99
195
|
/** @internal */
|
|
100
196
|
export const _ZodString = /*@__PURE__*/ core.$constructor("_ZodString", (inst, def) => {
|
|
101
197
|
core.$ZodString.init(inst, def);
|
|
102
198
|
ZodType.init(inst, def);
|
|
103
199
|
inst._zod.processJSONSchema = (ctx, json, params) => processors.stringProcessor(inst, ctx, json, params);
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
inst
|
|
107
|
-
inst
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
200
|
+
},
|
|
201
|
+
/*@__PURE__*/ util.derived({
|
|
202
|
+
format: (inst) => processors.aggregateChecks(inst).format ?? null,
|
|
203
|
+
minLength: (inst) => processors.aggregateChecks(inst).minimum ?? null,
|
|
204
|
+
maxLength: (inst) => processors.aggregateChecks(inst).maximum ?? null,
|
|
205
|
+
}, {
|
|
206
|
+
regex(...args) {
|
|
207
|
+
return this.check(checks.regex(...args));
|
|
208
|
+
},
|
|
209
|
+
includes(...args) {
|
|
210
|
+
return this.check(checks.includes(...args));
|
|
211
|
+
},
|
|
212
|
+
startsWith(...args) {
|
|
213
|
+
return this.check(checks.startsWith(...args));
|
|
214
|
+
},
|
|
215
|
+
endsWith(...args) {
|
|
216
|
+
return this.check(checks.endsWith(...args));
|
|
217
|
+
},
|
|
218
|
+
min(...args) {
|
|
219
|
+
return this.check(checks.minLength(...args));
|
|
220
|
+
},
|
|
221
|
+
max(...args) {
|
|
222
|
+
return this.check(checks.maxLength(...args));
|
|
223
|
+
},
|
|
224
|
+
length(...args) {
|
|
225
|
+
return this.check(checks.length(...args));
|
|
226
|
+
},
|
|
227
|
+
nonempty(...args) {
|
|
228
|
+
return this.check(checks.minLength(1, ...args));
|
|
229
|
+
},
|
|
230
|
+
lowercase(params) {
|
|
231
|
+
return this.check(checks.lowercase(params));
|
|
232
|
+
},
|
|
233
|
+
uppercase(params) {
|
|
234
|
+
return this.check(checks.uppercase(params));
|
|
235
|
+
},
|
|
236
|
+
trim() {
|
|
237
|
+
return this.check(checks.trim());
|
|
238
|
+
},
|
|
239
|
+
normalize(...args) {
|
|
240
|
+
return this.check(checks.normalize(...args));
|
|
241
|
+
},
|
|
242
|
+
toLowerCase() {
|
|
243
|
+
return this.check(checks.toLowerCase());
|
|
244
|
+
},
|
|
245
|
+
toUpperCase() {
|
|
246
|
+
return this.check(checks.toUpperCase());
|
|
247
|
+
},
|
|
248
|
+
slugify() {
|
|
249
|
+
return this.check(checks.slugify());
|
|
250
|
+
},
|
|
251
|
+
}));
|
|
126
252
|
export const ZodString = /*@__PURE__*/ core.$constructor("ZodString", (inst, def) => {
|
|
127
253
|
core.$ZodString.init(inst, def);
|
|
128
254
|
_ZodString.init(inst, def);
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
255
|
+
}, {
|
|
256
|
+
email(params) {
|
|
257
|
+
return this.check(core._email(ZodEmail, params));
|
|
258
|
+
},
|
|
259
|
+
url(params) {
|
|
260
|
+
return this.check(core._url(ZodURL, params));
|
|
261
|
+
},
|
|
262
|
+
jwt(params) {
|
|
263
|
+
return this.check(core._jwt(ZodJWT, params));
|
|
264
|
+
},
|
|
265
|
+
emoji(params) {
|
|
266
|
+
return this.check(core._emoji(ZodEmoji, params));
|
|
267
|
+
},
|
|
268
|
+
guid(params) {
|
|
269
|
+
return this.check(core._guid(ZodGUID, params));
|
|
270
|
+
},
|
|
271
|
+
uuid(params) {
|
|
272
|
+
return this.check(core._uuid(ZodUUID, params));
|
|
273
|
+
},
|
|
274
|
+
uuidv4(params) {
|
|
275
|
+
return this.check(core._uuidv4(ZodUUID, params));
|
|
276
|
+
},
|
|
277
|
+
uuidv6(params) {
|
|
278
|
+
return this.check(core._uuidv6(ZodUUID, params));
|
|
279
|
+
},
|
|
280
|
+
uuidv7(params) {
|
|
281
|
+
return this.check(core._uuidv7(ZodUUID, params));
|
|
282
|
+
},
|
|
283
|
+
nanoid(params) {
|
|
284
|
+
return this.check(core._nanoid(ZodNanoID, params));
|
|
285
|
+
},
|
|
286
|
+
cuid(params) {
|
|
287
|
+
return this.check(core._cuid(ZodCUID, params));
|
|
288
|
+
},
|
|
289
|
+
cuid2(params) {
|
|
290
|
+
return this.check(core._cuid2(ZodCUID2, params));
|
|
291
|
+
},
|
|
292
|
+
ulid(params) {
|
|
293
|
+
return this.check(core._ulid(ZodULID, params));
|
|
294
|
+
},
|
|
295
|
+
base64(params) {
|
|
296
|
+
return this.check(core._base64(ZodBase64, params));
|
|
297
|
+
},
|
|
298
|
+
base64url(params) {
|
|
299
|
+
return this.check(core._base64url(ZodBase64URL, params));
|
|
300
|
+
},
|
|
301
|
+
xid(params) {
|
|
302
|
+
return this.check(core._xid(ZodXID, params));
|
|
303
|
+
},
|
|
304
|
+
ksuid(params) {
|
|
305
|
+
return this.check(core._ksuid(ZodKSUID, params));
|
|
306
|
+
},
|
|
307
|
+
ipv4(params) {
|
|
308
|
+
return this.check(core._ipv4(ZodIPv4, params));
|
|
309
|
+
},
|
|
310
|
+
ipv6(params) {
|
|
311
|
+
return this.check(core._ipv6(ZodIPv6, params));
|
|
312
|
+
},
|
|
313
|
+
cidrv4(params) {
|
|
314
|
+
return this.check(core._cidrv4(ZodCIDRv4, params));
|
|
315
|
+
},
|
|
316
|
+
cidrv6(params) {
|
|
317
|
+
return this.check(core._cidrv6(ZodCIDRv6, params));
|
|
318
|
+
},
|
|
319
|
+
e164(params) {
|
|
320
|
+
return this.check(core._e164(ZodE164, params));
|
|
321
|
+
},
|
|
322
|
+
datetime(params) {
|
|
323
|
+
return this.check(core._isoDateTime(ZodISODateTime, params));
|
|
324
|
+
},
|
|
325
|
+
date(params) {
|
|
326
|
+
return this.check(core._isoDate(ZodISODate, params));
|
|
327
|
+
},
|
|
328
|
+
time(params) {
|
|
329
|
+
return this.check(core._isoTime(ZodISOTime, params));
|
|
330
|
+
},
|
|
331
|
+
duration(params) {
|
|
332
|
+
return this.check(core._isoDuration(ZodISODuration, params));
|
|
333
|
+
},
|
|
157
334
|
});
|
|
158
335
|
export function string(params) {
|
|
159
336
|
return core._string(ZodString, params);
|
|
@@ -162,6 +339,22 @@ export const ZodStringFormat = /*@__PURE__*/ core.$constructor("ZodStringFormat"
|
|
|
162
339
|
core.$ZodStringFormat.init(inst, def);
|
|
163
340
|
_ZodString.init(inst, def);
|
|
164
341
|
});
|
|
342
|
+
export const ZodISODateTime = /*@__PURE__*/ core.$constructor("ZodISODateTime", (inst, def) => {
|
|
343
|
+
core.$ZodISODateTime.init(inst, def);
|
|
344
|
+
ZodStringFormat.init(inst, def);
|
|
345
|
+
});
|
|
346
|
+
export const ZodISODate = /*@__PURE__*/ core.$constructor("ZodISODate", (inst, def) => {
|
|
347
|
+
core.$ZodISODate.init(inst, def);
|
|
348
|
+
ZodStringFormat.init(inst, def);
|
|
349
|
+
});
|
|
350
|
+
export const ZodISOTime = /*@__PURE__*/ core.$constructor("ZodISOTime", (inst, def) => {
|
|
351
|
+
core.$ZodISOTime.init(inst, def);
|
|
352
|
+
ZodStringFormat.init(inst, def);
|
|
353
|
+
});
|
|
354
|
+
export const ZodISODuration = /*@__PURE__*/ core.$constructor("ZodISODuration", (inst, def) => {
|
|
355
|
+
core.$ZodISODuration.init(inst, def);
|
|
356
|
+
ZodStringFormat.init(inst, def);
|
|
357
|
+
});
|
|
165
358
|
export const ZodEmail = /*@__PURE__*/ core.$constructor("ZodEmail", (inst, def) => {
|
|
166
359
|
// ZodStringFormat.init(inst, def);
|
|
167
360
|
core.$ZodEmail.init(inst, def);
|
|
@@ -207,8 +400,8 @@ export function url(params) {
|
|
|
207
400
|
}
|
|
208
401
|
export function httpUrl(params) {
|
|
209
402
|
return core._url(ZodURL, {
|
|
210
|
-
protocol:
|
|
211
|
-
hostname:
|
|
403
|
+
protocol: regexes.httpProtocol,
|
|
404
|
+
hostname: regexes.domain,
|
|
212
405
|
...util.normalizeParams(params),
|
|
213
406
|
});
|
|
214
407
|
}
|
|
@@ -228,11 +421,23 @@ export const ZodNanoID = /*@__PURE__*/ core.$constructor("ZodNanoID", (inst, def
|
|
|
228
421
|
export function nanoid(params) {
|
|
229
422
|
return core._nanoid(ZodNanoID, params);
|
|
230
423
|
}
|
|
424
|
+
/**
|
|
425
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
426
|
+
* (timestamps embedded in the id). Use {@link ZodCUID2} instead.
|
|
427
|
+
* See https://github.com/paralleldrive/cuid.
|
|
428
|
+
*/
|
|
231
429
|
export const ZodCUID = /*@__PURE__*/ core.$constructor("ZodCUID", (inst, def) => {
|
|
232
430
|
// ZodStringFormat.init(inst, def);
|
|
233
431
|
core.$ZodCUID.init(inst, def);
|
|
234
432
|
ZodStringFormat.init(inst, def);
|
|
235
433
|
});
|
|
434
|
+
/**
|
|
435
|
+
* Validates a CUID v1 string.
|
|
436
|
+
*
|
|
437
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
438
|
+
* (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.
|
|
439
|
+
* See https://github.com/paralleldrive/cuid.
|
|
440
|
+
*/
|
|
236
441
|
export function cuid(params) {
|
|
237
442
|
return core._cuid(ZodCUID, params);
|
|
238
443
|
}
|
|
@@ -330,6 +535,20 @@ export const ZodE164 = /*@__PURE__*/ core.$constructor("ZodE164", (inst, def) =>
|
|
|
330
535
|
export function e164(params) {
|
|
331
536
|
return core._e164(ZodE164, params);
|
|
332
537
|
}
|
|
538
|
+
export const ZodCreditCard = /*@__PURE__*/ core.$constructor("ZodCreditCard", (inst, def) => {
|
|
539
|
+
core.$ZodCreditCard.init(inst, def);
|
|
540
|
+
ZodStringFormat.init(inst, def);
|
|
541
|
+
});
|
|
542
|
+
export function creditCard(params) {
|
|
543
|
+
return core._creditCard(ZodCreditCard, params);
|
|
544
|
+
}
|
|
545
|
+
export const ZodIBAN = /*@__PURE__*/ core.$constructor("ZodIBAN", (inst, def) => {
|
|
546
|
+
core.$ZodIBAN.init(inst, def);
|
|
547
|
+
ZodStringFormat.init(inst, def);
|
|
548
|
+
});
|
|
549
|
+
export function iban(params) {
|
|
550
|
+
return core._iban(ZodIBAN, params);
|
|
551
|
+
}
|
|
333
552
|
export const ZodJWT = /*@__PURE__*/ core.$constructor("ZodJWT", (inst, def) => {
|
|
334
553
|
// ZodStringFormat.init(inst, def);
|
|
335
554
|
core.$ZodJWT.init(inst, def);
|
|
@@ -347,10 +566,13 @@ export function stringFormat(format, fnOrRegex, _params = {}) {
|
|
|
347
566
|
return core._stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
|
|
348
567
|
}
|
|
349
568
|
export function hostname(_params) {
|
|
350
|
-
return core._stringFormat(ZodCustomStringFormat, "hostname",
|
|
569
|
+
return core._stringFormat(ZodCustomStringFormat, "hostname", regexes.hostname, _params);
|
|
351
570
|
}
|
|
352
571
|
export function hex(_params) {
|
|
353
|
-
return core._stringFormat(ZodCustomStringFormat, "hex",
|
|
572
|
+
return core._stringFormat(ZodCustomStringFormat, "hex", regexes.hex, _params);
|
|
573
|
+
}
|
|
574
|
+
export function currencyCode(_params) {
|
|
575
|
+
return core._stringFormat(ZodCustomStringFormat, "currency_code", regexes.currencyCode, _params);
|
|
354
576
|
}
|
|
355
577
|
export function hash(alg, params) {
|
|
356
578
|
const enc = params?.enc ?? "hex";
|
|
@@ -364,31 +586,69 @@ export const ZodNumber = /*@__PURE__*/ core.$constructor("ZodNumber", (inst, def
|
|
|
364
586
|
core.$ZodNumber.init(inst, def);
|
|
365
587
|
ZodType.init(inst, def);
|
|
366
588
|
inst._zod.processJSONSchema = (ctx, json, params) => processors.numberProcessor(inst, ctx, json, params);
|
|
367
|
-
inst.gt = (value, params) => inst.check(checks.gt(value, params));
|
|
368
|
-
inst.gte = (value, params) => inst.check(checks.gte(value, params));
|
|
369
|
-
inst.min = (value, params) => inst.check(checks.gte(value, params));
|
|
370
|
-
inst.lt = (value, params) => inst.check(checks.lt(value, params));
|
|
371
|
-
inst.lte = (value, params) => inst.check(checks.lte(value, params));
|
|
372
|
-
inst.max = (value, params) => inst.check(checks.lte(value, params));
|
|
373
|
-
inst.int = (params) => inst.check(int(params));
|
|
374
|
-
inst.safe = (params) => inst.check(int(params));
|
|
375
|
-
inst.positive = (params) => inst.check(checks.gt(0, params));
|
|
376
|
-
inst.nonnegative = (params) => inst.check(checks.gte(0, params));
|
|
377
|
-
inst.negative = (params) => inst.check(checks.lt(0, params));
|
|
378
|
-
inst.nonpositive = (params) => inst.check(checks.lte(0, params));
|
|
379
|
-
inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));
|
|
380
|
-
inst.step = (value, params) => inst.check(checks.multipleOf(value, params));
|
|
381
|
-
// inst.finite = (params) => inst.check(core.finite(params));
|
|
382
|
-
inst.finite = () => inst;
|
|
383
|
-
const bag = inst._zod.bag;
|
|
384
|
-
inst.minValue =
|
|
385
|
-
Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
386
|
-
inst.maxValue =
|
|
387
|
-
Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
388
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
|
|
389
589
|
inst.isFinite = true;
|
|
390
|
-
|
|
391
|
-
|
|
590
|
+
},
|
|
591
|
+
/*@__PURE__*/ util.derived({
|
|
592
|
+
minValue: (inst) => {
|
|
593
|
+
const { minimum, exclusiveMinimum } = processors.aggregateChecks(inst);
|
|
594
|
+
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
595
|
+
},
|
|
596
|
+
maxValue: (inst) => {
|
|
597
|
+
const { maximum, exclusiveMaximum } = processors.aggregateChecks(inst);
|
|
598
|
+
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
599
|
+
},
|
|
600
|
+
isInt: (inst) => {
|
|
601
|
+
const { isInt, multipleOf } = processors.aggregateChecks(inst);
|
|
602
|
+
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
603
|
+
},
|
|
604
|
+
format: (inst) => processors.aggregateChecks(inst).format ?? null,
|
|
605
|
+
}, {
|
|
606
|
+
gt(value, params) {
|
|
607
|
+
return this.check(checks.gt(value, params));
|
|
608
|
+
},
|
|
609
|
+
gte(value, params) {
|
|
610
|
+
return this.check(checks.gte(value, params));
|
|
611
|
+
},
|
|
612
|
+
min(value, params) {
|
|
613
|
+
return this.check(checks.gte(value, params));
|
|
614
|
+
},
|
|
615
|
+
lt(value, params) {
|
|
616
|
+
return this.check(checks.lt(value, params));
|
|
617
|
+
},
|
|
618
|
+
lte(value, params) {
|
|
619
|
+
return this.check(checks.lte(value, params));
|
|
620
|
+
},
|
|
621
|
+
max(value, params) {
|
|
622
|
+
return this.check(checks.lte(value, params));
|
|
623
|
+
},
|
|
624
|
+
int(params) {
|
|
625
|
+
return this.check(int(params));
|
|
626
|
+
},
|
|
627
|
+
safe(params) {
|
|
628
|
+
return this.check(int(params));
|
|
629
|
+
},
|
|
630
|
+
positive(params) {
|
|
631
|
+
return this.check(checks.gt(0, params));
|
|
632
|
+
},
|
|
633
|
+
nonnegative(params) {
|
|
634
|
+
return this.check(checks.gte(0, params));
|
|
635
|
+
},
|
|
636
|
+
negative(params) {
|
|
637
|
+
return this.check(checks.lt(0, params));
|
|
638
|
+
},
|
|
639
|
+
nonpositive(params) {
|
|
640
|
+
return this.check(checks.lte(0, params));
|
|
641
|
+
},
|
|
642
|
+
multipleOf(value, params) {
|
|
643
|
+
return this.check(checks.multipleOf(value, params));
|
|
644
|
+
},
|
|
645
|
+
step(value, params) {
|
|
646
|
+
return this.check(checks.multipleOf(value, params));
|
|
647
|
+
},
|
|
648
|
+
finite() {
|
|
649
|
+
return this;
|
|
650
|
+
},
|
|
651
|
+
}));
|
|
392
652
|
export function number(params) {
|
|
393
653
|
return core._number(ZodNumber, params);
|
|
394
654
|
}
|
|
@@ -423,24 +683,46 @@ export const ZodBigInt = /*@__PURE__*/ core.$constructor("ZodBigInt", (inst, def
|
|
|
423
683
|
core.$ZodBigInt.init(inst, def);
|
|
424
684
|
ZodType.init(inst, def);
|
|
425
685
|
inst._zod.processJSONSchema = (ctx, json, params) => processors.bigintProcessor(inst, ctx, json, params);
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
}
|
|
686
|
+
},
|
|
687
|
+
/*@__PURE__*/ util.derived({
|
|
688
|
+
minValue: (inst) => processors.aggregateChecks(inst).minimum ?? null,
|
|
689
|
+
maxValue: (inst) => processors.aggregateChecks(inst).maximum ?? null,
|
|
690
|
+
format: (inst) => processors.aggregateChecks(inst).format ?? null,
|
|
691
|
+
}, {
|
|
692
|
+
gte(value, params) {
|
|
693
|
+
return this.check(checks.gte(value, params));
|
|
694
|
+
},
|
|
695
|
+
min(value, params) {
|
|
696
|
+
return this.check(checks.gte(value, params));
|
|
697
|
+
},
|
|
698
|
+
gt(value, params) {
|
|
699
|
+
return this.check(checks.gt(value, params));
|
|
700
|
+
},
|
|
701
|
+
lt(value, params) {
|
|
702
|
+
return this.check(checks.lt(value, params));
|
|
703
|
+
},
|
|
704
|
+
lte(value, params) {
|
|
705
|
+
return this.check(checks.lte(value, params));
|
|
706
|
+
},
|
|
707
|
+
max(value, params) {
|
|
708
|
+
return this.check(checks.lte(value, params));
|
|
709
|
+
},
|
|
710
|
+
positive(params) {
|
|
711
|
+
return this.check(checks.gt(BigInt(0), params));
|
|
712
|
+
},
|
|
713
|
+
negative(params) {
|
|
714
|
+
return this.check(checks.lt(BigInt(0), params));
|
|
715
|
+
},
|
|
716
|
+
nonpositive(params) {
|
|
717
|
+
return this.check(checks.lte(BigInt(0), params));
|
|
718
|
+
},
|
|
719
|
+
nonnegative(params) {
|
|
720
|
+
return this.check(checks.gte(BigInt(0), params));
|
|
721
|
+
},
|
|
722
|
+
multipleOf(value, params) {
|
|
723
|
+
return this.check(checks.multipleOf(value, params));
|
|
724
|
+
},
|
|
725
|
+
}));
|
|
444
726
|
export function bigint(params) {
|
|
445
727
|
return core._bigint(ZodBigInt, params);
|
|
446
728
|
}
|
|
@@ -448,11 +730,9 @@ export const ZodBigIntFormat = /*@__PURE__*/ core.$constructor("ZodBigIntFormat"
|
|
|
448
730
|
core.$ZodBigIntFormat.init(inst, def);
|
|
449
731
|
ZodBigInt.init(inst, def);
|
|
450
732
|
});
|
|
451
|
-
// int64
|
|
452
733
|
export function int64(params) {
|
|
453
734
|
return core._int64(ZodBigIntFormat, params);
|
|
454
735
|
}
|
|
455
|
-
// uint64
|
|
456
736
|
export function uint64(params) {
|
|
457
737
|
return core._uint64(ZodBigIntFormat, params);
|
|
458
738
|
}
|
|
@@ -521,23 +801,42 @@ export const ZodDate = /*@__PURE__*/ core.$constructor("ZodDate", (inst, def) =>
|
|
|
521
801
|
inst._zod.processJSONSchema = (ctx, json, params) => processors.dateProcessor(inst, ctx, json, params);
|
|
522
802
|
inst.min = (value, params) => inst.check(checks.gte(value, params));
|
|
523
803
|
inst.max = (value, params) => inst.check(checks.lte(value, params));
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
});
|
|
804
|
+
},
|
|
805
|
+
/*@__PURE__*/ util.derived({
|
|
806
|
+
minDate: (inst) => {
|
|
807
|
+
const { minimum } = processors.aggregateChecks(inst);
|
|
808
|
+
return minimum ? new Date(minimum) : null;
|
|
809
|
+
},
|
|
810
|
+
maxDate: (inst) => {
|
|
811
|
+
const { maximum } = processors.aggregateChecks(inst);
|
|
812
|
+
return maximum ? new Date(maximum) : null;
|
|
813
|
+
},
|
|
814
|
+
}, {}));
|
|
528
815
|
export function date(params) {
|
|
529
816
|
return core._date(ZodDate, params);
|
|
530
817
|
}
|
|
531
818
|
export const ZodArray = /*@__PURE__*/ core.$constructor("ZodArray", (inst, def) => {
|
|
819
|
+
_ensureDefaultMemoizer();
|
|
532
820
|
core.$ZodArray.init(inst, def);
|
|
533
821
|
ZodType.init(inst, def);
|
|
534
822
|
inst._zod.processJSONSchema = (ctx, json, params) => processors.arrayProcessor(inst, ctx, json, params);
|
|
535
823
|
inst.element = def.element;
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
824
|
+
}, {
|
|
825
|
+
min(n, params) {
|
|
826
|
+
return this.check(checks.minLength(n, params));
|
|
827
|
+
},
|
|
828
|
+
nonempty(params) {
|
|
829
|
+
return this.check(checks.minLength(1, params));
|
|
830
|
+
},
|
|
831
|
+
max(n, params) {
|
|
832
|
+
return this.check(checks.maxLength(n, params));
|
|
833
|
+
},
|
|
834
|
+
length(n, params) {
|
|
835
|
+
return this.check(checks.length(n, params));
|
|
836
|
+
},
|
|
837
|
+
unwrap() {
|
|
838
|
+
return this.element;
|
|
839
|
+
},
|
|
541
840
|
});
|
|
542
841
|
export function array(element, params) {
|
|
543
842
|
return core._array(ZodArray, element, params);
|
|
@@ -548,29 +847,55 @@ export function keyof(schema) {
|
|
|
548
847
|
return _enum(Object.keys(shape));
|
|
549
848
|
}
|
|
550
849
|
export const ZodObject = /*@__PURE__*/ core.$constructor("ZodObject", (inst, def) => {
|
|
850
|
+
_ensureDefaultMemoizer();
|
|
551
851
|
core.$ZodObjectJIT.init(inst, def);
|
|
552
852
|
ZodType.init(inst, def);
|
|
553
853
|
inst._zod.processJSONSchema = (ctx, json, params) => processors.objectProcessor(inst, ctx, json, params);
|
|
554
|
-
util.
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
return util.
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
return util.
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
854
|
+
util.installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
|
|
855
|
+
}, {
|
|
856
|
+
keyof() {
|
|
857
|
+
return _enum(Object.keys(this._zod.def.shape));
|
|
858
|
+
},
|
|
859
|
+
catchall(catchall) {
|
|
860
|
+
// `mergeDefs` rather than a spread: spreading reads `shape`, and resolving it can mint a whole fresh subtree
|
|
861
|
+
return this.clone(util.mergeDefs(this._zod.def, { catchall: catchall }));
|
|
862
|
+
},
|
|
863
|
+
passthrough() {
|
|
864
|
+
return this.clone(util.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
865
|
+
},
|
|
866
|
+
loose() {
|
|
867
|
+
return this.clone(util.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
868
|
+
},
|
|
869
|
+
strict() {
|
|
870
|
+
return this.clone(util.mergeDefs(this._zod.def, { catchall: never() }));
|
|
871
|
+
},
|
|
872
|
+
strip() {
|
|
873
|
+
return this.clone(util.mergeDefs(this._zod.def, { catchall: undefined }));
|
|
874
|
+
},
|
|
875
|
+
extend(incoming) {
|
|
876
|
+
return util.extend(this, incoming);
|
|
877
|
+
},
|
|
878
|
+
safeExtend(incoming) {
|
|
879
|
+
return util.safeExtend(this, incoming);
|
|
880
|
+
},
|
|
881
|
+
merge(other) {
|
|
882
|
+
return util.merge(this, other);
|
|
883
|
+
},
|
|
884
|
+
pick(mask) {
|
|
885
|
+
return util.pick(this, mask);
|
|
886
|
+
},
|
|
887
|
+
omit(mask) {
|
|
888
|
+
return util.omit(this, mask);
|
|
889
|
+
},
|
|
890
|
+
partial(...args) {
|
|
891
|
+
return util.partial(ZodOptional, this, args[0]);
|
|
892
|
+
},
|
|
893
|
+
exactPartial(...args) {
|
|
894
|
+
return util.partial(ZodExactOptional, this, args[0], "exactPartial");
|
|
895
|
+
},
|
|
896
|
+
required(...args) {
|
|
897
|
+
return util.required(ZodNonOptional, this, args[0]);
|
|
898
|
+
},
|
|
574
899
|
});
|
|
575
900
|
export function object(shape, params) {
|
|
576
901
|
const def = {
|
|
@@ -636,7 +961,7 @@ export function discriminatedUnion(discriminator, options, params) {
|
|
|
636
961
|
// const [options, params] = args;
|
|
637
962
|
return new ZodDiscriminatedUnion({
|
|
638
963
|
type: "union",
|
|
639
|
-
options,
|
|
964
|
+
options: options,
|
|
640
965
|
discriminator,
|
|
641
966
|
...util.normalizeParams(params),
|
|
642
967
|
});
|
|
@@ -654,13 +979,27 @@ export function intersection(left, right) {
|
|
|
654
979
|
});
|
|
655
980
|
}
|
|
656
981
|
export const ZodTuple = /*@__PURE__*/ core.$constructor("ZodTuple", (inst, def) => {
|
|
982
|
+
_ensureDefaultMemoizer();
|
|
657
983
|
core.$ZodTuple.init(inst, def);
|
|
658
984
|
ZodType.init(inst, def);
|
|
659
985
|
inst._zod.processJSONSchema = (ctx, json, params) => processors.tupleProcessor(inst, ctx, json, params);
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
986
|
+
}, {
|
|
987
|
+
rest(rest) {
|
|
988
|
+
return this.clone({
|
|
989
|
+
...this._zod.def,
|
|
990
|
+
rest: rest,
|
|
991
|
+
});
|
|
992
|
+
},
|
|
993
|
+
partial() {
|
|
994
|
+
const def = this._zod.def;
|
|
995
|
+
// a refinement was authored against the full arity; partialing would run it on a shorter array
|
|
996
|
+
if (def.checks?.length)
|
|
997
|
+
throw new Error(".partial() cannot be used on tuple schemas containing refinements");
|
|
998
|
+
return this.clone({
|
|
999
|
+
...def,
|
|
1000
|
+
items: def.items.map((item) => new ZodOptional({ type: "optional", innerType: item })),
|
|
1001
|
+
});
|
|
1002
|
+
},
|
|
664
1003
|
});
|
|
665
1004
|
export function tuple(items, _paramsOrRest, _params) {
|
|
666
1005
|
const hasRest = _paramsOrRest instanceof core.$ZodType;
|
|
@@ -674,6 +1013,7 @@ export function tuple(items, _paramsOrRest, _params) {
|
|
|
674
1013
|
});
|
|
675
1014
|
}
|
|
676
1015
|
export const ZodRecord = /*@__PURE__*/ core.$constructor("ZodRecord", (inst, def) => {
|
|
1016
|
+
_ensureDefaultMemoizer();
|
|
677
1017
|
core.$ZodRecord.init(inst, def);
|
|
678
1018
|
ZodType.init(inst, def);
|
|
679
1019
|
inst._zod.processJSONSchema = (ctx, json, params) => processors.recordProcessor(inst, ctx, json, params);
|
|
@@ -681,6 +1021,15 @@ export const ZodRecord = /*@__PURE__*/ core.$constructor("ZodRecord", (inst, def
|
|
|
681
1021
|
inst.valueType = def.valueType;
|
|
682
1022
|
});
|
|
683
1023
|
export function record(keyType, valueType, params) {
|
|
1024
|
+
// v3-compat: z.record(valueType, params?) — defaults keyType to z.string()
|
|
1025
|
+
if (!valueType || !valueType._zod) {
|
|
1026
|
+
return new ZodRecord({
|
|
1027
|
+
type: "record",
|
|
1028
|
+
keyType: string(),
|
|
1029
|
+
valueType: keyType,
|
|
1030
|
+
...util.normalizeParams(valueType),
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
684
1033
|
return new ZodRecord({
|
|
685
1034
|
type: "record",
|
|
686
1035
|
keyType,
|
|
@@ -690,13 +1039,12 @@ export function record(keyType, valueType, params) {
|
|
|
690
1039
|
}
|
|
691
1040
|
// type alksjf = core.output<core.$ZodRecordKey>;
|
|
692
1041
|
export function partialRecord(keyType, valueType, params) {
|
|
693
|
-
const k = core.clone(keyType);
|
|
694
|
-
k._zod.values = undefined;
|
|
695
1042
|
return new ZodRecord({
|
|
696
1043
|
type: "record",
|
|
697
|
-
keyType
|
|
1044
|
+
keyType,
|
|
698
1045
|
valueType: valueType,
|
|
699
1046
|
...util.normalizeParams(params),
|
|
1047
|
+
partial: true,
|
|
700
1048
|
});
|
|
701
1049
|
}
|
|
702
1050
|
export function looseRecord(keyType, valueType, params) {
|
|
@@ -709,6 +1057,7 @@ export function looseRecord(keyType, valueType, params) {
|
|
|
709
1057
|
});
|
|
710
1058
|
}
|
|
711
1059
|
export const ZodMap = /*@__PURE__*/ core.$constructor("ZodMap", (inst, def) => {
|
|
1060
|
+
_ensureDefaultMemoizer();
|
|
712
1061
|
core.$ZodMap.init(inst, def);
|
|
713
1062
|
ZodType.init(inst, def);
|
|
714
1063
|
inst._zod.processJSONSchema = (ctx, json, params) => processors.mapProcessor(inst, ctx, json, params);
|
|
@@ -728,6 +1077,7 @@ export function map(keyType, valueType, params) {
|
|
|
728
1077
|
});
|
|
729
1078
|
}
|
|
730
1079
|
export const ZodSet = /*@__PURE__*/ core.$constructor("ZodSet", (inst, def) => {
|
|
1080
|
+
_ensureDefaultMemoizer();
|
|
731
1081
|
core.$ZodSet.init(inst, def);
|
|
732
1082
|
ZodType.init(inst, def);
|
|
733
1083
|
inst._zod.processJSONSchema = (ctx, json, params) => processors.setProcessor(inst, ctx, json, params);
|
|
@@ -748,7 +1098,8 @@ export const ZodEnum = /*@__PURE__*/ core.$constructor("ZodEnum", (inst, def) =>
|
|
|
748
1098
|
ZodType.init(inst, def);
|
|
749
1099
|
inst._zod.processJSONSchema = (ctx, json, params) => processors.enumProcessor(inst, ctx, json, params);
|
|
750
1100
|
inst.enum = def.entries;
|
|
751
|
-
|
|
1101
|
+
// reuse the parsed value set so a numeric TS enum's reverse-mapping keys stay out
|
|
1102
|
+
inst.options = [...inst._zod.values];
|
|
752
1103
|
const keys = new Set(Object.keys(def.entries));
|
|
753
1104
|
inst.extract = (values, params) => {
|
|
754
1105
|
const newEntries = {};
|
|
@@ -839,6 +1190,7 @@ export function file(params) {
|
|
|
839
1190
|
return core._file(ZodFile, params);
|
|
840
1191
|
}
|
|
841
1192
|
export const ZodTransform = /*@__PURE__*/ core.$constructor("ZodTransform", (inst, def) => {
|
|
1193
|
+
_ensureDefaultMemoizer();
|
|
842
1194
|
core.$ZodTransform.init(inst, def);
|
|
843
1195
|
ZodType.init(inst, def);
|
|
844
1196
|
inst._zod.processJSONSchema = (ctx, json, params) => processors.transformProcessor(inst, ctx, json, params);
|
|
@@ -856,7 +1208,8 @@ export const ZodTransform = /*@__PURE__*/ core.$constructor("ZodTransform", (ins
|
|
|
856
1208
|
if (_issue.fatal)
|
|
857
1209
|
_issue.continue = false;
|
|
858
1210
|
_issue.code ?? (_issue.code = "custom");
|
|
859
|
-
|
|
1211
|
+
if (!("input" in _issue))
|
|
1212
|
+
_issue.input = payload.value;
|
|
860
1213
|
_issue.inst ?? (_issue.inst = inst);
|
|
861
1214
|
// _issue.continue ??= true;
|
|
862
1215
|
payload.issues.push(util.issue(_issue));
|
|
@@ -986,7 +1339,7 @@ function _catch(innerType, catchValue) {
|
|
|
986
1339
|
return new ZodCatch({
|
|
987
1340
|
type: "catch",
|
|
988
1341
|
innerType: innerType,
|
|
989
|
-
catchValue: (typeof catchValue === "function" ? catchValue : (
|
|
1342
|
+
catchValue: (typeof catchValue === "function" ? catchValue : core.util.constantCatch(catchValue)),
|
|
990
1343
|
});
|
|
991
1344
|
}
|
|
992
1345
|
export { _catch as catch };
|
|
@@ -1026,6 +1379,20 @@ export function codec(in_, out, params) {
|
|
|
1026
1379
|
reverseTransform: params.encode,
|
|
1027
1380
|
});
|
|
1028
1381
|
}
|
|
1382
|
+
export function invertCodec(codec) {
|
|
1383
|
+
const def = codec._zod.def;
|
|
1384
|
+
return new ZodCodec({
|
|
1385
|
+
type: "pipe",
|
|
1386
|
+
in: def.out,
|
|
1387
|
+
out: def.in,
|
|
1388
|
+
transform: def.reverseTransform,
|
|
1389
|
+
reverseTransform: def.transform,
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
export const ZodPreprocess = /*@__PURE__*/ core.$constructor("ZodPreprocess", (inst, def) => {
|
|
1393
|
+
ZodPipe.init(inst, def);
|
|
1394
|
+
core.$ZodPreprocess.init(inst, def);
|
|
1395
|
+
});
|
|
1029
1396
|
export const ZodReadonly = /*@__PURE__*/ core.$constructor("ZodReadonly", (inst, def) => {
|
|
1030
1397
|
core.$ZodReadonly.init(inst, def);
|
|
1031
1398
|
ZodType.init(inst, def);
|
|
@@ -1108,14 +1475,22 @@ export function refine(fn, _params = {}) {
|
|
|
1108
1475
|
return core._refine(ZodCustom, fn, _params);
|
|
1109
1476
|
}
|
|
1110
1477
|
// superRefine
|
|
1111
|
-
export function superRefine(fn) {
|
|
1112
|
-
return core._superRefine(fn);
|
|
1478
|
+
export function superRefine(fn, params) {
|
|
1479
|
+
return core._superRefine(fn, params);
|
|
1113
1480
|
}
|
|
1114
1481
|
// Re-export describe and meta from core
|
|
1115
1482
|
export const describe = core.describe;
|
|
1116
1483
|
export const meta = core.meta;
|
|
1484
|
+
export const ZodInstanceOf = /*@__PURE__*/ core.$constructor("ZodInstanceOf", (inst, def) => {
|
|
1485
|
+
ZodCustom.init(inst, def);
|
|
1486
|
+
}, {
|
|
1487
|
+
properties(shape, params) {
|
|
1488
|
+
// asserts in place, so the narrowed output type is truthful without a wrapper
|
|
1489
|
+
return this.check(core._properties(shape, params));
|
|
1490
|
+
},
|
|
1491
|
+
});
|
|
1117
1492
|
function _instanceof(cls, params = {}) {
|
|
1118
|
-
const inst = new
|
|
1493
|
+
const inst = new ZodInstanceOf({
|
|
1119
1494
|
type: "custom",
|
|
1120
1495
|
check: "custom",
|
|
1121
1496
|
fn: (data) => data instanceof cls,
|
|
@@ -1151,7 +1526,10 @@ export function json(params) {
|
|
|
1151
1526
|
return jsonSchema;
|
|
1152
1527
|
}
|
|
1153
1528
|
// preprocess
|
|
1154
|
-
// /** @deprecated Use `z.pipe()` and `z.transform()` instead. */
|
|
1155
1529
|
export function preprocess(fn, schema) {
|
|
1156
|
-
return
|
|
1530
|
+
return new ZodPreprocess({
|
|
1531
|
+
type: "pipe",
|
|
1532
|
+
in: transform(fn),
|
|
1533
|
+
out: schema,
|
|
1534
|
+
});
|
|
1157
1535
|
}
|