@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,110 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
* Base64 Encodes an arraybuffer
|
|
3
|
-
* @param {ArrayBuffer} arraybuffer
|
|
4
|
-
* @returns {string}
|
|
5
|
-
*/
|
|
6
|
-
export function encode64(arraybuffer) {
|
|
7
|
-
const dv = new DataView(arraybuffer);
|
|
8
|
-
let binaryString = "";
|
|
1
|
+
/* Baseline 2025 runtimes */
|
|
9
2
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
/** @type {(array_buffer: ArrayBuffer) => string} */
|
|
4
|
+
export function encode_native(array_buffer) {
|
|
5
|
+
return new Uint8Array(array_buffer).toBase64();
|
|
6
|
+
}
|
|
13
7
|
|
|
14
|
-
|
|
8
|
+
/** @type {(base64: string) => ArrayBuffer} */
|
|
9
|
+
export function decode_native(base64) {
|
|
10
|
+
return Uint8Array.fromBase64(base64).buffer;
|
|
15
11
|
}
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
* Decodes a base64 string into an arraybuffer
|
|
19
|
-
* @param {string} string
|
|
20
|
-
* @returns {ArrayBuffer}
|
|
21
|
-
*/
|
|
22
|
-
export function decode64(string) {
|
|
23
|
-
const binaryString = asciiToBinary(string);
|
|
24
|
-
const arraybuffer = new ArrayBuffer(binaryString.length);
|
|
25
|
-
const dv = new DataView(arraybuffer);
|
|
13
|
+
/* Node-compatible runtimes */
|
|
26
14
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
/** @type {(array_buffer: ArrayBuffer) => string} */
|
|
16
|
+
export function encode_buffer(array_buffer) {
|
|
17
|
+
return Buffer.from(array_buffer).toString('base64');
|
|
18
|
+
}
|
|
30
19
|
|
|
31
|
-
|
|
20
|
+
/** @type {(base64: string) => ArrayBuffer} */
|
|
21
|
+
export function decode_buffer(base64) {
|
|
22
|
+
return Uint8Array.from(Buffer.from(base64, 'base64')).buffer;
|
|
32
23
|
}
|
|
33
24
|
|
|
34
|
-
|
|
35
|
-
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
25
|
+
/* Legacy runtimes */
|
|
36
26
|
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
* @see https://github.com/jsdom/abab/blob/master/lib/atob.js
|
|
42
|
-
*
|
|
43
|
-
* @param {string} data
|
|
44
|
-
* @returns {string}
|
|
45
|
-
*/
|
|
46
|
-
function asciiToBinary(data) {
|
|
47
|
-
if (data.length % 4 === 0) {
|
|
48
|
-
data = data.replace(/==?$/, "");
|
|
49
|
-
}
|
|
27
|
+
/** @type {(array_buffer: ArrayBuffer) => string} */
|
|
28
|
+
export function encode_legacy(array_buffer) {
|
|
29
|
+
const array = new Uint8Array(array_buffer);
|
|
30
|
+
let binary = '';
|
|
50
31
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
32
|
+
// the maximum number of arguments to String.fromCharCode.apply
|
|
33
|
+
// should be around 0xFFFF in modern engines
|
|
34
|
+
const chunk_size = 0x8000;
|
|
35
|
+
for (let i = 0; i < array.length; i += chunk_size) {
|
|
36
|
+
const chunk = array.subarray(i, i + chunk_size);
|
|
37
|
+
binary += String.fromCharCode.apply(null, chunk);
|
|
38
|
+
}
|
|
54
39
|
|
|
55
|
-
|
|
56
|
-
buffer <<= 6;
|
|
57
|
-
buffer |= KEY_STRING.indexOf(data[i]);
|
|
58
|
-
accumulatedBits += 6;
|
|
59
|
-
if (accumulatedBits === 24) {
|
|
60
|
-
output += String.fromCharCode((buffer & 0xff0000) >> 16);
|
|
61
|
-
output += String.fromCharCode((buffer & 0xff00) >> 8);
|
|
62
|
-
output += String.fromCharCode(buffer & 0xff);
|
|
63
|
-
buffer = accumulatedBits = 0;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
if (accumulatedBits === 12) {
|
|
67
|
-
buffer >>= 4;
|
|
68
|
-
output += String.fromCharCode(buffer);
|
|
69
|
-
} else if (accumulatedBits === 18) {
|
|
70
|
-
buffer >>= 2;
|
|
71
|
-
output += String.fromCharCode((buffer & 0xff00) >> 8);
|
|
72
|
-
output += String.fromCharCode(buffer & 0xff);
|
|
73
|
-
}
|
|
74
|
-
return output;
|
|
40
|
+
return btoa(binary);
|
|
75
41
|
}
|
|
76
42
|
|
|
77
|
-
/**
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
for (let i = 0; i < str.length; i += 3) {
|
|
89
|
-
/** @type {[number, number, number, number]} */
|
|
90
|
-
const groupsOfSix = [undefined, undefined, undefined, undefined];
|
|
91
|
-
groupsOfSix[0] = str.charCodeAt(i) >> 2;
|
|
92
|
-
groupsOfSix[1] = (str.charCodeAt(i) & 0x03) << 4;
|
|
93
|
-
if (str.length > i + 1) {
|
|
94
|
-
groupsOfSix[1] |= str.charCodeAt(i + 1) >> 4;
|
|
95
|
-
groupsOfSix[2] = (str.charCodeAt(i + 1) & 0x0f) << 2;
|
|
96
|
-
}
|
|
97
|
-
if (str.length > i + 2) {
|
|
98
|
-
groupsOfSix[2] |= str.charCodeAt(i + 2) >> 6;
|
|
99
|
-
groupsOfSix[3] = str.charCodeAt(i + 2) & 0x3f;
|
|
100
|
-
}
|
|
101
|
-
for (let j = 0; j < groupsOfSix.length; j++) {
|
|
102
|
-
if (typeof groupsOfSix[j] === "undefined") {
|
|
103
|
-
out += "=";
|
|
104
|
-
} else {
|
|
105
|
-
out += KEY_STRING[groupsOfSix[j]];
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
return out;
|
|
43
|
+
/** @type {(base64: string) => ArrayBuffer} */
|
|
44
|
+
export function decode_legacy(base64) {
|
|
45
|
+
const binary_string = atob(base64);
|
|
46
|
+
const len = binary_string.length;
|
|
47
|
+
const array = new Uint8Array(len);
|
|
48
|
+
|
|
49
|
+
for (let i = 0; i < len; i++) {
|
|
50
|
+
array[i] = binary_string.charCodeAt(i);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return array.buffer;
|
|
110
54
|
}
|
|
55
|
+
|
|
56
|
+
const native = typeof Uint8Array.fromBase64 === 'function';
|
|
57
|
+
const buffer = typeof process === 'object' && process.versions?.node !== undefined;
|
|
58
|
+
|
|
59
|
+
export const encode64 = native ? encode_native : buffer ? encode_buffer : encode_legacy;
|
|
60
|
+
export const decode64 = native ? decode_native : buffer ? decode_buffer : decode_legacy;
|
|
@@ -5,3 +5,8 @@ export const POSITIVE_INFINITY = -4;
|
|
|
5
5
|
export const NEGATIVE_INFINITY = -5;
|
|
6
6
|
export const NEGATIVE_ZERO = -6;
|
|
7
7
|
export const SPARSE = -7;
|
|
8
|
+
|
|
9
|
+
// The largest valid value for a JavaScript array's `length` property,
|
|
10
|
+
// and the largest valid array index (one less than the max length).
|
|
11
|
+
export const MAX_ARRAY_LEN = 2 ** 32 - 1;
|
|
12
|
+
export const MAX_ARRAY_INDEX = MAX_ARRAY_LEN - 1;
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { MAX_ARRAY_INDEX } from './constants.js';
|
|
2
|
+
import {
|
|
3
|
+
enumerable_symbols,
|
|
4
|
+
get_type,
|
|
5
|
+
is_buffer,
|
|
6
|
+
is_plain_object,
|
|
7
|
+
valid_array_indices
|
|
8
|
+
} from './utils.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Merges caller-provided operation overrides over the defaults. Iterating the
|
|
12
|
+
* default keys (rather than the override's own keys) means nullish members
|
|
13
|
+
* fall back to the default, and inherited members — e.g. from a class
|
|
14
|
+
* instance — are picked up.
|
|
15
|
+
*
|
|
16
|
+
* @template {Record<string, any>} T
|
|
17
|
+
* @param {T} defaults
|
|
18
|
+
* @param {Partial<T> | undefined} overrides
|
|
19
|
+
* @returns {T}
|
|
20
|
+
*/
|
|
21
|
+
export function merge_operations(defaults, overrides) {
|
|
22
|
+
if (!overrides) return defaults;
|
|
23
|
+
|
|
24
|
+
const merged = /** @type {T} */ ({});
|
|
25
|
+
|
|
26
|
+
for (const key of /** @type {(keyof T)[]} */ (Object.keys(defaults))) {
|
|
27
|
+
merged[key] = overrides[key] ?? defaults[key];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return merged;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** @type {{ kind: 'not-plain' }} */
|
|
34
|
+
const NOT_PLAIN = /* @__PURE__ */ Object.freeze({ kind: 'not-plain' });
|
|
35
|
+
|
|
36
|
+
/** @type {{ kind: 'symbol-keys' }} */
|
|
37
|
+
const SYMBOL_KEYS = /* @__PURE__ */ Object.freeze({ kind: 'symbol-keys' });
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The default implementations of every introspection/extraction operation
|
|
41
|
+
* `stringify` performs on the value being serialized. Each one uses native
|
|
42
|
+
* JavaScript semantics (property access, iteration, prototype methods, etc).
|
|
43
|
+
*
|
|
44
|
+
* Pass overrides via the `operations` option of `stringify`/`stringifyAsync`
|
|
45
|
+
* to customize how values are inspected — e.g. to serialize values without
|
|
46
|
+
* triggering getters, proxy traps, or patched prototype methods, or to
|
|
47
|
+
* serialize values that live in a different JavaScript runtime (a `node:vm`
|
|
48
|
+
* context, a WASM-hosted engine, a remote process) through handle objects.
|
|
49
|
+
*
|
|
50
|
+
* The object is frozen — it is shared by every `stringify` call that does
|
|
51
|
+
* not override a given operation.
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
/** @type {import('./types.js').DefaultStringifyOperations} */
|
|
55
|
+
const stringify_operations = {
|
|
56
|
+
identify: (value) => value,
|
|
57
|
+
|
|
58
|
+
typeOf: (value) => (value === null ? 'null' : typeof value),
|
|
59
|
+
|
|
60
|
+
toPrimitive: (value) => value,
|
|
61
|
+
|
|
62
|
+
tagOf: (value) => get_type(value),
|
|
63
|
+
|
|
64
|
+
isThenable: (value) => typeof value.then === 'function',
|
|
65
|
+
|
|
66
|
+
toPromise: (thenable) => Promise.resolve(thenable),
|
|
67
|
+
|
|
68
|
+
unbox: (boxed) => boxed.valueOf(),
|
|
69
|
+
|
|
70
|
+
toISOString: (date) => (isNaN(date.getDate()) ? '' : date.toISOString()),
|
|
71
|
+
|
|
72
|
+
toStringValue: (value) => value.toString(),
|
|
73
|
+
|
|
74
|
+
regExpInfo: (regexp) => ({ source: regexp.source, flags: regexp.flags }),
|
|
75
|
+
|
|
76
|
+
valuesOf: (set) => set,
|
|
77
|
+
|
|
78
|
+
entriesOf: (map) => map,
|
|
79
|
+
|
|
80
|
+
viewInfo: (view) => {
|
|
81
|
+
// Node Buffers may share a pool containing unrelated, sensitive data.
|
|
82
|
+
// Copy only the visible bytes, without using Buffer's pooling or slice.
|
|
83
|
+
if (is_buffer(view)) view = new Uint8Array(view);
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
buffer: view.buffer,
|
|
87
|
+
byteOffset: view.byteOffset,
|
|
88
|
+
byteLength: view.byteLength,
|
|
89
|
+
length: view.length,
|
|
90
|
+
bufferByteLength: view.buffer.byteLength
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
toArrayBuffer: (buffer) => buffer,
|
|
95
|
+
|
|
96
|
+
lengthOf: (array) => array.length,
|
|
97
|
+
|
|
98
|
+
hasOwn: (value, key) => Object.hasOwn(value, key),
|
|
99
|
+
|
|
100
|
+
indicesOf: (array) => valid_array_indices(array),
|
|
101
|
+
|
|
102
|
+
shapeOf: (value) => {
|
|
103
|
+
if (!is_plain_object(value)) return NOT_PLAIN;
|
|
104
|
+
if (enumerable_symbols(value).length > 0) return SYMBOL_KEYS;
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
kind: Object.getPrototypeOf(value) === null ? 'null-proto' : 'plain',
|
|
108
|
+
keys: Object.keys(value)
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
get: (value, key) => value[key]
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const default_stringify_operations = /* @__PURE__ */ Object.freeze(stringify_operations);
|
|
116
|
+
|
|
117
|
+
const array_buffer_byte_length = Object.getOwnPropertyDescriptor(
|
|
118
|
+
ArrayBuffer.prototype,
|
|
119
|
+
'byteLength'
|
|
120
|
+
).get;
|
|
121
|
+
|
|
122
|
+
const shared_array_buffer_byte_length =
|
|
123
|
+
typeof SharedArrayBuffer === 'undefined'
|
|
124
|
+
? undefined
|
|
125
|
+
: Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, 'byteLength').get;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The default implementations of every construction operation `parse` and
|
|
129
|
+
* `unflatten` perform while reviving a value. Each one uses native
|
|
130
|
+
* JavaScript semantics (built-in constructors, property assignment, etc).
|
|
131
|
+
*
|
|
132
|
+
* Pass overrides via the `operations` option of `parse`/`unflatten` to
|
|
133
|
+
* customize how values are built — e.g. to construct them from the
|
|
134
|
+
* intrinsics of a different realm (a `node:vm` context), or to build up
|
|
135
|
+
* values inside another JavaScript runtime (a WASM-hosted engine, a remote
|
|
136
|
+
* process) through handle objects.
|
|
137
|
+
*
|
|
138
|
+
* The object is frozen — it is shared by every `parse` call that does not
|
|
139
|
+
* override a given operation.
|
|
140
|
+
*
|
|
141
|
+
*/
|
|
142
|
+
/** @type {import('./types.js').DefaultParseOperations} */
|
|
143
|
+
const parse_operations = {
|
|
144
|
+
fromPrimitive: (primitive) => primitive,
|
|
145
|
+
|
|
146
|
+
fromISOString: (iso) => new Date(iso),
|
|
147
|
+
|
|
148
|
+
fromStringValue: (tag, text) => {
|
|
149
|
+
if (tag === 'URL') return new URL(text);
|
|
150
|
+
if (tag === 'URLSearchParams') return new URLSearchParams(text);
|
|
151
|
+
// 'Temporal.Instant', 'Temporal.PlainDate', ...
|
|
152
|
+
// @ts-expect-error TS doesn't know about Temporal yet
|
|
153
|
+
return Temporal[tag.slice(9)].from(text);
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
fromArrayBuffer: (buffer) => buffer,
|
|
157
|
+
|
|
158
|
+
fromRegExpInfo: (source, flags) => new RegExp(source, flags),
|
|
159
|
+
|
|
160
|
+
fromViewInfo: (tag, buffer, byteOffset, length) => {
|
|
161
|
+
// A reviver can replace an ArrayBuffer with a length or array-like value,
|
|
162
|
+
// which a typed array constructor would use to allocate a new buffer.
|
|
163
|
+
// The native getters check internal slots, so they work across realms
|
|
164
|
+
// and cannot be fooled by a forged prototype or Symbol.toStringTag.
|
|
165
|
+
try {
|
|
166
|
+
array_buffer_byte_length.call(buffer);
|
|
167
|
+
} catch (error) {
|
|
168
|
+
if (!shared_array_buffer_byte_length) throw error;
|
|
169
|
+
shared_array_buffer_byte_length.call(buffer);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const Constructor = /** @type {any} */ (globalThis)[tag];
|
|
173
|
+
return byteOffset !== undefined
|
|
174
|
+
? new Constructor(buffer, byteOffset, length)
|
|
175
|
+
: new Constructor(buffer);
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
box: (value) => Object(value),
|
|
179
|
+
|
|
180
|
+
createArray: (length) => new Array(length),
|
|
181
|
+
|
|
182
|
+
createSparseArray: (length) => {
|
|
183
|
+
/** @type {any[]} */
|
|
184
|
+
const array = [];
|
|
185
|
+
|
|
186
|
+
// Setting `array.length = length` (or equivalently calling
|
|
187
|
+
// `new Array(length)`) on an untrusted length is a DoS vector: V8
|
|
188
|
+
// eagerly allocates a contiguous backing store for array lengths below
|
|
189
|
+
// ~10^8, so a small payload with a huge declared length can force
|
|
190
|
+
// arbitrary memory allocation. Touching the largest-possible index
|
|
191
|
+
// first forces V8 into dictionary-elements mode, where `length` is
|
|
192
|
+
// just a number and no contiguous allocation occurs.
|
|
193
|
+
array[MAX_ARRAY_INDEX] = undefined;
|
|
194
|
+
delete array[MAX_ARRAY_INDEX];
|
|
195
|
+
array.length = length;
|
|
196
|
+
|
|
197
|
+
return array;
|
|
198
|
+
},
|
|
199
|
+
|
|
200
|
+
createObject: () => ({}),
|
|
201
|
+
|
|
202
|
+
createNullPrototypeObject: () => Object.create(null),
|
|
203
|
+
|
|
204
|
+
createSet: () => new Set(),
|
|
205
|
+
|
|
206
|
+
createMap: () => new Map(),
|
|
207
|
+
|
|
208
|
+
set: (target, key, value) => {
|
|
209
|
+
target[key] = value;
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
addValue: (set, value) => {
|
|
213
|
+
set.add(value);
|
|
214
|
+
},
|
|
215
|
+
|
|
216
|
+
addEntry: (map, key, value) => {
|
|
217
|
+
map.set(key, value);
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export const default_parse_operations = /* @__PURE__ */ Object.freeze(parse_operations);
|
|
@@ -8,22 +8,29 @@ import {
|
|
|
8
8
|
SPARSE,
|
|
9
9
|
UNDEFINED
|
|
10
10
|
} from './constants.js';
|
|
11
|
+
import { default_parse_operations, merge_operations } from './operations.js';
|
|
12
|
+
import { is_valid_array_index, is_valid_array_len } from './utils.js';
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* Revive a value serialized with `devalue.stringify`
|
|
14
16
|
* @param {string} serialized
|
|
15
17
|
* @param {Record<string, (value: any) => any>} [revivers]
|
|
18
|
+
* @param {import('./types.js').ParseOptions} [options]
|
|
16
19
|
*/
|
|
17
|
-
export function parse(serialized, revivers) {
|
|
18
|
-
return unflatten(JSON.parse(serialized), revivers);
|
|
20
|
+
export function parse(serialized, revivers, options) {
|
|
21
|
+
return unflatten(JSON.parse(serialized), revivers, options);
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
/**
|
|
22
25
|
* Revive a value flattened with `devalue.stringify`
|
|
23
26
|
* @param {number | any[]} parsed
|
|
24
27
|
* @param {Record<string, (value: any) => any>} [revivers]
|
|
28
|
+
* @param {import('./types.js').ParseOptions} [options]
|
|
25
29
|
*/
|
|
26
|
-
export function unflatten(parsed, revivers) {
|
|
30
|
+
export function unflatten(parsed, revivers, options) {
|
|
31
|
+
/** @type {import('./types.js').ParseOperations} */
|
|
32
|
+
const ops = merge_operations(default_parse_operations, options?.operations);
|
|
33
|
+
|
|
27
34
|
if (typeof parsed === 'number') return hydrate(parsed, true);
|
|
28
35
|
|
|
29
36
|
if (!Array.isArray(parsed) || parsed.length === 0) {
|
|
@@ -46,11 +53,11 @@ export function unflatten(parsed, revivers) {
|
|
|
46
53
|
* @returns {any}
|
|
47
54
|
*/
|
|
48
55
|
function hydrate(index, standalone = false) {
|
|
49
|
-
if (index === UNDEFINED) return undefined;
|
|
50
|
-
if (index === NAN) return NaN;
|
|
51
|
-
if (index === POSITIVE_INFINITY) return Infinity;
|
|
52
|
-
if (index === NEGATIVE_INFINITY) return -Infinity;
|
|
53
|
-
if (index === NEGATIVE_ZERO) return -0;
|
|
56
|
+
if (index === UNDEFINED) return ops.fromPrimitive(undefined);
|
|
57
|
+
if (index === NAN) return ops.fromPrimitive(NaN);
|
|
58
|
+
if (index === POSITIVE_INFINITY) return ops.fromPrimitive(Infinity);
|
|
59
|
+
if (index === NEGATIVE_INFINITY) return ops.fromPrimitive(-Infinity);
|
|
60
|
+
if (index === NEGATIVE_ZERO) return ops.fromPrimitive(-0);
|
|
54
61
|
|
|
55
62
|
if (standalone || typeof index !== 'number') {
|
|
56
63
|
throw new Error(`Invalid input`);
|
|
@@ -58,18 +65,19 @@ export function unflatten(parsed, revivers) {
|
|
|
58
65
|
|
|
59
66
|
if (index in hydrated) return hydrated[index];
|
|
60
67
|
|
|
68
|
+
if (index >= values.length) {
|
|
69
|
+
throw new Error(`Invalid input`);
|
|
70
|
+
}
|
|
71
|
+
|
|
61
72
|
const value = values[index];
|
|
62
73
|
|
|
63
74
|
if (!value || typeof value !== 'object') {
|
|
64
|
-
hydrated[index] = value;
|
|
75
|
+
hydrated[index] = ops.fromPrimitive(value);
|
|
65
76
|
} else if (Array.isArray(value)) {
|
|
66
77
|
if (typeof value[0] === 'string') {
|
|
67
78
|
const type = value[0];
|
|
68
79
|
|
|
69
|
-
const reviver =
|
|
70
|
-
revivers && Object.hasOwn(revivers, type)
|
|
71
|
-
? revivers[type]
|
|
72
|
-
: undefined;
|
|
80
|
+
const reviver = revivers && Object.hasOwn(revivers, type) ? revivers[type] : undefined;
|
|
73
81
|
|
|
74
82
|
if (reviver) {
|
|
75
83
|
let i = value[1];
|
|
@@ -79,6 +87,16 @@ export function unflatten(parsed, revivers) {
|
|
|
79
87
|
i = values.push(value[1]) - 1;
|
|
80
88
|
}
|
|
81
89
|
|
|
90
|
+
// If the payload is already hydrated, its recursion has already
|
|
91
|
+
// terminated (e.g. a self-referential object cached itself before
|
|
92
|
+
// following its own back-reference), so revive it directly. Falling
|
|
93
|
+
// through to the `hydrating` guard here would wrongly reject a valid
|
|
94
|
+
// cycle. An actually infinite payload (e.g. `[["Custom", 0]]`) is never
|
|
95
|
+
// cached, so it still hits the guard below.
|
|
96
|
+
if (Object.hasOwn(hydrated, i)) {
|
|
97
|
+
return (hydrated[index] = reviver(hydrated[i]));
|
|
98
|
+
}
|
|
99
|
+
|
|
82
100
|
hydrating ??= new Set();
|
|
83
101
|
|
|
84
102
|
if (hydrating.has(i)) {
|
|
@@ -94,52 +112,62 @@ export function unflatten(parsed, revivers) {
|
|
|
94
112
|
|
|
95
113
|
switch (type) {
|
|
96
114
|
case 'Date':
|
|
97
|
-
hydrated[index] =
|
|
115
|
+
hydrated[index] = ops.fromISOString(value[1]);
|
|
98
116
|
break;
|
|
99
117
|
|
|
100
118
|
case 'Set':
|
|
101
|
-
const set =
|
|
119
|
+
const set = ops.createSet();
|
|
102
120
|
hydrated[index] = set;
|
|
103
121
|
for (let i = 1; i < value.length; i += 1) {
|
|
104
|
-
|
|
122
|
+
ops.addValue(set, hydrate(value[i]));
|
|
105
123
|
}
|
|
106
124
|
break;
|
|
107
125
|
|
|
108
126
|
case 'Map':
|
|
109
|
-
const map =
|
|
127
|
+
const map = ops.createMap();
|
|
110
128
|
hydrated[index] = map;
|
|
111
129
|
for (let i = 1; i < value.length; i += 2) {
|
|
112
|
-
|
|
130
|
+
ops.addEntry(map, hydrate(value[i]), hydrate(value[i + 1]));
|
|
113
131
|
}
|
|
114
132
|
break;
|
|
115
133
|
|
|
116
134
|
case 'RegExp':
|
|
117
|
-
hydrated[index] =
|
|
135
|
+
hydrated[index] = ops.fromRegExpInfo(value[1], value[2]);
|
|
118
136
|
break;
|
|
119
137
|
|
|
120
|
-
case 'Object':
|
|
121
|
-
const
|
|
138
|
+
case 'Object': {
|
|
139
|
+
const wrapped_index = value[1];
|
|
122
140
|
|
|
123
|
-
if (
|
|
124
|
-
|
|
141
|
+
if (
|
|
142
|
+
typeof values[wrapped_index] === 'object' &&
|
|
143
|
+
values[wrapped_index][0] !== 'BigInt'
|
|
144
|
+
) {
|
|
145
|
+
// avoid infinite recusion in case of malformed input
|
|
146
|
+
throw new Error('Invalid input');
|
|
125
147
|
}
|
|
126
148
|
|
|
127
|
-
hydrated[index] =
|
|
149
|
+
hydrated[index] = ops.box(hydrate(wrapped_index));
|
|
128
150
|
break;
|
|
151
|
+
}
|
|
129
152
|
|
|
130
153
|
case 'BigInt':
|
|
131
|
-
hydrated[index] = BigInt(value[1]);
|
|
154
|
+
hydrated[index] = ops.fromPrimitive(BigInt(value[1]));
|
|
132
155
|
break;
|
|
133
156
|
|
|
134
157
|
case 'null':
|
|
135
|
-
const obj =
|
|
158
|
+
const obj = ops.createNullPrototypeObject();
|
|
136
159
|
hydrated[index] = obj;
|
|
137
160
|
for (let i = 1; i < value.length; i += 2) {
|
|
138
|
-
|
|
161
|
+
const key = value[i];
|
|
162
|
+
if (typeof key !== 'string') {
|
|
163
|
+
throw new Error('Cannot parse an object with a non-string key');
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (key === '__proto__') {
|
|
139
167
|
throw new Error('Cannot parse an object with a `__proto__` property');
|
|
140
168
|
}
|
|
141
169
|
|
|
142
|
-
obj
|
|
170
|
+
ops.set(obj, key, hydrate(value[i + 1]));
|
|
143
171
|
}
|
|
144
172
|
break;
|
|
145
173
|
|
|
@@ -148,12 +176,14 @@ export function unflatten(parsed, revivers) {
|
|
|
148
176
|
case 'Uint8ClampedArray':
|
|
149
177
|
case 'Int16Array':
|
|
150
178
|
case 'Uint16Array':
|
|
179
|
+
case 'Float16Array':
|
|
151
180
|
case 'Int32Array':
|
|
152
181
|
case 'Uint32Array':
|
|
153
182
|
case 'Float32Array':
|
|
154
183
|
case 'Float64Array':
|
|
155
184
|
case 'BigInt64Array':
|
|
156
|
-
case 'BigUint64Array':
|
|
185
|
+
case 'BigUint64Array':
|
|
186
|
+
case 'DataView': {
|
|
157
187
|
if (values[value[1]][0] !== 'ArrayBuffer') {
|
|
158
188
|
// without this, if we receive malformed input we could
|
|
159
189
|
// end up trying to hydrate in a circle or allocate
|
|
@@ -161,14 +191,9 @@ export function unflatten(parsed, revivers) {
|
|
|
161
191
|
throw new Error('Invalid data');
|
|
162
192
|
}
|
|
163
193
|
|
|
164
|
-
const TypedArrayConstructor = globalThis[type];
|
|
165
194
|
const buffer = hydrate(value[1]);
|
|
166
|
-
const typedArray = new TypedArrayConstructor(buffer);
|
|
167
195
|
|
|
168
|
-
hydrated[index] =
|
|
169
|
-
value[2] !== undefined
|
|
170
|
-
? typedArray.subarray(value[2], value[3])
|
|
171
|
-
: typedArray;
|
|
196
|
+
hydrated[index] = ops.fromViewInfo(type, buffer, value[2], value[3]);
|
|
172
197
|
|
|
173
198
|
break;
|
|
174
199
|
}
|
|
@@ -178,11 +203,12 @@ export function unflatten(parsed, revivers) {
|
|
|
178
203
|
if (typeof base64 !== 'string') {
|
|
179
204
|
throw new Error('Invalid ArrayBuffer encoding');
|
|
180
205
|
}
|
|
181
|
-
|
|
182
|
-
hydrated[index] = arraybuffer;
|
|
206
|
+
hydrated[index] = ops.fromArrayBuffer(decode64(base64));
|
|
183
207
|
break;
|
|
184
208
|
}
|
|
185
209
|
|
|
210
|
+
case 'URL':
|
|
211
|
+
case 'URLSearchParams':
|
|
186
212
|
case 'Temporal.Duration':
|
|
187
213
|
case 'Temporal.Instant':
|
|
188
214
|
case 'Temporal.PlainDate':
|
|
@@ -191,21 +217,8 @@ export function unflatten(parsed, revivers) {
|
|
|
191
217
|
case 'Temporal.PlainMonthDay':
|
|
192
218
|
case 'Temporal.PlainYearMonth':
|
|
193
219
|
case 'Temporal.ZonedDateTime': {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
hydrated[index] = Temporal[temporalName].from(value[1]);
|
|
197
|
-
break;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
case 'URL': {
|
|
201
|
-
const url = new URL(value[1]);
|
|
202
|
-
hydrated[index] = url;
|
|
203
|
-
break;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
case 'URLSearchParams': {
|
|
207
|
-
const url = new URLSearchParams(value[1]);
|
|
208
|
-
hydrated[index] = url;
|
|
220
|
+
// the same tags `toStringValue` serializes on the stringify side
|
|
221
|
+
hydrated[index] = ops.fromStringValue(type, value[1]);
|
|
209
222
|
break;
|
|
210
223
|
}
|
|
211
224
|
|
|
@@ -216,36 +229,38 @@ export function unflatten(parsed, revivers) {
|
|
|
216
229
|
// Sparse array encoding: [SPARSE, length, idx, val, idx, val, ...]
|
|
217
230
|
const len = value[1];
|
|
218
231
|
|
|
219
|
-
if (!
|
|
232
|
+
if (!is_valid_array_len(len)) {
|
|
220
233
|
throw new Error('Invalid input');
|
|
221
234
|
}
|
|
222
235
|
|
|
223
|
-
|
|
236
|
+
// `len` comes from the input rather than being bounded by it, so
|
|
237
|
+
// `createSparseArray` is responsible for not allocating storage
|
|
238
|
+
// proportional to it.
|
|
239
|
+
const array = ops.createSparseArray(len);
|
|
224
240
|
hydrated[index] = array;
|
|
225
241
|
|
|
226
242
|
for (let i = 2; i < value.length; i += 2) {
|
|
227
243
|
const idx = value[i];
|
|
228
244
|
|
|
229
|
-
if (!
|
|
245
|
+
if (!is_valid_array_index(idx) || idx >= len) {
|
|
230
246
|
throw new Error('Invalid input');
|
|
231
247
|
}
|
|
232
248
|
|
|
233
|
-
array
|
|
249
|
+
ops.set(array, idx, hydrate(value[i + 1]));
|
|
234
250
|
}
|
|
235
251
|
} else {
|
|
236
|
-
const array =
|
|
252
|
+
const array = ops.createArray(value.length);
|
|
237
253
|
hydrated[index] = array;
|
|
238
254
|
|
|
239
255
|
for (let i = 0; i < value.length; i += 1) {
|
|
240
256
|
const n = value[i];
|
|
241
257
|
if (n === HOLE) continue;
|
|
242
258
|
|
|
243
|
-
array
|
|
259
|
+
ops.set(array, i, hydrate(n));
|
|
244
260
|
}
|
|
245
261
|
}
|
|
246
262
|
} else {
|
|
247
|
-
|
|
248
|
-
const object = {};
|
|
263
|
+
const object = ops.createObject();
|
|
249
264
|
hydrated[index] = object;
|
|
250
265
|
|
|
251
266
|
for (const key of Object.keys(value)) {
|
|
@@ -253,8 +268,7 @@ export function unflatten(parsed, revivers) {
|
|
|
253
268
|
throw new Error('Cannot parse an object with a `__proto__` property');
|
|
254
269
|
}
|
|
255
270
|
|
|
256
|
-
|
|
257
|
-
object[key] = hydrate(n);
|
|
271
|
+
ops.set(object, key, hydrate(value[key]));
|
|
258
272
|
}
|
|
259
273
|
}
|
|
260
274
|
|