@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.
Files changed (325) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{BCIlnd0g.js → 5ZXm4f56.js} +1 -1
  3. package/.output/public/_nuxt/{DcJ7oPvZ.js → B2fcLSyW.js} +1 -1
  4. package/.output/public/_nuxt/{B0N6xv5E.js → BBN7l5Hn.js} +1 -1
  5. package/.output/public/_nuxt/BBTTtb8r.js +41 -0
  6. package/.output/public/_nuxt/{5Tu2WUJz.js → BDbISGvP.js} +1 -1
  7. package/.output/public/_nuxt/{D87QMS6j.js → BijI4RNx.js} +1 -1
  8. package/.output/public/_nuxt/{C2BHp-MG.js → Bp9qkJ9m.js} +1 -1
  9. package/.output/public/_nuxt/{I3Ucam2s.js → Bu3-sqCf.js} +1 -1
  10. package/.output/public/_nuxt/{BO4hqv6q.js → C-FtTvwz.js} +1 -1
  11. package/.output/public/_nuxt/C02JV0Aj.js +1 -0
  12. package/.output/public/_nuxt/{sKEJiAHO.js → C1UkIsDc.js} +1 -1
  13. package/.output/public/_nuxt/{CKULsFUz.js → CJT28r6J.js} +1 -1
  14. package/.output/public/_nuxt/{BNDnV2op.js → CL7qtgl2.js} +3 -3
  15. package/.output/public/_nuxt/{DA0pQuyP.js → CRMd2YH2.js} +3 -3
  16. package/.output/public/_nuxt/{DpKrXpkK.js → CRkdQgFz.js} +1 -1
  17. package/.output/public/_nuxt/{B0cUlOSM.js → Cw1XFOz5.js} +1 -1
  18. package/.output/public/_nuxt/{CzbCpNnc.js → D5yWk6Ly.js} +1 -1
  19. package/.output/public/_nuxt/{BOsJJ_ZU.js → DA9GjKpR.js} +1 -1
  20. package/.output/public/_nuxt/{Dce9SnGa.js → DaWAlZhp.js} +1 -1
  21. package/.output/public/_nuxt/{tqQNlhT9.js → DafLMUHo.js} +1 -1
  22. package/.output/public/_nuxt/{ypRHVLFO.js → Dyaldc-t.js} +1 -1
  23. package/.output/public/_nuxt/{o-NCh2rp.js → UU9fpRNQ.js} +1 -1
  24. package/.output/public/_nuxt/builds/latest.json +1 -1
  25. package/.output/public/_nuxt/builds/meta/717459d8-0da1-42ed-af0b-9ec5395e8fdc.json +1 -0
  26. package/.output/public/_nuxt/entry.CDPplHzk.css +1 -0
  27. package/.output/public/_nuxt/error-404.hPtlUQpd.css +1 -0
  28. package/.output/public/_nuxt/error-500.E-PXUb6B.css +1 -0
  29. package/.output/public/_nuxt/{CMH9iX_E.js → kFZJW2-u.js} +2 -2
  30. package/.output/public/_nuxt/{DsnIpnT9.js → u3DlT5Mh.js} +1 -1
  31. package/.output/server/chunks/_/error-500.mjs.map +1 -1
  32. package/.output/server/chunks/_/parse-request.mjs +29 -0
  33. package/.output/server/chunks/_/parse-request.mjs.map +1 -0
  34. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  35. package/.output/server/chunks/build/{error-404-KRkA0DPI.mjs → error-404-aQ5PiVuX.mjs} +6 -12
  36. package/.output/server/chunks/build/error-404-aQ5PiVuX.mjs.map +1 -0
  37. package/.output/server/chunks/build/error-404-styles.DIZfBVBR.mjs +8 -0
  38. package/.output/server/chunks/build/error-404-styles.DIZfBVBR.mjs.map +1 -0
  39. package/.output/server/chunks/build/{error-500-DIIFf55p.mjs → error-500-BY6ZAZZ2.mjs} +6 -12
  40. package/.output/server/chunks/build/error-500-BY6ZAZZ2.mjs.map +1 -0
  41. package/.output/server/chunks/build/error-500-styles.BZXgEzR5.mjs +8 -0
  42. package/.output/server/chunks/build/error-500-styles.BZXgEzR5.mjs.map +1 -0
  43. package/.output/server/chunks/build/index-57_mtIua.mjs +235 -0
  44. package/.output/server/chunks/build/index-57_mtIua.mjs.map +1 -0
  45. package/.output/server/chunks/build/{index-CB1N4gax.mjs → index-Qa-4KqCB.mjs} +7 -13
  46. package/.output/server/chunks/build/index-Qa-4KqCB.mjs.map +1 -0
  47. package/.output/server/chunks/build/server.mjs +3913 -3378
  48. package/.output/server/chunks/build/server.mjs.map +1 -1
  49. package/.output/server/chunks/build/styles.mjs +4 -4
  50. package/.output/server/chunks/nitro/nitro.mjs +652 -2278
  51. package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
  52. package/.output/server/chunks/routes/api/editor-types.get.mjs +91 -28
  53. package/.output/server/chunks/routes/api/editor-types.get.mjs.map +1 -1
  54. package/.output/server/chunks/routes/api/parse.post.mjs +1599 -7
  55. package/.output/server/chunks/routes/api/parse.post.mjs.map +1 -1
  56. package/.output/server/chunks/routes/api/resolve.get.mjs +0 -6
  57. package/.output/server/chunks/routes/api/resolve.get.mjs.map +1 -1
  58. package/.output/server/chunks/routes/api/studio/run.post.mjs +50 -12
  59. package/.output/server/chunks/routes/api/studio/run.post.mjs.map +1 -1
  60. package/.output/server/chunks/routes/renderer.mjs +21 -44
  61. package/.output/server/chunks/routes/renderer.mjs.map +1 -1
  62. package/.output/server/index.mjs +1 -7
  63. package/.output/server/index.mjs.map +1 -1
  64. package/.output/server/node_modules/.nitro/@vue/compiler-core@3.5.43/dist/compiler-core.cjs.prod.js +6801 -0
  65. package/.output/server/node_modules/.nitro/@vue/compiler-core@3.5.43/package.json +58 -0
  66. package/.output/server/node_modules/.nitro/@vue/compiler-dom@3.5.43/dist/compiler-dom.cjs.prod.js +692 -0
  67. package/.output/server/node_modules/.nitro/@vue/compiler-dom@3.5.43/package.json +57 -0
  68. package/.output/server/node_modules/.nitro/@vue/reactivity@3.5.43/dist/reactivity.cjs.prod.js +1905 -0
  69. package/.output/server/node_modules/.nitro/@vue/reactivity@3.5.43/package.json +55 -0
  70. package/.output/server/node_modules/.nitro/@vue/runtime-core@3.5.43/dist/runtime-core.cjs.prod.js +7006 -0
  71. package/.output/server/node_modules/.nitro/@vue/runtime-core@3.5.43/package.json +52 -0
  72. package/.output/server/node_modules/.nitro/@vue/runtime-dom@3.5.43/dist/runtime-dom.cjs.prod.js +1867 -0
  73. package/.output/server/node_modules/.nitro/@vue/runtime-dom@3.5.43/package.json +60 -0
  74. package/.output/server/node_modules/.nitro/@vue/shared@3.5.43/dist/shared.cjs.prod.js +655 -0
  75. package/.output/server/node_modules/.nitro/@vue/shared@3.5.43/package.json +47 -0
  76. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/array-set.js +121 -0
  77. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/base64-vlq.js +140 -0
  78. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/base64.js +67 -0
  79. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/binary-search.js +111 -0
  80. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/mapping-list.js +79 -0
  81. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/quick-sort.js +141 -0
  82. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/source-map-consumer.js +1236 -0
  83. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/source-map-generator.js +446 -0
  84. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/source-node.js +420 -0
  85. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/util.js +594 -0
  86. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/package.json +71 -0
  87. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/source-map.js +8 -0
  88. package/.output/server/node_modules/.nitro/vue@3.5.43/dist/vue.cjs.js +80 -0
  89. package/.output/server/node_modules/.nitro/vue@3.5.43/dist/vue.cjs.prod.js +66 -0
  90. package/.output/server/node_modules/.nitro/vue@3.5.43/index.js +7 -0
  91. package/.output/server/node_modules/.nitro/vue@3.5.43/index.mjs +1 -0
  92. package/.output/server/node_modules/.nitro/vue@3.5.43/package.json +112 -0
  93. package/.output/server/node_modules/@babel/parser/lib/index.js +55 -21
  94. package/.output/server/node_modules/@babel/parser/package.json +7 -7
  95. package/.output/server/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
  96. package/.output/server/node_modules/@esbuild/linux-x64/package.json +1 -1
  97. package/.output/server/node_modules/@iconify/utils/lib/colors/index.js +19 -16
  98. package/.output/server/node_modules/@iconify/utils/lib/colors/keywords.js +3 -4
  99. package/.output/server/node_modules/@iconify/utils/lib/css/common.js +16 -16
  100. package/.output/server/node_modules/@iconify/utils/lib/css/format.js +1 -2
  101. package/.output/server/node_modules/@iconify/utils/lib/css/icon.js +11 -14
  102. package/.output/server/node_modules/@iconify/utils/lib/css/icons.js +13 -16
  103. package/.output/server/node_modules/@iconify/utils/lib/customisations/bool.js +1 -2
  104. package/.output/server/node_modules/@iconify/utils/lib/customisations/defaults.js +1 -3
  105. package/.output/server/node_modules/@iconify/utils/lib/customisations/flip.js +2 -5
  106. package/.output/server/node_modules/@iconify/utils/lib/customisations/merge.js +1 -3
  107. package/.output/server/node_modules/@iconify/utils/lib/customisations/rotate.js +4 -5
  108. package/.output/server/node_modules/@iconify/utils/lib/emoji/cleanup.js +1 -3
  109. package/.output/server/node_modules/@iconify/utils/lib/emoji/convert.js +9 -11
  110. package/.output/server/node_modules/@iconify/utils/lib/emoji/data.js +1 -2
  111. package/.output/server/node_modules/@iconify/utils/lib/emoji/format.js +1 -3
  112. package/.output/server/node_modules/@iconify/utils/lib/emoji/parse.js +1 -3
  113. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/base.js +12 -18
  114. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/create.js +3 -4
  115. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/numbers.js +5 -7
  116. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/similar.js +1 -8
  117. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/tree.js +11 -12
  118. package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/find.js +5 -7
  119. package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/replace.js +1 -3
  120. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/components.js +1 -3
  121. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/missing.js +7 -7
  122. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/name.js +2 -4
  123. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/parse.js +5 -9
  124. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/similar.js +3 -5
  125. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/tree.js +2 -4
  126. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/variations.js +7 -8
  127. package/.output/server/node_modules/@iconify/utils/lib/icon/defaults.js +1 -2
  128. package/.output/server/node_modules/@iconify/utils/lib/icon/merge.js +1 -3
  129. package/.output/server/node_modules/@iconify/utils/lib/icon/name.js +3 -4
  130. package/.output/server/node_modules/@iconify/utils/lib/icon/square.js +1 -2
  131. package/.output/server/node_modules/@iconify/utils/lib/icon/transformations.js +1 -2
  132. package/.output/server/node_modules/@iconify/utils/lib/icon-set/convert-info.js +10 -15
  133. package/.output/server/node_modules/@iconify/utils/lib/icon-set/expand.js +1 -3
  134. package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icon.js +3 -5
  135. package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icons.js +1 -3
  136. package/.output/server/node_modules/@iconify/utils/lib/icon-set/minify.js +1 -3
  137. package/.output/server/node_modules/@iconify/utils/lib/icon-set/parse.js +1 -3
  138. package/.output/server/node_modules/@iconify/utils/lib/icon-set/tree.js +1 -2
  139. package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate-basic.js +1 -3
  140. package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate.js +21 -13
  141. package/.output/server/node_modules/@iconify/utils/lib/index.js +1 -2
  142. package/.output/server/node_modules/@iconify/utils/lib/loader/custom.js +3 -3
  143. package/.output/server/node_modules/@iconify/utils/lib/loader/hmr-utils.js +33 -0
  144. package/.output/server/node_modules/@iconify/utils/lib/loader/loader.js +22 -22
  145. package/.output/server/node_modules/@iconify/utils/lib/loader/modern.js +7 -22
  146. package/.output/server/node_modules/@iconify/utils/lib/loader/utils.js +60 -16
  147. package/.output/server/node_modules/@iconify/utils/lib/misc/objects.js +1 -2
  148. package/.output/server/node_modules/@iconify/utils/lib/misc/strings.js +1 -2
  149. package/.output/server/node_modules/@iconify/utils/lib/misc/title.js +1 -2
  150. package/.output/server/node_modules/@iconify/utils/lib/svg/build.js +9 -11
  151. package/.output/server/node_modules/@iconify/utils/lib/svg/defs.js +1 -2
  152. package/.output/server/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.js +1 -3
  153. package/.output/server/node_modules/@iconify/utils/lib/svg/html.js +1 -2
  154. package/.output/server/node_modules/@iconify/utils/lib/svg/id.js +1 -2
  155. package/.output/server/node_modules/@iconify/utils/lib/svg/inner-html.js +1 -2
  156. package/.output/server/node_modules/@iconify/utils/lib/svg/parse.js +3 -5
  157. package/.output/server/node_modules/@iconify/utils/lib/svg/pretty.js +5 -4
  158. package/.output/server/node_modules/@iconify/utils/lib/svg/size.js +1 -2
  159. package/.output/server/node_modules/@iconify/utils/lib/svg/trim.js +1 -2
  160. package/.output/server/node_modules/@iconify/utils/lib/svg/url.js +1 -2
  161. package/.output/server/node_modules/@iconify/utils/lib/svg/viewbox.js +2 -3
  162. package/.output/server/node_modules/@iconify/utils/package.json +15 -13
  163. package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +8 -1
  164. package/.output/server/node_modules/@vue/compiler-ssr/package.json +3 -3
  165. package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +34 -13
  166. package/.output/server/node_modules/@vue/server-renderer/package.json +4 -6
  167. package/.output/server/node_modules/devalue/index.js +15 -2
  168. package/.output/server/node_modules/devalue/package.json +5 -3
  169. package/.output/server/node_modules/devalue/src/base64.js +46 -96
  170. package/.output/server/node_modules/devalue/src/constants.js +5 -0
  171. package/.output/server/node_modules/devalue/src/operations.js +221 -0
  172. package/.output/server/node_modules/devalue/src/parse.js +76 -62
  173. package/.output/server/node_modules/devalue/src/stringify.js +164 -81
  174. package/.output/server/node_modules/devalue/src/uneval.js +312 -104
  175. package/.output/server/node_modules/devalue/src/utils.js +61 -19
  176. package/.output/server/node_modules/esbuild/lib/main.js +12 -8
  177. package/.output/server/node_modules/esbuild/package.json +50 -50
  178. package/.output/server/node_modules/hookable/dist/index.mjs +2 -11
  179. package/.output/server/node_modules/hookable/package.json +23 -22
  180. package/.output/server/node_modules/ip-address/dist/ipv4.js +7 -0
  181. package/.output/server/node_modules/ip-address/package.json +1 -1
  182. package/.output/server/node_modules/zod/package.json +20 -8
  183. package/.output/server/node_modules/zod/v4/classic/checks.js +1 -1
  184. package/.output/server/node_modules/zod/v4/classic/deep-partial.js +13 -0
  185. package/.output/server/node_modules/zod/v4/classic/errors.js +44 -35
  186. package/.output/server/node_modules/zod/v4/classic/external.js +5 -8
  187. package/.output/server/node_modules/zod/v4/classic/from-json-schema.js +375 -78
  188. package/.output/server/node_modules/zod/v4/classic/in-out.js +36 -0
  189. package/.output/server/node_modules/zod/v4/classic/index.js +2 -2
  190. package/.output/server/node_modules/zod/v4/classic/iso.js +2 -17
  191. package/.output/server/node_modules/zod/v4/classic/package.json +2 -1
  192. package/.output/server/node_modules/zod/v4/classic/parse.js +1 -0
  193. package/.output/server/node_modules/zod/v4/classic/schemas.js +601 -223
  194. package/.output/server/node_modules/zod/v4/core/api.js +51 -26
  195. package/.output/server/node_modules/zod/v4/core/checks.js +68 -127
  196. package/.output/server/node_modules/zod/v4/core/compile.js +1858 -0
  197. package/.output/server/node_modules/zod/v4/core/core.js +87 -22
  198. package/.output/server/node_modules/zod/v4/core/doc.js +12 -9
  199. package/.output/server/node_modules/zod/v4/core/errors.js +127 -42
  200. package/.output/server/node_modules/zod/v4/core/index.js +3 -0
  201. package/.output/server/node_modules/zod/v4/core/json-schema-generator.js +6 -2
  202. package/.output/server/node_modules/zod/v4/core/json-schema-processors.js +413 -175
  203. package/.output/server/node_modules/zod/v4/core/memoizer.js +311 -0
  204. package/.output/server/node_modules/zod/v4/core/package.json +2 -1
  205. package/.output/server/node_modules/zod/v4/core/parse.js +130 -48
  206. package/.output/server/node_modules/zod/v4/core/regexes.js +39 -16
  207. package/.output/server/node_modules/zod/v4/core/registries.js +2 -2
  208. package/.output/server/node_modules/zod/v4/core/schemas.js +895 -382
  209. package/.output/server/node_modules/zod/v4/core/to-json-schema.js +253 -39
  210. package/.output/server/node_modules/zod/v4/core/util.js +383 -175
  211. package/.output/server/node_modules/zod/v4/core/versions.js +2 -2
  212. package/.output/server/node_modules/zod/v4/core/visit.js +169 -0
  213. package/.output/server/node_modules/zod/v4/index.js +3 -2
  214. package/.output/server/node_modules/zod/v4/locales/ar.js +5 -0
  215. package/.output/server/node_modules/zod/v4/locales/az.js +5 -0
  216. package/.output/server/node_modules/zod/v4/locales/be.js +12 -0
  217. package/.output/server/node_modules/zod/v4/locales/bg.js +5 -0
  218. package/.output/server/node_modules/zod/v4/locales/bn.js +113 -0
  219. package/.output/server/node_modules/zod/v4/locales/ca.js +5 -0
  220. package/.output/server/node_modules/zod/v4/locales/ckb.js +133 -0
  221. package/.output/server/node_modules/zod/v4/locales/cs.js +5 -0
  222. package/.output/server/node_modules/zod/v4/locales/da.js +7 -2
  223. package/.output/server/node_modules/zod/v4/locales/de.js +5 -0
  224. package/.output/server/node_modules/zod/v4/locales/el.js +112 -0
  225. package/.output/server/node_modules/zod/v4/locales/en.js +20 -4
  226. package/.output/server/node_modules/zod/v4/locales/eo.js +5 -0
  227. package/.output/server/node_modules/zod/v4/locales/es.js +4 -0
  228. package/.output/server/node_modules/zod/v4/locales/fa.js +5 -0
  229. package/.output/server/node_modules/zod/v4/locales/fi.js +5 -0
  230. package/.output/server/node_modules/zod/v4/locales/fr-CA.js +5 -0
  231. package/.output/server/node_modules/zod/v4/locales/fr.js +38 -17
  232. package/.output/server/node_modules/zod/v4/locales/gu.js +113 -0
  233. package/.output/server/node_modules/zod/v4/locales/he.js +7 -0
  234. package/.output/server/node_modules/zod/v4/locales/hi.js +111 -0
  235. package/.output/server/node_modules/zod/v4/locales/hr.js +126 -0
  236. package/.output/server/node_modules/zod/v4/locales/hu.js +5 -0
  237. package/.output/server/node_modules/zod/v4/locales/hy.js +11 -0
  238. package/.output/server/node_modules/zod/v4/locales/id.js +5 -0
  239. package/.output/server/node_modules/zod/v4/locales/index.js +14 -0
  240. package/.output/server/node_modules/zod/v4/locales/is.js +5 -0
  241. package/.output/server/node_modules/zod/v4/locales/it.js +6 -1
  242. package/.output/server/node_modules/zod/v4/locales/ja.js +5 -0
  243. package/.output/server/node_modules/zod/v4/locales/ka.js +13 -8
  244. package/.output/server/node_modules/zod/v4/locales/km.js +5 -0
  245. package/.output/server/node_modules/zod/v4/locales/kn.js +116 -0
  246. package/.output/server/node_modules/zod/v4/locales/ko.js +5 -0
  247. package/.output/server/node_modules/zod/v4/locales/lt.js +4 -0
  248. package/.output/server/node_modules/zod/v4/locales/mk.js +5 -0
  249. package/.output/server/node_modules/zod/v4/locales/ms.js +5 -0
  250. package/.output/server/node_modules/zod/v4/locales/ne.js +111 -0
  251. package/.output/server/node_modules/zod/v4/locales/nl.js +5 -0
  252. package/.output/server/node_modules/zod/v4/locales/nn.js +113 -0
  253. package/.output/server/node_modules/zod/v4/locales/no.js +7 -2
  254. package/.output/server/node_modules/zod/v4/locales/ota.js +5 -0
  255. package/.output/server/node_modules/zod/v4/locales/package.json +2 -1
  256. package/.output/server/node_modules/zod/v4/locales/pl.js +5 -0
  257. package/.output/server/node_modules/zod/v4/locales/ps.js +5 -0
  258. package/.output/server/node_modules/zod/v4/locales/pt-BR.js +143 -0
  259. package/.output/server/node_modules/zod/v4/locales/pt.js +89 -55
  260. package/.output/server/node_modules/zod/v4/locales/ro.js +122 -0
  261. package/.output/server/node_modules/zod/v4/locales/ru.js +12 -0
  262. package/.output/server/node_modules/zod/v4/locales/sk.js +116 -0
  263. package/.output/server/node_modules/zod/v4/locales/sl.js +5 -0
  264. package/.output/server/node_modules/zod/v4/locales/sv.js +7 -2
  265. package/.output/server/node_modules/zod/v4/locales/ta.js +5 -0
  266. package/.output/server/node_modules/zod/v4/locales/tg.js +117 -0
  267. package/.output/server/node_modules/zod/v4/locales/th.js +5 -0
  268. package/.output/server/node_modules/zod/v4/locales/tk.js +107 -0
  269. package/.output/server/node_modules/zod/v4/locales/tr.js +5 -0
  270. package/.output/server/node_modules/zod/v4/locales/uk.js +5 -0
  271. package/.output/server/node_modules/zod/v4/locales/ur.js +5 -0
  272. package/.output/server/node_modules/zod/v4/locales/uz.js +4 -0
  273. package/.output/server/node_modules/zod/v4/locales/vi.js +5 -0
  274. package/.output/server/node_modules/zod/v4/locales/yo.js +5 -0
  275. package/.output/server/node_modules/zod/v4/locales/zh-CN.js +5 -0
  276. package/.output/server/node_modules/zod/v4/locales/zh-TW.js +5 -0
  277. package/.output/server/node_modules/zod/v4/package.json +2 -1
  278. package/.output/server/package.json +18 -18
  279. package/README.md +12 -1
  280. package/package.json +10 -9
  281. package/server/api/editor-types.get.ts +2 -23
  282. package/server/api/studio/run.post.ts +18 -6
  283. package/server/utils/editor-types.json +1 -0
  284. package/.output/public/_nuxt/B9paGgN0.js +0 -33
  285. package/.output/public/_nuxt/builds/meta/51f1351c-0667-4235-9ddc-16582a51ce03.json +0 -1
  286. package/.output/public/_nuxt/entry.B-vs1tRH.css +0 -1
  287. package/.output/public/_nuxt/error-404.CTSXlFYa.css +0 -1
  288. package/.output/public/_nuxt/error-500.DqEfQnVZ.css +0 -1
  289. package/.output/server/chunks/build/error-404-KRkA0DPI.mjs.map +0 -1
  290. package/.output/server/chunks/build/error-404-styles.I0NYw-Bn.mjs +0 -8
  291. package/.output/server/chunks/build/error-404-styles.I0NYw-Bn.mjs.map +0 -1
  292. package/.output/server/chunks/build/error-500-DIIFf55p.mjs.map +0 -1
  293. package/.output/server/chunks/build/error-500-styles.D1cs9hQy.mjs +0 -8
  294. package/.output/server/chunks/build/error-500-styles.D1cs9hQy.mjs.map +0 -1
  295. package/.output/server/chunks/build/index-CB1N4gax.mjs.map +0 -1
  296. /package/.output/server/node_modules/{@vue/compiler-core → .nitro/@vue/compiler-core@3.5.32}/dist/compiler-core.cjs.prod.js +0 -0
  297. /package/.output/server/node_modules/{@vue/compiler-core → .nitro/@vue/compiler-core@3.5.32}/package.json +0 -0
  298. /package/.output/server/node_modules/{@vue/compiler-dom → .nitro/@vue/compiler-dom@3.5.32}/dist/compiler-dom.cjs.prod.js +0 -0
  299. /package/.output/server/node_modules/{@vue/compiler-dom → .nitro/@vue/compiler-dom@3.5.32}/package.json +0 -0
  300. /package/.output/server/node_modules/{@vue/reactivity → .nitro/@vue/reactivity@3.5.32}/dist/reactivity.cjs.prod.js +0 -0
  301. /package/.output/server/node_modules/{@vue/reactivity → .nitro/@vue/reactivity@3.5.32}/package.json +0 -0
  302. /package/.output/server/node_modules/{@vue/runtime-core → .nitro/@vue/runtime-core@3.5.32}/dist/runtime-core.cjs.prod.js +0 -0
  303. /package/.output/server/node_modules/{@vue/runtime-core → .nitro/@vue/runtime-core@3.5.32}/package.json +0 -0
  304. /package/.output/server/node_modules/{@vue/runtime-dom → .nitro/@vue/runtime-dom@3.5.32}/dist/runtime-dom.cjs.prod.js +0 -0
  305. /package/.output/server/node_modules/{@vue/runtime-dom → .nitro/@vue/runtime-dom@3.5.32}/package.json +0 -0
  306. /package/.output/server/node_modules/{@vue/shared → .nitro/@vue/shared@3.5.32}/dist/shared.cjs.prod.js +0 -0
  307. /package/.output/server/node_modules/{@vue/shared → .nitro/@vue/shared@3.5.32}/package.json +0 -0
  308. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/array-set.js +0 -0
  309. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/base64-vlq.js +0 -0
  310. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/base64.js +0 -0
  311. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/binary-search.js +0 -0
  312. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/mapping-list.js +0 -0
  313. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/quick-sort.js +0 -0
  314. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/source-map-consumer.js +0 -0
  315. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/source-map-generator.js +0 -0
  316. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/source-node.js +0 -0
  317. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/util.js +0 -0
  318. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/package.json +0 -0
  319. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/source-map.js +0 -0
  320. /package/.output/server/node_modules/{vue → .nitro/vue@3.5.32}/dist/vue.cjs.js +0 -0
  321. /package/.output/server/node_modules/{vue → .nitro/vue@3.5.32}/dist/vue.cjs.prod.js +0 -0
  322. /package/.output/server/node_modules/{vue → .nitro/vue@3.5.32}/index.js +0 -0
  323. /package/.output/server/node_modules/{vue → .nitro/vue@3.5.32}/index.mjs +0 -0
  324. /package/.output/server/node_modules/{vue → .nitro/vue@3.5.32}/package.json +0 -0
  325. /package/.output/server/node_modules/{vue → .nitro/vue@3.5.43}/server-renderer/index.mjs +0 -0
@@ -1,8 +1,10 @@
1
+ import { MAX_ARRAY_INDEX } from './constants.js';
1
2
  import {
2
3
  DevalueError,
3
4
  enumerable_symbols,
4
5
  escaped,
5
6
  get_type,
7
+ is_buffer,
6
8
  is_plain_object,
7
9
  is_primitive,
8
10
  stringify_key,
@@ -11,6 +13,10 @@ import {
11
13
  } from './utils.js';
12
14
 
13
15
  const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$';
16
+ // Short strings have bounded escaping/output costs per reference, so they cannot
17
+ // cause quadratic expansion. Keep them on the original fast path rather than
18
+ // paying for deduplication on common values such as names, IDs and status fields.
19
+ const MIN_STRING_LENGTH = 128;
14
20
  const unsafe_chars = /[<\b\f\n\r\t\0\u2028\u2029]/g;
15
21
  const reserved =
16
22
  /^(?:do|if|in|for|int|let|new|try|var|byte|case|char|else|enum|goto|long|this|void|with|await|break|catch|class|const|final|float|short|super|throw|while|yield|delete|double|export|import|native|return|switch|throws|typeof|boolean|default|extends|finally|package|private|abstract|continue|debugger|function|volatile|interface|protected|transient|implements|instanceof|synchronized)$/;
@@ -28,6 +34,28 @@ export function uneval(value, replacer) {
28
34
 
29
35
  const custom = new Map();
30
36
 
37
+ // Only allocate a literal cache when we need to reuse an expensive primitive,
38
+ // including long Map keys rendered in error paths during the walk.
39
+ /** @type {Map<string | bigint, string> | undefined} */
40
+ let primitives;
41
+
42
+ /** @param {any} thing */
43
+ function stringify_cached_primitive(thing) {
44
+ if (
45
+ (typeof thing === 'string' && thing.length >= MIN_STRING_LENGTH) ||
46
+ typeof thing === 'bigint'
47
+ ) {
48
+ primitives ??= new Map();
49
+ let literal = primitives.get(thing);
50
+ if (literal === undefined) {
51
+ literal = stringify_primitive(thing);
52
+ primitives.set(thing, literal);
53
+ }
54
+ return literal;
55
+ }
56
+ return stringify_primitive(thing);
57
+ }
58
+
31
59
  /** @param {any} thing */
32
60
  function walk(thing) {
33
61
  if (!is_primitive(thing)) {
@@ -54,9 +82,12 @@ export function uneval(value, replacer) {
54
82
  const type = get_type(thing);
55
83
 
56
84
  switch (type) {
57
- case 'Number':
58
85
  case 'BigInt':
59
86
  case 'String':
87
+ walk(thing.valueOf());
88
+ return;
89
+
90
+ case 'Number':
60
91
  case 'Boolean':
61
92
  case 'Date':
62
93
  case 'RegExp':
@@ -65,11 +96,14 @@ export function uneval(value, replacer) {
65
96
  return;
66
97
 
67
98
  case 'Array':
68
- /** @type {any[]} */ (thing).forEach((value, i) => {
99
+ // forEach scans the logical length of dictionary-backed sparse
100
+ // arrays. Visit own enumerable indices without doing work for
101
+ // every hole.
102
+ for (const i of valid_array_indices(thing)) {
69
103
  keys.push(`[${i}]`);
70
- walk(value);
104
+ walk(thing[i]);
71
105
  keys.pop();
72
- });
106
+ }
73
107
  break;
74
108
 
75
109
  case 'Set':
@@ -78,9 +112,8 @@ export function uneval(value, replacer) {
78
112
 
79
113
  case 'Map':
80
114
  for (const [key, value] of thing) {
81
- keys.push(
82
- `.get(${is_primitive(key) ? stringify_primitive(key) : '...'})`
83
- );
115
+ keys.push(`.get(${is_primitive(key) ? stringify_cached_primitive(key) : '...'})`);
116
+ walk(key);
84
117
  walk(value);
85
118
  keys.pop();
86
119
  }
@@ -91,13 +124,17 @@ export function uneval(value, replacer) {
91
124
  case 'Uint8ClampedArray':
92
125
  case 'Int16Array':
93
126
  case 'Uint16Array':
127
+ case 'Float16Array':
94
128
  case 'Int32Array':
95
129
  case 'Uint32Array':
96
130
  case 'Float32Array':
97
131
  case 'Float64Array':
98
132
  case 'BigInt64Array':
99
133
  case 'BigUint64Array':
100
- walk(thing.buffer);
134
+ case 'DataView':
135
+ // A Node Buffer's backing store may be a shared pool. It must
136
+ // never be visited or hoisted just because a Buffer uses it.
137
+ if (!is_buffer(thing)) walk(thing.buffer);
101
138
  return;
102
139
 
103
140
  case 'ArrayBuffer':
@@ -115,21 +152,11 @@ export function uneval(value, replacer) {
115
152
 
116
153
  default:
117
154
  if (!is_plain_object(thing)) {
118
- throw new DevalueError(
119
- `Cannot stringify arbitrary non-POJOs`,
120
- keys,
121
- thing,
122
- value
123
- );
155
+ throw new DevalueError(`Cannot stringify arbitrary non-POJOs`, keys, thing, value);
124
156
  }
125
157
 
126
158
  if (enumerable_symbols(thing).length > 0) {
127
- throw new DevalueError(
128
- `Cannot stringify POJOs with symbolic keys`,
129
- keys,
130
- thing,
131
- value
132
- );
159
+ throw new DevalueError(`Cannot stringify POJOs with symbolic keys`, keys, thing, value);
133
160
  }
134
161
 
135
162
  for (const key of Object.keys(thing)) {
@@ -147,6 +174,13 @@ export function uneval(value, replacer) {
147
174
  keys.pop();
148
175
  }
149
176
  }
177
+ } else if (typeof thing === 'symbol') {
178
+ throw new DevalueError(`Cannot stringify a Symbol primitive`, keys, thing, value);
179
+ } else if (
180
+ (typeof thing === 'string' && thing.length >= MIN_STRING_LENGTH) ||
181
+ typeof thing === 'bigint'
182
+ ) {
183
+ counts.set(thing, (counts.get(thing) || 0) + 1);
150
184
  }
151
185
  }
152
186
 
@@ -154,11 +188,27 @@ export function uneval(value, replacer) {
154
188
 
155
189
  const names = new Map();
156
190
 
157
- Array.from(counts)
158
- .filter((entry) => entry[1] > 1)
191
+ /** @type {Array<[any, number]>} */
192
+ const repeated = [];
193
+ // Avoid allocating entries for all the values that will never be hoisted.
194
+ counts.forEach((count, thing) => {
195
+ if (count > 1) repeated.push([thing, count]);
196
+ });
197
+
198
+ repeated
159
199
  .sort((a, b) => b[1] - a[1])
160
- .forEach((entry, i) => {
161
- names.set(entry[0], get_name(i));
200
+ .forEach(([thing, count]) => {
201
+ const name = get_name(names.size);
202
+
203
+ if (is_primitive(thing)) {
204
+ const length = stringify_cached_primitive(thing).length;
205
+ // Hoisting costs one literal, a parameter and a reference per occurrence.
206
+ // Allow for the IIFE wrapper and separators even if one already exists,
207
+ // so inexpensive repetitions stay inline.
208
+ if (length * count <= length + (count + 1) * name.length + 25) return;
209
+ }
210
+
211
+ names.set(thing, name);
162
212
  });
163
213
 
164
214
  /**
@@ -184,12 +234,14 @@ export function uneval(value, replacer) {
184
234
  case 'Number':
185
235
  case 'String':
186
236
  case 'Boolean':
237
+ case 'BigInt':
187
238
  return `Object(${stringify(thing.valueOf())})`;
188
239
 
189
240
  case 'RegExp':
190
- return `new RegExp(${stringify_string(thing.source)}, "${
191
- thing.flags
192
- }")`;
241
+ const { source, flags } = thing;
242
+ return flags
243
+ ? `new RegExp(${stringify_string(source)},"${flags}")`
244
+ : `new RegExp(${stringify_string(source)})`;
193
245
 
194
246
  case 'Date':
195
247
  return `new Date(${thing.getTime()})`;
@@ -202,10 +254,10 @@ export function uneval(value, replacer) {
202
254
 
203
255
  case 'Array': {
204
256
  // For dense arrays (no holes), we iterate normally.
205
- // When we encounter the first hole, we call Object.keys
257
+ // When we encounter the first hole, we collect own indices
206
258
  // to determine the sparseness, then decide between:
207
259
  // - Array literal with holes: [,"a",,] (default)
208
- // - Object.assign: Object.assign(Array(n),{...}) (for very sparse arrays)
260
+ // - Object.assign with a sparse-safe allocator (for very sparse arrays)
209
261
  // Only the Object.assign path avoids iterating every slot, which
210
262
  // is what protects against the DoS of e.g. `arr[1000000] = 1`.
211
263
  let has_holes = false;
@@ -226,10 +278,11 @@ export function uneval(value, replacer) {
226
278
  //
227
279
  // Object.assign: populated indices are listed explicitly.
228
280
  // For example, [, "a", ,] would be written as
229
- // Object.assign(Array(3),{1:"a"}). This avoids paying
230
- // per-hole, but has a large fixed overhead for the
231
- // "Object.assign(Array(n),{...})" wrapper, and each
232
- // element costs extra chars for its index and colon.
281
+ // Object.assign(sparse(3),{1:"a"}), where sparse(n) stands
282
+ // for the expression emitted by stringify_sparse_array(n).
283
+ // This avoids paying per-hole, but has a large fixed
284
+ // overhead for the allocator and Object.assign wrapper,
285
+ // and each element costs extra chars for its index and colon.
233
286
  //
234
287
  // The serialized values are the same size either way, so
235
288
  // the choice comes down to the structural overhead:
@@ -240,43 +293,41 @@ export function uneval(value, replacer) {
240
293
  // = L + 2
241
294
  //
242
295
  // Object.assign overhead:
243
- // "Object.assign(Array(" — 20 chars
244
- // + length — d chars
245
- // + "),{" — 3 chars
296
+ // "Object.assign(" — 14 chars
297
+ // + allocator expression — A chars
298
+ // + ",{" — 2 chars
246
299
  // + for each populated element:
247
- // index + ":" + "," — (d + 2) chars
248
- // + "})" — 2 chars
249
- // = (25 + d) + P * (d + 2)
300
+ // index + ":" + "," — (d + 2) chars
301
+ // + "})" — 2 chars
302
+ // = (18 + A) + P * (d + 2)
250
303
  //
251
304
  // where L is the array length, P is the number of
252
- // populated elements, and d is the number of digits
253
- // in L (an upper bound on the digits in any index).
305
+ // populated elements, A is the allocator expression's
306
+ // length, and d is the number of digits in L (an upper
307
+ // bound on the digits in any index).
254
308
  //
255
309
  // Object.assign is cheaper when:
256
- // (25 + d) + P * (d + 2) < L + 2
257
- const populated_keys = valid_array_indices(/** @type {any[]} */ (thing));
310
+ // (18 + A) + P * (d + 2) < L + 2
311
+ const populated_keys = valid_array_indices(thing);
258
312
  const population = populated_keys.length;
259
313
  const d = String(thing.length).length;
314
+ const array = stringify_sparse_array(thing.length);
260
315
 
261
316
  const hole_cost = thing.length + 2;
262
- const sparse_cost = (25 + d) + population * (d + 2);
317
+ const sparse_cost = array.length + 18 + population * (d + 2);
263
318
 
264
319
  if (hole_cost > sparse_cost) {
265
- const entries = populated_keys
266
- .map((k) => `${k}:${stringify(thing[k])}`)
267
- .join(',');
268
- return `Object.assign(Array(${thing.length}),{${entries}})`;
320
+ const entries = populated_keys.map((k) => `${k}:${stringify(thing[k])}`).join(',');
321
+ return `Object.assign(${array},{${entries}})`;
269
322
  }
270
323
 
271
- // Re-process this index as a hole in the array literal
272
324
  has_holes = true;
273
- i -= 1;
274
325
  }
275
326
  // else: already decided on array literal, hole is just an empty slot
276
327
  // (the comma separator is all we need — no content for this position)
277
328
  }
278
329
 
279
- const tail = thing.length === 0 || thing.length - 1 in thing ? '' : ',';
330
+ const tail = thing.length === 0 || Object.hasOwn(thing, thing.length - 1) ? '' : ',';
280
331
  return result + tail + ']';
281
332
  }
282
333
 
@@ -289,33 +340,50 @@ export function uneval(value, replacer) {
289
340
  case 'Uint8ClampedArray':
290
341
  case 'Int16Array':
291
342
  case 'Uint16Array':
343
+ case 'Float16Array':
292
344
  case 'Int32Array':
293
345
  case 'Uint32Array':
294
346
  case 'Float32Array':
295
347
  case 'Float64Array':
296
348
  case 'BigInt64Array':
297
349
  case 'BigUint64Array': {
350
+ if (is_buffer(thing)) thing = new Uint8Array(thing);
351
+
298
352
  let str = `new ${type}`;
299
353
 
300
- if (counts.get(thing.buffer) === 1) {
301
- const array = new thing.constructor(thing.buffer);
302
- str += `([${array}])`;
354
+ if (!names.has(thing.buffer)) {
355
+ str += `([${stringify_typed_array_elements(type, thing.buffer)}])`;
303
356
  } else {
304
- str += `([${stringify(thing.buffer)}])`;
357
+ str += `(${stringify(thing.buffer)})`;
305
358
  }
306
359
 
307
- const a = thing.byteOffset;
308
- const b = a + thing.byteLength;
309
-
310
360
  // handle subarrays
311
- if (a > 0 || b !== thing.buffer.byteLength) {
312
- const m = +/(\d+)/.exec(type)[1] / 8;
313
- str += `.subarray(${a / m},${b / m})`;
361
+ if (thing.byteLength !== thing.buffer.byteLength) {
362
+ const start = thing.byteOffset / thing.BYTES_PER_ELEMENT;
363
+ const end = start + thing.length;
364
+ str += `.subarray(${start},${end})`;
314
365
  }
315
366
 
316
367
  return str;
317
368
  }
318
369
 
370
+ case 'DataView': {
371
+ let str = `new DataView`;
372
+
373
+ if (!names.has(thing.buffer)) {
374
+ str += `(new Uint8Array([${new Uint8Array(thing.buffer)}]).buffer`;
375
+ } else {
376
+ str += `(${stringify(thing.buffer)}`;
377
+ }
378
+
379
+ // handle subviews
380
+ if (thing.byteLength !== thing.buffer.byteLength) {
381
+ str += `,${thing.byteOffset},${thing.byteLength}`;
382
+ }
383
+
384
+ return str + ')';
385
+ }
386
+
319
387
  case 'ArrayBuffer': {
320
388
  const ui8 = new Uint8Array(thing);
321
389
  return `new Uint8Array([${ui8.toString()}]).buffer`;
@@ -333,14 +401,10 @@ export function uneval(value, replacer) {
333
401
 
334
402
  default:
335
403
  const keys = Object.keys(thing);
336
- const obj = keys
337
- .map((key) => `${safe_key(key)}:${stringify(thing[key])}`)
338
- .join(',');
404
+ const obj = keys.map((key) => `${safe_key(key)}:${stringify(thing[key])}`).join(',');
339
405
  const proto = Object.getPrototypeOf(thing);
340
406
  if (proto === null) {
341
- return keys.length > 0
342
- ? `{${obj},__proto__:null}`
343
- : `{__proto__:null}`;
407
+ return keys.length > 0 ? `{${obj},__proto__:null}` : `{__proto__:null}`;
344
408
  }
345
409
 
346
410
  return `{${obj}}`;
@@ -359,6 +423,13 @@ export function uneval(value, replacer) {
359
423
  /** @type {string[]} */
360
424
  const values = [];
361
425
 
426
+ // Reconstructions (e.g. `b = new Uint8Array(...)`) reassign a placeholder
427
+ // parameter. They must run before the `statements` that reference them,
428
+ // otherwise those statements capture the placeholder. They only depend on
429
+ // IIFE arguments (never on each other), so emitting them first is safe.
430
+ /** @type {string[]} */
431
+ const reconstructions = [];
432
+
362
433
  names.forEach((name, thing) => {
363
434
  params.push(name);
364
435
 
@@ -368,7 +439,7 @@ export function uneval(value, replacer) {
368
439
  }
369
440
 
370
441
  if (is_primitive(thing)) {
371
- values.push(stringify_primitive(thing));
442
+ values.push(stringify_cached_primitive(thing));
372
443
  return;
373
444
  }
374
445
 
@@ -378,70 +449,208 @@ export function uneval(value, replacer) {
378
449
  case 'Number':
379
450
  case 'String':
380
451
  case 'Boolean':
381
- values.push(`Object(${stringify(thing.valueOf())})`);
452
+ case 'BigInt': {
453
+ const primitive = thing.valueOf();
454
+ if (names.has(primitive)) {
455
+ // A hoisted primitive is only in scope inside the IIFE, not in
456
+ // its arguments. Reconstruct the box before assigning references.
457
+ values.push('{}');
458
+ reconstructions.push(`${name}=Object(${stringify(primitive)})`);
459
+ } else {
460
+ values.push(`Object(${stringify(primitive)})`);
461
+ }
382
462
  break;
463
+ }
383
464
 
384
465
  case 'RegExp':
385
- values.push(thing.toString());
466
+ const { source, flags } = thing;
467
+ const regexp = flags
468
+ ? `new RegExp(${stringify_string(source)},"${flags}")`
469
+ : `new RegExp(${stringify_string(source)})`
470
+ values.push(regexp);
386
471
  break;
387
472
 
388
473
  case 'Date':
389
474
  values.push(`new Date(${thing.getTime()})`);
390
475
  break;
391
476
 
392
- case 'Array':
393
- values.push(`Array(${thing.length})`);
394
- /** @type {any[]} */ (thing).forEach((v, i) => {
395
- statements.push(`${name}[${i}]=${stringify(v)}`);
396
- });
477
+ case 'URL':
478
+ values.push(`new URL(${stringify_string(thing.toString())})`);
397
479
  break;
398
480
 
399
- case 'Set':
400
- values.push(`new Set`);
401
- statements.push(
402
- `${name}.${Array.from(thing)
403
- .map((v) => `add(${stringify(v)})`)
404
- .join('.')}`
481
+ case 'URLSearchParams':
482
+ values.push(`new URLSearchParams(${stringify_string(thing.toString())})`);
483
+ break;
484
+
485
+ case 'Array': {
486
+ const populated_keys = valid_array_indices(thing);
487
+ // Only preallocate when the length is bounded by the number
488
+ // of populated elements, plus a small constant for short arrays.
489
+ values.push(
490
+ thing.length > 32 + 2 * populated_keys.length
491
+ ? stringify_sparse_array(thing.length)
492
+ : `Array(${thing.length})`
405
493
  );
494
+ for (const i of populated_keys) {
495
+ statements.push(`${name}[${i}]=${stringify(thing[i])}`);
496
+ }
406
497
  break;
498
+ }
407
499
 
408
- case 'Map':
500
+ case 'Set': {
501
+ values.push(`new Set`);
502
+ const adds = Array.from(thing).map((v) => `.add(${stringify(v)})`);
503
+ // An empty Set is fully built by `new Set`; a chained statement would
504
+ // otherwise be a dangling `name.`.
505
+ if (adds.length > 0) statements.push(name + adds.join(''));
506
+ break;
507
+ }
508
+
509
+ case 'Map': {
409
510
  values.push(`new Map`);
410
- statements.push(
411
- `${name}.${Array.from(thing)
412
- .map(([k, v]) => `set(${stringify(k)}, ${stringify(v)})`)
413
- .join('.')}`
511
+ const sets = Array.from(thing).map(
512
+ ([k, v]) => `.set(${stringify(k)}, ${stringify(v)})`
414
513
  );
514
+ if (sets.length > 0) statements.push(name + sets.join(''));
415
515
  break;
516
+ }
517
+
518
+ case 'Int8Array':
519
+ case 'Uint8Array':
520
+ case 'Uint8ClampedArray':
521
+ case 'Int16Array':
522
+ case 'Uint16Array':
523
+ case 'Float16Array':
524
+ case 'Int32Array':
525
+ case 'Uint32Array':
526
+ case 'Float32Array':
527
+ case 'Float64Array':
528
+ case 'BigInt64Array':
529
+ case 'BigUint64Array': {
530
+ if (is_buffer(thing)) thing = new Uint8Array(thing);
531
+
532
+ let str = `new ${type}`;
533
+
534
+ if (!names.has(thing.buffer)) {
535
+ str += `([${stringify_typed_array_elements(type, thing.buffer)}])`;
536
+ } else {
537
+ str += `(${stringify(thing.buffer)})`;
538
+ }
539
+
540
+ // handle subarrays
541
+ if (thing.byteLength !== thing.buffer.byteLength) {
542
+ const start = thing.byteOffset / thing.BYTES_PER_ELEMENT;
543
+ const end = start + thing.length;
544
+ str += `.subarray(${start},${end})`;
545
+ }
546
+
547
+ values.push(`{}`);
548
+ reconstructions.push(`${name}=${str}`);
549
+ break;
550
+ }
551
+
552
+ case 'DataView': {
553
+ let str = `new DataView`;
554
+
555
+ if (!names.has(thing.buffer)) {
556
+ str += `(new Uint8Array([${new Uint8Array(thing.buffer)}]).buffer`;
557
+ } else {
558
+ str += `(${stringify(thing.buffer)}`;
559
+ }
560
+
561
+ // handle subviews
562
+ if (thing.byteLength !== thing.buffer.byteLength) {
563
+ str += `,${thing.byteOffset},${thing.byteLength}`;
564
+ }
565
+
566
+ str += ')';
567
+
568
+ values.push(`{}`);
569
+ reconstructions.push(`${name}=${str}`);
570
+ break;
571
+ }
416
572
 
417
573
  case 'ArrayBuffer':
418
- values.push(
419
- `new Uint8Array([${new Uint8Array(thing).join(',')}]).buffer`
420
- );
574
+ values.push(`new Uint8Array([${new Uint8Array(thing)}]).buffer`);
575
+ break;
576
+
577
+ case 'Temporal.Duration':
578
+ case 'Temporal.Instant':
579
+ case 'Temporal.PlainDate':
580
+ case 'Temporal.PlainTime':
581
+ case 'Temporal.PlainDateTime':
582
+ case 'Temporal.PlainMonthDay':
583
+ case 'Temporal.PlainYearMonth':
584
+ case 'Temporal.ZonedDateTime':
585
+ values.push(`${type}.from(${stringify_string(thing.toString())})`);
421
586
  break;
422
587
 
423
588
  default:
424
- values.push(
425
- Object.getPrototypeOf(thing) === null ? 'Object.create(null)' : '{}'
426
- );
589
+ values.push(Object.getPrototypeOf(thing) === null ? 'Object.create(null)' : '{}');
427
590
  Object.keys(thing).forEach((key) => {
428
- statements.push(
429
- `${name}${safe_prop(key)}=${stringify(thing[key])}`
430
- );
591
+ statements.push(`${name}${safe_prop(key)}=${stringify(thing[key])}`);
431
592
  });
432
593
  }
433
594
  });
434
595
 
435
596
  statements.push(`return ${str}`);
436
597
 
437
- return `(function(${params.join(',')}){${statements.join(
438
- ';'
439
- )}}(${values.join(',')}))`;
598
+ const body = [...reconstructions, ...statements].join(';');
599
+ // A function may have at most 65535 parameters (and a call at most that
600
+ // many arguments). For very large graphs, pass the hoisted values as a
601
+ // single array argument and destructure them into the placeholder names,
602
+ // so the emitted code stays within the engine limit (#93).
603
+ if (params.length > 65534) {
604
+ return `(function(){var[${params.join(',')}]=arguments[0];${body}}([${values.join(',')}]))`;
605
+ }
606
+
607
+ return `(function(${params.join(',')}){${body}}(${values.join(',')}))`;
440
608
  } else {
441
609
  return str;
442
610
  }
443
611
  }
444
612
 
613
+ /**
614
+ * Emit an array whose storage is not proportional to its declared length.
615
+ * As in the default parse operations, touching and deleting the largest valid
616
+ * index forces V8 into dictionary-elements mode before setting the length.
617
+ * Merely starting with [] and assigning .length still eagerly allocates.
618
+ * @param {number} length
619
+ */
620
+ function stringify_sparse_array(length) {
621
+ return `(function(a){a[${MAX_ARRAY_INDEX}]=0;delete a[${MAX_ARRAY_INDEX}];a.length=${length};return a}([]))`;
622
+ }
623
+
624
+ /**
625
+ * Serialize the elements of `buffer`, read as `type`, as a comma-separated list.
626
+ * The view is created from `type` rather than from the serialized value's own
627
+ * constructor, which may be a subclass like Node's `Buffer` whose `toString`
628
+ * decodes the bytes instead of listing them.
629
+ * `BigInt64Array`/`BigUint64Array` elements are bigints and must be written
630
+ * with an `n` suffix, otherwise the emitted `new BigInt64Array([...])` throws.
631
+ * @param {string} type
632
+ * @param {ArrayBufferLike} buffer
633
+ */
634
+ function stringify_typed_array_elements(type, buffer) {
635
+ const array = new (/** @type {any} */ (globalThis)[type])(buffer);
636
+
637
+ if (type === 'BigInt64Array' || type === 'BigUint64Array') {
638
+ return Array.from(array, (element) => `${element}n`).join(',');
639
+ }
640
+
641
+ // Float arrays can hold `-0`, which `toString()` collapses to `"0"`, silently
642
+ // losing the sign on round-trip. Emit `-0` explicitly for those elements.
643
+ if (
644
+ array instanceof Float32Array ||
645
+ array instanceof Float64Array ||
646
+ (typeof Float16Array !== 'undefined' && array instanceof Float16Array)
647
+ ) {
648
+ return Array.from(array, (element) => (Object.is(element, -0) ? '-0' : `${element}`)).join(',');
649
+ }
650
+
651
+ return array.toString();
652
+ }
653
+
445
654
  /** @param {number} num */
446
655
  function get_name(num) {
447
656
  let name = '';
@@ -466,9 +675,7 @@ function escape_unsafe_chars(str) {
466
675
 
467
676
  /** @param {string} key */
468
677
  function safe_key(key) {
469
- return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key)
470
- ? key
471
- : escape_unsafe_chars(JSON.stringify(key));
678
+ return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key) ? key : escape_unsafe_chars(JSON.stringify(key));
472
679
  }
473
680
 
474
681
  /** @param {string} key */
@@ -480,11 +687,12 @@ function safe_prop(key) {
480
687
 
481
688
  /** @param {any} thing */
482
689
  function stringify_primitive(thing) {
483
- if (typeof thing === 'string') return stringify_string(thing);
690
+ const type = typeof thing;
691
+ if (type === 'string') return stringify_string(thing);
484
692
  if (thing === void 0) return 'void 0';
485
693
  if (thing === 0 && 1 / thing < 0) return '-0';
486
694
  const str = String(thing);
487
- if (typeof thing === 'number') return str.replace(/^(-)?0\./, '$1.');
488
- if (typeof thing === 'bigint') return thing + 'n';
695
+ if (type === 'number') return str.replace(/^(-)?0\./, '$1.');
696
+ if (type === 'bigint') return thing + 'n';
489
697
  return str;
490
698
  }