@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
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import * as util from "./util.js";
|
|
2
|
+
export class $ZodCyclicError extends Error {
|
|
3
|
+
constructor() {
|
|
4
|
+
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
5
|
+
this.name = "ZodCyclicError";
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
/** Keyed off the context object every schema in one parse call already shares. */
|
|
9
|
+
const STATE = "~memo";
|
|
10
|
+
const NO_ISSUES = [];
|
|
11
|
+
// a value a cycle can close through
|
|
12
|
+
function isRef(value) {
|
|
13
|
+
return value !== null && typeof value === "object";
|
|
14
|
+
}
|
|
15
|
+
// Receivers prefix paths in place, so the cache and every hand-out need their own copies.
|
|
16
|
+
function cloneIssues(issues) {
|
|
17
|
+
return issues.map((iss) => (iss.path ? { ...iss, path: iss.path.slice() } : { ...iss }));
|
|
18
|
+
}
|
|
19
|
+
const recursive = /*@__PURE__*/ new WeakMap();
|
|
20
|
+
/** What the walk established, in order of certainty: ordered so the strongest answer among children wins. */
|
|
21
|
+
const NONE = 0;
|
|
22
|
+
const ASSUMED = 1;
|
|
23
|
+
const PROVEN = 2;
|
|
24
|
+
/** Whether this schema's subtree contains a cycle, so one parse can re-enter it. */
|
|
25
|
+
function isRecursive(inst, stack, resolve) {
|
|
26
|
+
const cached = recursive.get(inst);
|
|
27
|
+
if (cached !== undefined)
|
|
28
|
+
return cached ? PROVEN : NONE;
|
|
29
|
+
// Relative to the walk in progress, so not cached.
|
|
30
|
+
if (stack.has(inst))
|
|
31
|
+
return PROVEN;
|
|
32
|
+
stack.add(inst);
|
|
33
|
+
let result = NONE;
|
|
34
|
+
const check = (child) => {
|
|
35
|
+
if (result !== PROVEN && child?._zod) {
|
|
36
|
+
const answer = isRecursive(child, stack, resolve);
|
|
37
|
+
if (answer > result)
|
|
38
|
+
result = answer;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
// `Reflect.ownKeys` rather than `Object.keys`, so a cycle through a declared symbol key is still seen
|
|
42
|
+
const shape = (sh, spread) => {
|
|
43
|
+
let answer = NONE;
|
|
44
|
+
for (const key of Reflect.ownKeys(sh)) {
|
|
45
|
+
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
46
|
+
// an object resolves its shape by spread, so a key it does not enumerate is never parsed; `z.properties` reads every own key and so keeps them all
|
|
47
|
+
if (spread && !desc.enumerable)
|
|
48
|
+
continue;
|
|
49
|
+
// resolving runs user code, and a factory mints a fresh subtree per read, so an edge the walk can't follow counts as a cycle
|
|
50
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;
|
|
51
|
+
if (child > answer)
|
|
52
|
+
answer = child;
|
|
53
|
+
}
|
|
54
|
+
return answer;
|
|
55
|
+
};
|
|
56
|
+
const merge = (answer) => {
|
|
57
|
+
if (answer > result)
|
|
58
|
+
result = answer;
|
|
59
|
+
};
|
|
60
|
+
const def = inst._zod.def;
|
|
61
|
+
const kind = def.type;
|
|
62
|
+
switch (kind) {
|
|
63
|
+
case "object": {
|
|
64
|
+
const raw = util.rawShape(def);
|
|
65
|
+
// a def with no raw shape answers `shape` from an accessor of its own, and running that can mint a whole fresh subtree
|
|
66
|
+
merge(raw ? shape(raw, true) : ASSUMED);
|
|
67
|
+
check(def.catchall);
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
case "array":
|
|
71
|
+
check(def.element);
|
|
72
|
+
break;
|
|
73
|
+
case "tuple":
|
|
74
|
+
for (const el of def.items)
|
|
75
|
+
check(el);
|
|
76
|
+
check(def.rest);
|
|
77
|
+
break;
|
|
78
|
+
case "record":
|
|
79
|
+
case "map":
|
|
80
|
+
check(def.keyType);
|
|
81
|
+
check(def.valueType);
|
|
82
|
+
break;
|
|
83
|
+
case "set":
|
|
84
|
+
check(def.valueType);
|
|
85
|
+
break;
|
|
86
|
+
case "union":
|
|
87
|
+
for (const el of def.options)
|
|
88
|
+
check(el);
|
|
89
|
+
break;
|
|
90
|
+
case "intersection":
|
|
91
|
+
check(def.left);
|
|
92
|
+
check(def.right);
|
|
93
|
+
break;
|
|
94
|
+
case "optional":
|
|
95
|
+
case "nullable":
|
|
96
|
+
case "default":
|
|
97
|
+
case "prefault":
|
|
98
|
+
case "catch":
|
|
99
|
+
case "readonly":
|
|
100
|
+
case "nonoptional":
|
|
101
|
+
case "promise":
|
|
102
|
+
case "success":
|
|
103
|
+
check(def.innerType);
|
|
104
|
+
break;
|
|
105
|
+
case "pipe":
|
|
106
|
+
check(def.in);
|
|
107
|
+
check(def.out);
|
|
108
|
+
break;
|
|
109
|
+
case "function":
|
|
110
|
+
check(def.input);
|
|
111
|
+
check(def.output);
|
|
112
|
+
break;
|
|
113
|
+
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
114
|
+
case "lazy": {
|
|
115
|
+
const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : undefined);
|
|
116
|
+
// walked with resolution off: one hop sees past the deferral, and a lazy that yields only another unresolved lazy is generative, so it stops there
|
|
117
|
+
merge(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
// a leaf by choice: `parts` are regex fragments, not data positions
|
|
121
|
+
case "template_literal":
|
|
122
|
+
// leaves
|
|
123
|
+
case "string":
|
|
124
|
+
case "number":
|
|
125
|
+
case "int":
|
|
126
|
+
case "boolean":
|
|
127
|
+
case "bigint":
|
|
128
|
+
case "symbol":
|
|
129
|
+
case "undefined":
|
|
130
|
+
case "null":
|
|
131
|
+
case "void":
|
|
132
|
+
case "never":
|
|
133
|
+
case "any":
|
|
134
|
+
case "unknown":
|
|
135
|
+
case "date":
|
|
136
|
+
case "nan":
|
|
137
|
+
case "enum":
|
|
138
|
+
case "literal":
|
|
139
|
+
case "file":
|
|
140
|
+
case "transform":
|
|
141
|
+
case "custom":
|
|
142
|
+
break;
|
|
143
|
+
default: {
|
|
144
|
+
// a new built-in kind becomes a compile error here
|
|
145
|
+
kind;
|
|
146
|
+
// a user-defined kind can still hold children, and only its author knows where, so fall back to scanning the def — skipping accessors, since reading one can run user code
|
|
147
|
+
for (const key in def) {
|
|
148
|
+
const desc = Object.getOwnPropertyDescriptor(def, key);
|
|
149
|
+
if (!desc || desc.get)
|
|
150
|
+
continue;
|
|
151
|
+
const value = desc.value;
|
|
152
|
+
if (!value || typeof value !== "object")
|
|
153
|
+
continue;
|
|
154
|
+
if (value._zod)
|
|
155
|
+
check(value);
|
|
156
|
+
else if (Array.isArray(value))
|
|
157
|
+
for (const el of value)
|
|
158
|
+
check(el);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
stack.delete(inst);
|
|
163
|
+
return settle(inst, result);
|
|
164
|
+
}
|
|
165
|
+
/** An assumed answer must not outlive the resolution that settles it, so only a certain one is cached. */
|
|
166
|
+
function settle(inst, answer) {
|
|
167
|
+
if (answer !== ASSUMED)
|
|
168
|
+
recursive.set(inst, answer === PROVEN);
|
|
169
|
+
return answer;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Whether one parse can re-enter this schema, i.e. its subtree contains a cycle.
|
|
173
|
+
* Exported for `z.compile`, which refuses to compile such a schema: cycle
|
|
174
|
+
* breaking is driven from here off state keyed on the parse context, and a
|
|
175
|
+
* generated fast path has no context to key on.
|
|
176
|
+
*/
|
|
177
|
+
export function isRecursiveSchema(inst) {
|
|
178
|
+
// z.compile never parses, so nothing would ever resolve a lazy for it; it runs once and already treats a throw here as recursive
|
|
179
|
+
return isRecursive(inst, new Set(), true) !== NONE;
|
|
180
|
+
}
|
|
181
|
+
function bucketFor(state, inst) {
|
|
182
|
+
let bucket = state.buckets.get(inst);
|
|
183
|
+
if (!bucket) {
|
|
184
|
+
bucket = new WeakMap();
|
|
185
|
+
state.buckets.set(inst, bucket);
|
|
186
|
+
}
|
|
187
|
+
return bucket;
|
|
188
|
+
}
|
|
189
|
+
// Set immediately before delegating to core and cleared immediately after, so `alloc` registers only for a visit this module is driving.
|
|
190
|
+
let handoff;
|
|
191
|
+
// Allocated but unfinished entries. `alloc` and the matching pop both happen in the synchronous part of a parse, so they nest even when children are async, and one stack serves every schema.
|
|
192
|
+
const open = [];
|
|
193
|
+
const memo = {
|
|
194
|
+
alloc(_inst, payload, empty) {
|
|
195
|
+
const bucket = handoff;
|
|
196
|
+
if (!bucket)
|
|
197
|
+
return empty;
|
|
198
|
+
handoff = undefined;
|
|
199
|
+
const entry = { value: empty, issues: null };
|
|
200
|
+
bucket.set(payload.value, entry);
|
|
201
|
+
open.push(entry);
|
|
202
|
+
return empty;
|
|
203
|
+
},
|
|
204
|
+
guard(inst) {
|
|
205
|
+
var _a;
|
|
206
|
+
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
207
|
+
inst._zod.deferred.push(() => {
|
|
208
|
+
const base = inst._zod.parse;
|
|
209
|
+
const wrapped = (payload, ctx) => {
|
|
210
|
+
// The value is a placeholder a back-edge is still waiting on, so the cycle closes through this transform. Its output can't exist in time to bind.
|
|
211
|
+
if (ctx.direction !== "backward" && isBackEdge(ctx, payload.value))
|
|
212
|
+
throw new $ZodCyclicError();
|
|
213
|
+
return base(payload, ctx);
|
|
214
|
+
};
|
|
215
|
+
inst._zod.parse = wrapped;
|
|
216
|
+
if (inst._zod.run === base)
|
|
217
|
+
inst._zod.run = wrapped;
|
|
218
|
+
});
|
|
219
|
+
},
|
|
220
|
+
attach(inst) {
|
|
221
|
+
var _a;
|
|
222
|
+
let isRecursiveInst;
|
|
223
|
+
let rechecked = false;
|
|
224
|
+
// a recursive schema is re-entered many times per parse and its bucket never changes
|
|
225
|
+
let lastCtx;
|
|
226
|
+
let lastBucket;
|
|
227
|
+
// Wraps `parse` in a deferred so it sees the container's final parse. Core's own deferred copies `parse` into `run` when there are no checks, and it ran first, so `run` is patched to match; with checks, `run` reads `parse` dynamically.
|
|
228
|
+
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
229
|
+
inst._zod.deferred.push(() => {
|
|
230
|
+
const base = inst._zod.parse;
|
|
231
|
+
const wrapped = (payload, ctx) => {
|
|
232
|
+
if (isRecursiveInst === undefined) {
|
|
233
|
+
const walked = isRecursive(inst, new Set(), false);
|
|
234
|
+
if (walked === NONE) {
|
|
235
|
+
// Nothing here can ever fire, so take it back out.
|
|
236
|
+
inst._zod.parse = base;
|
|
237
|
+
if (inst._zod.run === wrapped)
|
|
238
|
+
inst._zod.run = base;
|
|
239
|
+
return base(payload, ctx);
|
|
240
|
+
}
|
|
241
|
+
// this parse resolves the deferred edges on its own path, so ask once more before latching
|
|
242
|
+
if (walked === PROVEN || rechecked)
|
|
243
|
+
isRecursiveInst = true;
|
|
244
|
+
else
|
|
245
|
+
rechecked = true;
|
|
246
|
+
}
|
|
247
|
+
const input = payload.value;
|
|
248
|
+
if (!isRef(input))
|
|
249
|
+
return base(payload, ctx);
|
|
250
|
+
let state = ctx[STATE];
|
|
251
|
+
if (!state) {
|
|
252
|
+
state = { buckets: new WeakMap(), backEdges: undefined };
|
|
253
|
+
ctx[STATE] = state;
|
|
254
|
+
}
|
|
255
|
+
let bucket;
|
|
256
|
+
if (lastCtx === ctx) {
|
|
257
|
+
bucket = lastBucket;
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
bucket = bucketFor(state, inst);
|
|
261
|
+
lastCtx = ctx;
|
|
262
|
+
lastBucket = bucket;
|
|
263
|
+
}
|
|
264
|
+
const hit = bucket.get(input);
|
|
265
|
+
if (hit) {
|
|
266
|
+
payload.value = hit.value;
|
|
267
|
+
if (hit.issues) {
|
|
268
|
+
if (hit.issues.length)
|
|
269
|
+
payload.issues.push(...cloneIssues(hit.issues));
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
// Still being parsed: its own checks cover it, so skip them here.
|
|
273
|
+
payload.memo = true;
|
|
274
|
+
state.backEdges ?? (state.backEdges = new WeakSet());
|
|
275
|
+
state.backEdges.add(hit.value);
|
|
276
|
+
}
|
|
277
|
+
return payload;
|
|
278
|
+
}
|
|
279
|
+
handoff = bucket;
|
|
280
|
+
const depth = open.length;
|
|
281
|
+
const result = base(payload, ctx);
|
|
282
|
+
handoff = undefined;
|
|
283
|
+
// A container that rejected its input outright allocated nothing.
|
|
284
|
+
const entry = open.length > depth ? open.pop() : undefined;
|
|
285
|
+
// Both paths written out so the sync one allocates no closure. It runs once per node, and capturing here cost more than everything else combined.
|
|
286
|
+
if (result instanceof Promise) {
|
|
287
|
+
return result.then((r) => {
|
|
288
|
+
if (entry)
|
|
289
|
+
entry.issues = r.issues.length ? cloneIssues(r.issues) : NO_ISSUES;
|
|
290
|
+
return r;
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
if (entry)
|
|
294
|
+
entry.issues = result.issues.length ? cloneIssues(result.issues) : NO_ISSUES;
|
|
295
|
+
return result;
|
|
296
|
+
};
|
|
297
|
+
inst._zod.parse = wrapped;
|
|
298
|
+
if (inst._zod.run === base)
|
|
299
|
+
inst._zod.run = wrapped;
|
|
300
|
+
});
|
|
301
|
+
},
|
|
302
|
+
};
|
|
303
|
+
/** The memoizer that gives containers cycle support. `zod` installs it by default; `zod/mini` opts in with `config({ memoizer: memoizer() })`. */
|
|
304
|
+
export function memoizer() {
|
|
305
|
+
return memo;
|
|
306
|
+
}
|
|
307
|
+
/** Whether this value is a node a back-edge resolved to before it finished. */
|
|
308
|
+
export function isBackEdge(ctx, value) {
|
|
309
|
+
const backEdges = ctx[STATE]?.backEdges;
|
|
310
|
+
return backEdges !== undefined && isRef(value) && backEdges.has(value);
|
|
311
|
+
}
|
|
@@ -1,31 +1,41 @@
|
|
|
1
1
|
import * as core from "./core.js";
|
|
2
2
|
import * as errors from "./errors.js";
|
|
3
3
|
import * as util from "./util.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
// Always both keys, so the `_params` read site in `_parse` sees one object shape rather than two.
|
|
5
|
+
function finalizeParams(callee, params) {
|
|
6
|
+
return { callee: params?.callee ?? callee, Err: params?.Err };
|
|
7
|
+
}
|
|
8
|
+
export const _parse = (_Err) => {
|
|
9
|
+
const fn = (schema, value, _ctx, _params) => {
|
|
10
|
+
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
11
|
+
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
12
|
+
if (result instanceof Promise) {
|
|
13
|
+
throw new core.$ZodAsyncError();
|
|
14
|
+
}
|
|
15
|
+
if (result.issues.length) {
|
|
16
|
+
const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));
|
|
17
|
+
util.captureStackTrace(e, _params?.callee ?? fn);
|
|
18
|
+
throw e;
|
|
19
|
+
}
|
|
20
|
+
return result.value;
|
|
21
|
+
};
|
|
22
|
+
return fn;
|
|
16
23
|
};
|
|
17
24
|
export const parse = /* @__PURE__*/ _parse(errors.$ZodRealError);
|
|
18
|
-
export const _parseAsync = (_Err) =>
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
result
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
export const _parseAsync = (_Err) => {
|
|
26
|
+
const fn = async (schema, value, _ctx, params) => {
|
|
27
|
+
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
28
|
+
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
29
|
+
if (result instanceof Promise)
|
|
30
|
+
result = await result;
|
|
31
|
+
if (result.issues.length) {
|
|
32
|
+
const e = new (params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));
|
|
33
|
+
util.captureStackTrace(e, params?.callee ?? fn);
|
|
34
|
+
throw e;
|
|
35
|
+
}
|
|
36
|
+
return result.value;
|
|
37
|
+
};
|
|
38
|
+
return fn;
|
|
29
39
|
};
|
|
30
40
|
export const parseAsync = /* @__PURE__*/ _parseAsync(errors.$ZodRealError);
|
|
31
41
|
export const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
@@ -34,47 +44,119 @@ export const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
|
34
44
|
if (result instanceof Promise) {
|
|
35
45
|
throw new core.$ZodAsyncError();
|
|
36
46
|
}
|
|
37
|
-
return result.issues.length
|
|
38
|
-
? {
|
|
39
|
-
success: false,
|
|
40
|
-
error: new (_Err ?? errors.$ZodError)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
|
|
41
|
-
}
|
|
42
|
-
: { success: true, data: result.value };
|
|
47
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
43
48
|
};
|
|
44
49
|
export const safeParse = /* @__PURE__*/ _safeParse(errors.$ZodRealError);
|
|
50
|
+
// the error is built on the first read of `error`: finalizing the issues and constructing the instance is most of a failing parse, and a caller that only branches on `success` never pays it. a getter in the literal keeps this small; the alternative, one shared accessor descriptor plus a hidden state slot, reads ~15% faster but costs ~75 B gzipped in every bundle
|
|
51
|
+
function failure(Err, issues, ctx) {
|
|
52
|
+
let error;
|
|
53
|
+
return {
|
|
54
|
+
success: false,
|
|
55
|
+
get error() {
|
|
56
|
+
if (!error) {
|
|
57
|
+
error = new Err(issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));
|
|
58
|
+
// finalizeIssue drops `input`, so the built error holds nothing; keeping the raw issues past this point pins the parsed value for the life of the result
|
|
59
|
+
issues = undefined;
|
|
60
|
+
ctx = undefined;
|
|
61
|
+
}
|
|
62
|
+
return error;
|
|
63
|
+
},
|
|
64
|
+
set error(e) {
|
|
65
|
+
error = e;
|
|
66
|
+
// a replacement makes the getter's branch unreachable, so the captures have to go here too
|
|
67
|
+
issues = undefined;
|
|
68
|
+
ctx = undefined;
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
45
72
|
export const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
46
|
-
const ctx = _ctx ?
|
|
73
|
+
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
47
74
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
48
75
|
if (result instanceof Promise)
|
|
49
76
|
result = await result;
|
|
50
|
-
return result.issues.length
|
|
51
|
-
? {
|
|
52
|
-
success: false,
|
|
53
|
-
error: new _Err(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
|
|
54
|
-
}
|
|
55
|
-
: { success: true, data: result.value };
|
|
77
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
56
78
|
};
|
|
57
79
|
export const safeParseAsync = /* @__PURE__*/ _safeParseAsync(errors.$ZodRealError);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
80
|
+
// registry mirrors of the compiler's sentinels, so this module never imports the compiler
|
|
81
|
+
const COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
82
|
+
const COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
83
|
+
// Deliberately tiny, because v8 will not inline a body carrying the fallback's object literals and throw. Everything that is not the compiled happy path lives in validateFallback, and that split is worth ~35% on a compiled schema.
|
|
84
|
+
export const validate = ((schema, value, _ctx) => {
|
|
85
|
+
const validator = schema._zod.bag.validator;
|
|
86
|
+
if (validator !== undefined) {
|
|
87
|
+
if (validator(value) !== COMPILE_INVALID)
|
|
88
|
+
return true;
|
|
89
|
+
// a definite sentinel means the runtime would reject, so skip the re-parse; a ctx can still change the answer
|
|
90
|
+
if (validator.definite === true && _ctx === undefined)
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
return validateFallback(schema, value, _ctx);
|
|
94
|
+
});
|
|
95
|
+
function validateFallback(schema, value, _ctx) {
|
|
96
|
+
const ctx = _ctx
|
|
97
|
+
? { ..._ctx, async: false, abortEarly: true }
|
|
98
|
+
: { async: false, abortEarly: true };
|
|
99
|
+
const fallbackRun = schema._zod.bag.fallbackRun;
|
|
100
|
+
let result;
|
|
101
|
+
if (fallbackRun) {
|
|
102
|
+
// skip nested fast paths on the fallback, so user callbacks keep the at-most-twice bound
|
|
103
|
+
ctx[COMPILE_FALLBACK] = true;
|
|
104
|
+
result = fallbackRun({ value, issues: [] }, ctx);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
result = schema._zod.run({ value, issues: [] }, ctx);
|
|
108
|
+
}
|
|
109
|
+
if (result instanceof Promise) {
|
|
110
|
+
throw new core.$ZodAsyncError();
|
|
111
|
+
}
|
|
112
|
+
return result.issues.length === 0;
|
|
113
|
+
}
|
|
114
|
+
// no fast path: the compiler keeps async parses on the runtime, because a promise-returning callback that is not declared async compiles to a throw
|
|
115
|
+
export const validateAsync = async (schema, value, _ctx) => {
|
|
116
|
+
const ctx = _ctx
|
|
117
|
+
? { ..._ctx, async: true, abortEarly: true }
|
|
118
|
+
: { async: true, abortEarly: true };
|
|
119
|
+
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
120
|
+
if (result instanceof Promise)
|
|
121
|
+
result = await result;
|
|
122
|
+
return result.issues.length === 0;
|
|
123
|
+
};
|
|
124
|
+
export const _encode = (_Err) => {
|
|
125
|
+
const parse = _parse(_Err);
|
|
126
|
+
const fn = (schema, value, _ctx, _params) => {
|
|
127
|
+
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
128
|
+
return parse(schema, value, ctx, finalizeParams(fn, _params));
|
|
129
|
+
};
|
|
130
|
+
return fn;
|
|
61
131
|
};
|
|
62
132
|
export const encode = /* @__PURE__*/ _encode(errors.$ZodRealError);
|
|
63
|
-
export const _decode = (_Err) =>
|
|
64
|
-
|
|
133
|
+
export const _decode = (_Err) => {
|
|
134
|
+
const parse = _parse(_Err);
|
|
135
|
+
const fn = (schema, value, _ctx, _params) => {
|
|
136
|
+
return parse(schema, value, _ctx, finalizeParams(fn, _params));
|
|
137
|
+
};
|
|
138
|
+
return fn;
|
|
65
139
|
};
|
|
66
140
|
export const decode = /* @__PURE__*/ _decode(errors.$ZodRealError);
|
|
67
|
-
export const _encodeAsync = (_Err) =>
|
|
68
|
-
const
|
|
69
|
-
|
|
141
|
+
export const _encodeAsync = (_Err) => {
|
|
142
|
+
const parseAsync = _parseAsync(_Err);
|
|
143
|
+
const fn = async (schema, value, _ctx, _params) => {
|
|
144
|
+
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
145
|
+
return (await parseAsync(schema, value, ctx, finalizeParams(fn, _params)));
|
|
146
|
+
};
|
|
147
|
+
return fn;
|
|
70
148
|
};
|
|
71
149
|
export const encodeAsync = /* @__PURE__*/ _encodeAsync(errors.$ZodRealError);
|
|
72
|
-
export const _decodeAsync = (_Err) =>
|
|
73
|
-
|
|
150
|
+
export const _decodeAsync = (_Err) => {
|
|
151
|
+
const parseAsync = _parseAsync(_Err);
|
|
152
|
+
const fn = async (schema, value, _ctx, _params) => {
|
|
153
|
+
return await parseAsync(schema, value, _ctx, finalizeParams(fn, _params));
|
|
154
|
+
};
|
|
155
|
+
return fn;
|
|
74
156
|
};
|
|
75
157
|
export const decodeAsync = /* @__PURE__*/ _decodeAsync(errors.$ZodRealError);
|
|
76
158
|
export const _safeEncode = (_Err) => (schema, value, _ctx) => {
|
|
77
|
-
const ctx = _ctx ?
|
|
159
|
+
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
78
160
|
return _safeParse(_Err)(schema, value, ctx);
|
|
79
161
|
};
|
|
80
162
|
export const safeEncode = /* @__PURE__*/ _safeEncode(errors.$ZodRealError);
|
|
@@ -83,7 +165,7 @@ export const _safeDecode = (_Err) => (schema, value, _ctx) => {
|
|
|
83
165
|
};
|
|
84
166
|
export const safeDecode = /* @__PURE__*/ _safeDecode(errors.$ZodRealError);
|
|
85
167
|
export const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
86
|
-
const ctx = _ctx ?
|
|
168
|
+
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
87
169
|
return _safeParseAsync(_Err)(schema, value, ctx);
|
|
88
170
|
};
|
|
89
171
|
export const safeEncodeAsync = /* @__PURE__*/ _safeEncodeAsync(errors.$ZodRealError);
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import * as util from "./util.js";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
4
|
+
* (timestamps embedded in the id). Use {@link cuid2} instead.
|
|
5
|
+
* See https://github.com/paralleldrive/cuid.
|
|
6
|
+
*/
|
|
7
|
+
export const cuid = /^[cC][0-9a-z]{6,}$/;
|
|
3
8
|
export const cuid2 = /^[0-9a-z]+$/;
|
|
4
|
-
export const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{
|
|
9
|
+
export const ulid = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;
|
|
5
10
|
export const xid = /^[0-9a-vA-V]{20}$/;
|
|
6
11
|
export const ksuid = /^[A-Za-z0-9]{27}$/;
|
|
7
12
|
export const nanoid = /^[a-zA-Z0-9_-]{21}$/;
|
|
13
|
+
export function nanoidOfLength(length) {
|
|
14
|
+
return new RegExp(`^[a-zA-Z0-9_-]{${length}}$`);
|
|
15
|
+
}
|
|
8
16
|
/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
|
|
9
17
|
export const duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
10
18
|
/** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */
|
|
@@ -23,7 +31,7 @@ export const uuid4 = /*@__PURE__*/ uuid(4);
|
|
|
23
31
|
export const uuid6 = /*@__PURE__*/ uuid(6);
|
|
24
32
|
export const uuid7 = /*@__PURE__*/ uuid(7);
|
|
25
33
|
/** Practical email validation */
|
|
26
|
-
export const email = /^(
|
|
34
|
+
export const email = /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
27
35
|
/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */
|
|
28
36
|
export const html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
29
37
|
/** The classic emailregex.com regex for RFC 5322-compliant emails */
|
|
@@ -33,7 +41,8 @@ export const unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
|
|
|
33
41
|
export const idnEmail = unicodeEmail;
|
|
34
42
|
export const browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
35
43
|
// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression
|
|
36
|
-
|
|
44
|
+
// Single character class, not an alternation: the two properties overlap (U+1F9B0-U+1F9B3), so `(A|B)+` backtracks exponentially on a failed match. The leading lookahead then demands one anchor — a pictograph, a regional indicator, or the enclosing keycap — because `\p{Emoji_Component}` on its own covers ASCII digits, `#`, `*`, ZWJ, variation selectors and skin tone modifiers, none of which is an emoji without a base.
|
|
45
|
+
const _emoji = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
37
46
|
export function emoji() {
|
|
38
47
|
return new RegExp(_emoji, "u");
|
|
39
48
|
}
|
|
@@ -44,20 +53,31 @@ export const mac = (delimiter) => {
|
|
|
44
53
|
return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);
|
|
45
54
|
};
|
|
46
55
|
export const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
|
|
47
|
-
export const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}
|
|
56
|
+
export const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
48
57
|
// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript
|
|
49
58
|
export const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
50
|
-
export const base64url = /^[A-Za-z0-9_-]
|
|
59
|
+
export const base64url = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;
|
|
51
60
|
// based on https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address
|
|
52
61
|
// export const hostname: RegExp = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
|
|
53
62
|
export const hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
|
|
54
|
-
export const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
|
|
55
|
-
|
|
56
|
-
// E.164: leading digit must be 1-9; total digits (excluding '+') between 7-15
|
|
63
|
+
export const domain = /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/;
|
|
64
|
+
export const httpProtocol = /^https?$/;
|
|
65
|
+
// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces) E.164: leading digit must be 1-9; total digits (excluding '+') between 7-15
|
|
57
66
|
export const e164 = /^\+[1-9]\d{6,14}$/;
|
|
58
|
-
//
|
|
67
|
+
// Credit card shape: 12–19 digits, optionally separated by single spaces or single hyphens. ISO/IEC 7812 caps the PAN at 19 digits; 12 is the shortest issued length (Maestro).
|
|
68
|
+
export const creditCard = /^\d(?:[ -]?\d){11,18}$/;
|
|
69
|
+
// ISO 4217 alpha codes from the SIX list, regenerated by scripts/update-iso-4217.ts
|
|
70
|
+
export const currencyCode = /^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/;
|
|
71
|
+
// iban electronic format: 2-letter country, check digits 02-98 (the only values `98 - remainder` can produce), 11-30 bban characters
|
|
72
|
+
export const iban = /^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/;
|
|
59
73
|
const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
|
|
60
|
-
|
|
74
|
+
/** Anchors a pattern source. The interpolation lives here rather than at the call site because
|
|
75
|
+
* esbuild will not drop a `@__PURE__` call whose own argument interpolates a variable, but it
|
|
76
|
+
* will drop `anchor(dateSource)`. Keeping it inline pinned `date` into every bundle. */
|
|
77
|
+
function anchor(source) {
|
|
78
|
+
return new RegExp(`^${source}$`);
|
|
79
|
+
}
|
|
80
|
+
export const date = /*@__PURE__*/ anchor(dateSource);
|
|
61
81
|
function timeSource(args) {
|
|
62
82
|
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
63
83
|
const regex = typeof args.precision === "number"
|
|
@@ -66,7 +86,9 @@ function timeSource(args) {
|
|
|
66
86
|
: args.precision === 0
|
|
67
87
|
? `${hhmm}:[0-5]\\d`
|
|
68
88
|
: `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}`
|
|
69
|
-
:
|
|
89
|
+
: args.seconds
|
|
90
|
+
? `${hhmm}:[0-5]\\d(?:\\.\\d+)?`
|
|
91
|
+
: `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
70
92
|
return regex;
|
|
71
93
|
}
|
|
72
94
|
export function time(args) {
|
|
@@ -74,16 +96,17 @@ export function time(args) {
|
|
|
74
96
|
}
|
|
75
97
|
// Adapted from https://stackoverflow.com/a/3143231
|
|
76
98
|
export function datetime(args) {
|
|
77
|
-
const time = timeSource({ precision: args.precision });
|
|
78
99
|
const opts = ["Z"];
|
|
79
|
-
if (args.local)
|
|
80
|
-
opts.push("");
|
|
81
100
|
// if (args.offset) opts.push(`([+-]\\d{2}:\\d{2})`);
|
|
82
101
|
if (args.offset)
|
|
83
102
|
opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
|
|
84
|
-
|
|
103
|
+
// RFC 3339 mandates seconds wherever the time carries a `Z` or an offset, so only the unqualified form `local` adds may omit them
|
|
104
|
+
const qualified = `${timeSource({ precision: args.precision, seconds: true })}(?:${opts.join("|")})`;
|
|
105
|
+
const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
|
|
85
106
|
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
86
107
|
}
|
|
108
|
+
// the unbounded form of `string()` as a literal, so every plain string shares one instance instead of building its own
|
|
109
|
+
export const anyString = /^[\s\S]{0,}$/;
|
|
87
110
|
export const string = (params) => {
|
|
88
111
|
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
89
112
|
return new RegExp(`^${regex}$`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _a;
|
|
2
|
-
export const $output = Symbol("ZodOutput");
|
|
3
|
-
export const $input = Symbol("ZodInput");
|
|
2
|
+
export const $output = /*@__PURE__*/ Symbol("ZodOutput");
|
|
3
|
+
export const $input = /*@__PURE__*/ Symbol("ZodInput");
|
|
4
4
|
export class $ZodRegistry {
|
|
5
5
|
constructor() {
|
|
6
6
|
this._map = new WeakMap();
|