@highstate/designer 0.19.1 → 0.21.1
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 +5 -5
- package/.output/public/_nuxt/-OnKOwAh.js +1 -0
- package/.output/public/_nuxt/32ctXXKs.js +1 -0
- package/.output/public/_nuxt/5X7smno1.js +1 -0
- package/.output/public/_nuxt/5gjbd9sK.js +1 -0
- package/.output/public/_nuxt/9OHRRPkh.js +1 -0
- package/.output/public/_nuxt/B-dJABhs.js +1 -0
- package/.output/public/_nuxt/B2SoM2pd.js +2 -0
- package/.output/public/_nuxt/B4FDp1sn.js +1 -0
- package/.output/public/_nuxt/{CmALWFRB.js → B69Z0Xk1.js} +16 -468
- package/.output/public/_nuxt/B7RpoNQl.js +1 -0
- package/.output/public/_nuxt/B7c-h3xW.js +1 -0
- package/.output/public/_nuxt/BA47KaF1.js +1 -0
- package/.output/public/_nuxt/BArXRmKu.js +1 -0
- package/.output/public/_nuxt/BBf5iR-q.js +1 -0
- package/.output/public/_nuxt/BCJKqJxW.js +1 -0
- package/.output/public/_nuxt/{YB_1Ta41.js → BD_Kvn-W.js} +1 -1
- package/.output/public/_nuxt/BGHnOYBU.js +1 -0
- package/.output/public/_nuxt/BH7IYjvW.js +1 -0
- package/.output/public/_nuxt/BIPWeF69.js +1 -0
- package/.output/public/_nuxt/BJDFO7_C.js +1 -0
- package/.output/public/_nuxt/BKIVPvZX.js +1 -0
- package/.output/public/_nuxt/{Xi2tawMN.js → BLmx8bSh.js} +1 -1
- package/.output/public/_nuxt/BN7gUcg9.js +1 -0
- package/.output/public/_nuxt/{DlfHMoPT.js → BPQ3VLAy.js} +1 -1
- package/.output/public/_nuxt/{BBGuKPBd.js → BR5kRUq4.js} +1 -1
- package/.output/public/_nuxt/BTd2ZN65.js +1 -0
- package/.output/public/_nuxt/BTifaqeh.js +1 -0
- package/.output/public/_nuxt/BUw7H-hv.js +1 -0
- package/.output/public/_nuxt/{DRprw4p4.js → BVQ-GDCI.js} +1 -1
- package/.output/public/_nuxt/BXphdu9w.js +2 -0
- package/.output/public/_nuxt/{BbQj0Z2C.js → BYV0-3_D.js} +1 -1
- package/.output/public/_nuxt/BYmSxWA_.js +1 -0
- package/.output/public/_nuxt/BZvkOJ9d.js +1 -0
- package/.output/public/_nuxt/BcVCzyr7.js +1 -0
- package/.output/public/_nuxt/BdRuKvw2.js +1 -0
- package/.output/public/_nuxt/Bdd5S2WL.js +1 -0
- package/.output/public/_nuxt/BeH2EWoN.js +1 -0
- package/.output/public/_nuxt/BhozkjGO.js +1 -0
- package/.output/public/_nuxt/Bl_Sz9PU.js +1 -0
- package/.output/public/_nuxt/Bmn6On1c.js +1 -0
- package/.output/public/_nuxt/{BIAuTxu3.js → Br6cN0cg.js} +1 -1
- package/.output/public/_nuxt/Bs8TB6Bu.js +1 -0
- package/.output/public/_nuxt/BtrNScOx.js +1 -0
- package/.output/public/_nuxt/{DcmvOc98.js → Bu1xs0Fv.js} +1 -1
- package/.output/public/_nuxt/BupMEc6X.js +6 -0
- package/.output/public/_nuxt/Bv_4Rxtq.js +1 -0
- package/.output/public/_nuxt/Bv_vOb-Y.js +14 -0
- package/.output/public/_nuxt/BvzEVeQv.js +1 -0
- package/.output/public/_nuxt/BwKAHWnp.js +1 -0
- package/.output/public/_nuxt/BxAss8Tj.js +1 -0
- package/.output/public/_nuxt/BxgE0vQu.js +1 -0
- package/.output/public/_nuxt/ByE1aAlg.js +2 -0
- package/.output/public/_nuxt/{COI20M4I.js → BzTr9Aqm.js} +1 -1
- package/.output/public/_nuxt/BzhaMbyl.js +1 -0
- package/.output/public/_nuxt/{CXu1NL6O.js → C-HG3fhB.js} +1 -1
- package/.output/public/_nuxt/C2zyO9uX.js +1 -0
- package/.output/public/_nuxt/C3Wv6jpd.js +1 -0
- package/.output/public/_nuxt/C4EeE6gA.js +1 -0
- package/.output/public/_nuxt/C4XpvUuq.js +1 -0
- package/.output/public/_nuxt/{C-Jbm3Hp.js → C4gqWexZ.js} +1 -1
- package/.output/public/_nuxt/C5BYcBs_.js +1 -0
- package/.output/public/_nuxt/{DTMYz4Jt.js → C5YyOfLZ.js} +1 -1
- package/.output/public/_nuxt/C7zT0LnQ.js +1 -0
- package/.output/public/_nuxt/C973_vs5.js +5 -0
- package/.output/public/_nuxt/C9dUb6Cb.js +1 -0
- package/.output/public/_nuxt/{DS1LvVMU.js → C9oPPf7i.js} +1 -1
- package/.output/public/_nuxt/CBIEPWAA.js +1 -0
- package/.output/public/_nuxt/CBVcjGJL.js +1 -0
- package/.output/public/_nuxt/CENFIVCM.js +1 -0
- package/.output/public/_nuxt/{D1uDOp7C.js → CFHQjOhq.js} +1 -1
- package/.output/public/_nuxt/{DKzvysjW.js → CH1njM8p.js} +1 -1
- package/.output/public/_nuxt/CJN4g-3R.js +1 -0
- package/.output/public/_nuxt/CLZrNe3w.js +1 -0
- package/.output/public/_nuxt/CMTm3GFP.js +1 -0
- package/.output/public/_nuxt/COcwbKMJ.js +1 -0
- package/.output/public/_nuxt/CPsHsqGU.js +1 -0
- package/.output/public/_nuxt/CTRkBkra.js +1 -0
- package/.output/public/_nuxt/{CcyOm34o.js → CVdnzihN.js} +1 -1
- package/.output/public/_nuxt/CW8IKDeL.js +1 -0
- package/.output/public/_nuxt/{pkIJ47B4.js → CXZktZb0.js} +1 -1
- package/.output/public/_nuxt/CYL3VlR9.js +1 -0
- package/.output/public/_nuxt/CYpkKp66.js +1 -0
- package/.output/public/_nuxt/CYsAdtH9.js +1 -0
- package/.output/public/_nuxt/{BUyGWigt.js → CZhp0h8q.js} +1 -1
- package/.output/public/_nuxt/CaehGOgh.js +1 -0
- package/.output/public/_nuxt/CemiMtCX.js +1 -0
- package/.output/public/_nuxt/{oTG82Wo1.js → CenWIFCC.js} +1 -1
- package/.output/public/_nuxt/{Dtc2v4kS.js → CgK0fS9t.js} +1 -1
- package/.output/public/_nuxt/{BtsDLbAf.js → Cl0AqbOI.js} +1 -1
- package/.output/public/_nuxt/{DUSGQflk.js → Cm3UrAx6.js} +1 -1
- package/.output/public/_nuxt/{BGHREFWD.js → CmIQRyeF.js} +1 -1
- package/.output/public/_nuxt/CmJE87KM.js +1 -0
- package/.output/public/_nuxt/Cn-bp-IR.js +1 -0
- package/.output/public/_nuxt/{f7oK2omx.js → Cn7AkR1O.js} +1 -1
- package/.output/public/_nuxt/CnhVSb6R.js +1 -0
- package/.output/public/_nuxt/{JhPuU2gP.js → CnnebwVN.js} +1 -1
- package/.output/public/_nuxt/CnsnAmq5.js +1 -0
- package/.output/public/_nuxt/CoDkCxhg.js +1 -0
- package/.output/public/_nuxt/CpGRan2R.js +1 -0
- package/.output/public/_nuxt/{B-hkwWGT.js → CpOuai2O.js} +1 -1
- package/.output/public/_nuxt/CqQg8Ldy.js +1 -0
- package/.output/public/_nuxt/Cs-GjQ8R.js +1 -0
- package/.output/public/_nuxt/CtbC3i8L.js +1 -0
- package/.output/public/_nuxt/{BDzgwa52.js → CufHLc7y.js} +1 -1
- package/.output/public/_nuxt/CvSiusML.js +1 -0
- package/.output/public/_nuxt/CwoSXNpI.js +1 -0
- package/.output/public/_nuxt/CxLEBnE3.js +1 -0
- package/.output/public/_nuxt/{DNrj_gVY.js → CxbxFI8M.js} +1 -1
- package/.output/public/_nuxt/CxoCegAs.js +13 -0
- package/.output/public/_nuxt/Cz-197mS.js +1 -0
- package/.output/public/_nuxt/Cz2AlsmD.js +1 -0
- package/.output/public/_nuxt/D-7HtdRe.js +12 -0
- package/.output/public/_nuxt/{NleAzG8P.js → D4_iv3hh.js} +1 -1
- package/.output/public/_nuxt/D53aC0YG.js +1 -0
- package/.output/public/_nuxt/{Dg5xB15N.js → D82vCrfD.js} +1 -1
- package/.output/public/_nuxt/D87Tk5Gz.js +1 -0
- package/.output/public/_nuxt/D8_7TLub.js +1 -0
- package/.output/public/_nuxt/D8l8udqQ.js +1 -0
- package/.output/public/_nuxt/DCK6hB22.js +1 -0
- package/.output/public/_nuxt/{Cb0HU5_O.js → DDvzSYfr.js} +1 -1
- package/.output/public/_nuxt/DEtIJe2u.js +1 -0
- package/.output/public/_nuxt/DEthMvLe.js +1 -0
- package/.output/public/_nuxt/DFWUc33u.js +1 -0
- package/.output/public/_nuxt/{5bLW0GMw.js → DGP4VlC8.js} +1 -1
- package/.output/public/_nuxt/DHJ62FKo.js +2 -0
- package/.output/public/_nuxt/{CnK8MTSM.js → DHQR4-dF.js} +1 -1
- package/.output/public/_nuxt/DJjDtW9f.js +1 -0
- package/.output/public/_nuxt/DKWXhhCy.js +1 -0
- package/.output/public/_nuxt/DPOp833l.js +1 -0
- package/.output/public/_nuxt/DQyhUUbL.js +1 -0
- package/.output/public/_nuxt/DRJZaHtK.js +1 -0
- package/.output/public/_nuxt/{DPcUKYIF.js → DRw_LuNl.js} +1 -1
- package/.output/public/_nuxt/DSDbyhpJ.js +1 -0
- package/.output/public/_nuxt/{B8ROHVmM.js → DSeZwD4N.js} +1 -1
- package/.output/public/_nuxt/{GAB5JH5K.js → DSpiceQe.js} +1 -1
- package/.output/public/_nuxt/DTPYfUid.js +1 -0
- package/.output/public/_nuxt/DUHba1vY.js +1 -0
- package/.output/public/_nuxt/DV7GczEv.js +1 -0
- package/.output/public/_nuxt/DXyfavJr.js +1 -0
- package/.output/public/_nuxt/DYE7WIF3.js +1 -0
- package/.output/public/_nuxt/DZf3V79B.js +1 -0
- package/.output/public/_nuxt/{BPzJO5Oe.js → DZu-aV2c.js} +1 -1
- package/.output/public/_nuxt/D_wY_uke.js +1 -0
- package/.output/public/_nuxt/Dahes9VH.js +1 -0
- package/.output/public/_nuxt/DdvHdmGh.js +1 -0
- package/.output/public/_nuxt/DfvKjH24.js +1 -0
- package/.output/public/_nuxt/DgsIRcX7.js +1 -0
- package/.output/public/_nuxt/{Cdx7mHEO.js → DhmSosst.js} +1 -1
- package/.output/public/_nuxt/{D32k8WzR.js → DjAJT7YJ.js} +1 -1
- package/.output/public/_nuxt/Djg8J2AC.js +1 -0
- package/.output/public/_nuxt/DkkrdwgN.js +1 -0
- package/.output/public/_nuxt/DnpKvmH_.js +1 -0
- package/.output/public/_nuxt/{CA7CTBwS.js → Dph4kLrZ.js} +1 -1
- package/.output/public/_nuxt/DqQDbK_p.js +1 -0
- package/.output/public/_nuxt/DrWe3t51.js +2 -0
- package/.output/public/_nuxt/DsG1SoRB.js +1 -0
- package/.output/public/_nuxt/Dspwwk_N.js +1 -0
- package/.output/public/_nuxt/DsumFeuD.js +1 -0
- package/.output/public/_nuxt/DtBrxin9.js +1 -0
- package/.output/public/_nuxt/{D7ScPSBf.js → DxNHbxmM.js} +1 -1
- package/.output/public/_nuxt/{CLvts2aQ.js → DxSwrfjg.js} +1 -1
- package/.output/public/_nuxt/{COEtLSDF.js → Dzze3sRP.js} +1 -1
- package/.output/public/_nuxt/EnN6XTXK.js +1 -0
- package/.output/public/_nuxt/Fcs-0n6A.js +1 -0
- package/.output/public/_nuxt/{B5ZR69Tn.js → FtFNcQmh.js} +1 -1
- package/.output/public/_nuxt/GXzlut8R.js +1 -0
- package/.output/public/_nuxt/{DkhsQLT2.js → GsRaNv29.js} +1 -1
- package/.output/public/_nuxt/IF9eRakj.js +1 -0
- package/.output/public/_nuxt/Lks7C8cK.js +3 -0
- package/.output/public/_nuxt/M0WOzN-S.js +269 -0
- package/.output/public/_nuxt/OuCcJFrZ.js +1 -0
- package/.output/public/_nuxt/{SecretValueField.DcyO8gGc.css → SecretValueField.Dy80RlGP.css} +1 -1
- package/.output/public/_nuxt/UD_auLNX.js +1 -0
- package/.output/public/_nuxt/Ve4PFQV2.js +1 -0
- package/.output/public/_nuxt/{CU27uY9n.js → W9tJ9s81.js} +1 -1
- package/.output/public/_nuxt/{DeWFVDHI.js → YqXBG_HV.js} +1 -1
- package/.output/public/_nuxt/ZpmLW6rw.js +1 -0
- package/.output/public/_nuxt/_H4v1dQx.js +1 -0
- package/.output/public/_nuxt/_snapshotId_.ChuSNeNY.css +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/d356de5d-6230-4e66-aba2-c48f455ae207.json +1 -0
- package/.output/public/_nuxt/builds/meta/ed797280-2bf0-44e6-a601-2ff2462bfbbc.json +1 -0
- package/.output/public/_nuxt/c6k-jVO-.js +1 -0
- package/.output/public/_nuxt/edge-router-BdPMCV6u.js +1 -0
- package/.output/public/_nuxt/{entry.dxugZJXl.css → entry.Bc0aTA0K.css} +1 -1
- package/.output/public/_nuxt/eo99z4R2.js +1 -0
- package/.output/public/_nuxt/error-404.iOXvqd5J.css +1 -0
- package/.output/public/_nuxt/error-500.D0BgXBui.css +1 -0
- package/.output/public/_nuxt/{DrZfEa88.js → fKv21gyL.js} +1 -1
- package/.output/public/_nuxt/graph-layout-B7wl80r3.js +1 -0
- package/.output/public/_nuxt/graph-resolver-E9RSC1Ga.js +180 -0
- package/.output/public/_nuxt/hAFXcJ2_.js +1 -0
- package/.output/public/_nuxt/{CGqH5EJj.js → hJgmCMqR.js} +1 -1
- package/.output/public/_nuxt/{BoKiGodi.js → k_qm7-4y.js} +1 -1
- package/.output/public/_nuxt/{IvJ92aGK.js → m17aaUwq.js} +1 -1
- package/.output/public/_nuxt/mWjccvbQ.js +1 -0
- package/.output/public/_nuxt/{BXY8tDGw.js → mjskCLCv.js} +1 -1
- package/.output/public/_nuxt/monaco-editor.DOXZIHvr.css +1 -0
- package/.output/public/_nuxt/n2N0HUVH.js +1 -0
- package/.output/public/_nuxt/oH_c3LbQ.js +1 -0
- package/.output/public/_nuxt/{BHrmToEH.js → qdsjHGoJ.js} +1 -1
- package/.output/public/_nuxt/{BbcW6ACK.js → rGO070M0.js} +1 -1
- package/.output/public/_nuxt/rZm6bMo-.js +1 -0
- package/.output/public/_nuxt/rscZxuQ2.js +1 -0
- package/.output/public/_nuxt/sB5TSp0H.js +18 -0
- package/.output/public/_nuxt/u5AG7uiY.js +1 -0
- package/.output/public/_nuxt/uYugtg8r.js +1 -0
- package/.output/public/_nuxt/vuetify.BzdWZaIq.css +1 -0
- package/.output/public/_nuxt/wCosSBIO.js +1 -0
- package/.output/public/_nuxt/{BMMyXqK5.js → wDzz0qaB.js} +1 -1
- package/.output/public/_nuxt/xnReCuE4.js +1 -0
- package/.output/public/_nuxt/y0GN4iGv.js +1 -0
- package/.output/public/_nuxt/yaml.worker-CYOhFCVP.js +395 -0
- package/.output/public/libavoid.wasm +0 -0
- package/.output/server/index.mjs +3216 -13095
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/@babel/parser/lib/index.js +428 -441
- package/.output/server/node_modules/@babel/parser/package.json +6 -6
- package/.output/server/node_modules/@trpc/server/dist/adapters/fetch/index.cjs +57 -0
- package/.output/server/node_modules/@trpc/server/dist/adapters/fetch/index.mjs +4 -4
- package/.output/server/node_modules/@trpc/server/dist/codes-BfZsPdy-.cjs +222 -0
- package/.output/server/node_modules/@trpc/server/dist/{utils-CLZnJdb_.mjs → codes-DagpWZLc.mjs} +66 -66
- package/.output/server/node_modules/@trpc/server/dist/{contentTypeParsers-SN4WL9ze.mjs → contentTypeParsers-iAFF_pJG.cjs} +7 -2
- package/.output/server/node_modules/@trpc/server/dist/getErrorShape-MR4DZeb7.cjs +341 -0
- package/.output/server/node_modules/@trpc/server/dist/{getErrorShape-BH60iMC2.mjs → getErrorShape-vC8mUXJD.mjs} +3 -3
- package/.output/server/node_modules/@trpc/server/dist/http.cjs +14 -0
- package/.output/server/node_modules/@trpc/server/dist/index.cjs +22 -0
- package/.output/server/node_modules/@trpc/server/dist/index.mjs +4 -4
- package/.output/server/node_modules/@trpc/server/dist/{initTRPC-CB9uBez5.mjs → initTRPC-B1ggxyJl.mjs} +4 -4
- package/.output/server/node_modules/@trpc/server/dist/initTRPC-BXPPV9Tx.cjs +416 -0
- package/.output/server/node_modules/@trpc/server/dist/observable/index.cjs +13 -0
- package/.output/server/node_modules/@trpc/server/dist/observable-B1Nk6r1H.cjs +181 -0
- package/.output/server/node_modules/@trpc/server/dist/{observable-CUiPknO-.mjs → observable-BVzLuBs6.cjs} +42 -8
- package/.output/server/node_modules/@trpc/server/dist/{parseTRPCMessage-BlZeZ60t.mjs → parseTRPCMessage-7Ltmq-Fb.cjs} +14 -4
- package/.output/server/node_modules/@trpc/server/dist/resolveResponse-B0CCg8nq.cjs +2365 -0
- package/.output/server/node_modules/@trpc/server/dist/{resolveResponse-DngSgha6.mjs → resolveResponse-C5I6V_wc.mjs} +109 -63
- package/.output/server/node_modules/@trpc/server/dist/rpc.cjs +6 -0
- package/.output/server/node_modules/@trpc/server/dist/{tracked-Blz8XOf1.mjs → tracked-DiE3uR1B.mjs} +22 -11
- package/.output/server/node_modules/@trpc/server/dist/tracked-Dj_dpOJE.cjs +486 -0
- package/.output/server/node_modules/@trpc/server/package.json +17 -7
- package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +129 -107
- package/.output/server/node_modules/@vue/compiler-core/package.json +5 -5
- package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +54 -54
- package/.output/server/node_modules/@vue/compiler-dom/package.json +3 -3
- package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +35 -33
- package/.output/server/node_modules/@vue/compiler-ssr/package.json +3 -3
- package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +134 -53
- package/.output/server/node_modules/@vue/reactivity/package.json +2 -2
- package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +1900 -1771
- package/.output/server/node_modules/@vue/runtime-core/package.json +3 -3
- package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +147 -39
- package/.output/server/node_modules/@vue/runtime-dom/package.json +5 -5
- package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +8 -4
- package/.output/server/node_modules/@vue/server-renderer/package.json +4 -4
- package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +1 -1
- package/.output/server/node_modules/@vue/shared/package.json +1 -1
- package/.output/server/node_modules/copy-anything/dist/index.js +47 -31
- package/.output/server/node_modules/copy-anything/package.json +19 -72
- package/.output/server/node_modules/devalue/index.js +1 -0
- package/.output/server/node_modules/devalue/package.json +5 -2
- package/.output/server/node_modules/devalue/src/base64.js +46 -96
- package/.output/server/node_modules/devalue/src/constants.js +1 -0
- package/.output/server/node_modules/devalue/src/parse.js +82 -9
- package/.output/server/node_modules/devalue/src/stringify.js +108 -34
- package/.output/server/node_modules/devalue/src/uneval.js +207 -58
- package/.output/server/node_modules/devalue/src/utils.js +38 -8
- package/.output/server/node_modules/entities/{lib/decode_codepoint.js → dist/commonjs/decode-codepoint.js} +16 -15
- package/.output/server/node_modules/entities/{lib → dist/commonjs}/decode.js +200 -168
- package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js +7 -0
- package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +7 -0
- package/.output/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +21 -0
- package/.output/server/node_modules/entities/dist/commonjs/internal/decode-shared.js +31 -0
- package/.output/server/node_modules/entities/dist/commonjs/package.json +3 -0
- package/.output/server/node_modules/entities/package.json +99 -69
- package/.output/server/node_modules/hookable/dist/index.mjs +238 -271
- package/.output/server/node_modules/hookable/package.json +33 -29
- package/.output/server/node_modules/is-what/dist/getType.js +4 -0
- package/.output/server/node_modules/is-what/dist/index.js +43 -171
- package/.output/server/node_modules/is-what/dist/isAnyObject.js +8 -0
- package/.output/server/node_modules/is-what/dist/isArray.js +5 -0
- package/.output/server/node_modules/is-what/dist/isBigInt.js +5 -0
- package/.output/server/node_modules/is-what/dist/isBlob.js +5 -0
- package/.output/server/node_modules/is-what/dist/isBoolean.js +5 -0
- package/.output/server/node_modules/is-what/dist/isDate.js +5 -0
- package/.output/server/node_modules/is-what/dist/isEmptyArray.js +5 -0
- package/.output/server/node_modules/is-what/dist/isEmptyObject.js +8 -0
- package/.output/server/node_modules/is-what/dist/isEmptyString.js +4 -0
- package/.output/server/node_modules/is-what/dist/isError.js +5 -0
- package/.output/server/node_modules/is-what/dist/isFile.js +5 -0
- package/.output/server/node_modules/is-what/dist/isFullArray.js +5 -0
- package/.output/server/node_modules/is-what/dist/isFullObject.js +8 -0
- package/.output/server/node_modules/is-what/dist/isFullString.js +5 -0
- package/.output/server/node_modules/is-what/dist/isFunction.js +4 -0
- package/.output/server/node_modules/is-what/dist/isHexDecimal.js +12 -0
- package/.output/server/node_modules/is-what/dist/isInstanceOf.js +19 -0
- package/.output/server/node_modules/is-what/dist/isInteger.js +5 -0
- package/.output/server/node_modules/is-what/dist/isIterable.js +16 -0
- package/.output/server/node_modules/is-what/dist/isMap.js +5 -0
- package/.output/server/node_modules/is-what/dist/isNaNValue.js +5 -0
- package/.output/server/node_modules/is-what/dist/isNegativeInteger.js +5 -0
- package/.output/server/node_modules/is-what/dist/isNegativeNumber.js +5 -0
- package/.output/server/node_modules/is-what/dist/isNull.js +5 -0
- package/.output/server/node_modules/is-what/dist/isNullOrUndefined.js +5 -0
- package/.output/server/node_modules/is-what/dist/isNumber.js +9 -0
- package/.output/server/node_modules/is-what/dist/isObject.js +8 -0
- package/.output/server/node_modules/is-what/dist/isObjectLike.js +11 -0
- package/.output/server/node_modules/is-what/dist/isOneOf.js +15 -0
- package/.output/server/node_modules/is-what/dist/isPlainObject.js +11 -0
- package/.output/server/node_modules/is-what/dist/isPositiveInteger.js +5 -0
- package/.output/server/node_modules/is-what/dist/isPositiveNumber.js +5 -0
- package/.output/server/node_modules/is-what/dist/isPrimitive.js +21 -0
- package/.output/server/node_modules/is-what/dist/isPromise.js +5 -0
- package/.output/server/node_modules/is-what/dist/isRegExp.js +5 -0
- package/.output/server/node_modules/is-what/dist/isSet.js +5 -0
- package/.output/server/node_modules/is-what/dist/isString.js +5 -0
- package/.output/server/node_modules/is-what/dist/isSymbol.js +5 -0
- package/.output/server/node_modules/is-what/dist/isType.js +20 -0
- package/.output/server/node_modules/is-what/dist/isUndefined.js +5 -0
- package/.output/server/node_modules/is-what/dist/isWeakMap.js +5 -0
- package/.output/server/node_modules/is-what/dist/isWeakSet.js +5 -0
- package/.output/server/node_modules/is-what/package.json +23 -88
- package/.output/server/node_modules/superjson/dist/index.js +9 -6
- package/.output/server/node_modules/superjson/dist/pathstringifier.js +13 -2
- package/.output/server/node_modules/superjson/dist/plainer.js +23 -11
- package/.output/server/node_modules/superjson/dist/transformer.js +4 -1
- package/.output/server/node_modules/superjson/package.json +5 -21
- package/.output/server/node_modules/trpc-bun-adapter/dist/index.js +406 -0
- package/.output/server/node_modules/trpc-bun-adapter/package.json +44 -0
- package/.output/server/node_modules/ufo/dist/index.mjs +16 -9
- package/.output/server/node_modules/ufo/package.json +15 -14
- package/.output/server/node_modules/unhead/dist/plugins.mjs +4 -4
- package/.output/server/node_modules/unhead/dist/server.mjs +4 -6
- package/.output/server/node_modules/unhead/dist/shared/{unhead.BpRRHAhY.mjs → unhead.B5FWS6X0.mjs} +35 -22
- package/.output/server/node_modules/unhead/dist/shared/{unhead.DZbvapt-.mjs → unhead.CbpEuj3y.mjs} +3 -2
- package/.output/server/node_modules/unhead/dist/shared/{unhead.DH45uomy.mjs → unhead.Ct24BOby.mjs} +6 -4
- package/.output/server/node_modules/unhead/dist/shared/unhead.D4vSFytZ.mjs +236 -0
- package/.output/server/node_modules/unhead/dist/shared/{unhead.Djo8ep_Y.mjs → unhead.TxTMM7cM.mjs} +2 -2
- package/.output/server/node_modules/unhead/dist/utils.mjs +2 -2
- package/.output/server/node_modules/unhead/package.json +2 -2
- package/.output/server/node_modules/vue/dist/vue.cjs.js +1 -1
- package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +1 -1
- package/.output/server/node_modules/vue/package.json +7 -7
- package/.output/server/node_modules/zod/package.json +1 -1
- package/.output/server/node_modules/zod/v4/classic/checks.js +1 -1
- package/.output/server/node_modules/zod/v4/classic/external.js +3 -1
- package/.output/server/node_modules/zod/v4/classic/from-json-schema.js +584 -0
- package/.output/server/node_modules/zod/v4/classic/schemas.js +121 -4
- package/.output/server/node_modules/zod/v4/core/api.js +157 -0
- package/.output/server/node_modules/zod/v4/core/checks.js +8 -2
- package/.output/server/node_modules/zod/v4/core/core.js +20 -11
- package/.output/server/node_modules/zod/v4/core/index.js +2 -0
- package/.output/server/node_modules/zod/v4/core/json-schema-generator.js +95 -0
- package/.output/server/node_modules/zod/v4/core/json-schema-processors.js +605 -0
- package/.output/server/node_modules/zod/v4/core/regexes.js +8 -2
- package/.output/server/node_modules/zod/v4/core/registries.js +3 -4
- package/.output/server/node_modules/zod/v4/core/schemas.js +204 -66
- package/.output/server/node_modules/zod/v4/core/to-json-schema.js +391 -869
- package/.output/server/node_modules/zod/v4/core/util.js +58 -8
- package/.output/server/node_modules/zod/v4/core/versions.js +2 -2
- package/.output/server/node_modules/zod/v4/locales/ar.js +14 -24
- package/.output/server/node_modules/zod/v4/locales/az.js +14 -24
- package/.output/server/node_modules/zod/v4/locales/be.js +16 -24
- package/.output/server/node_modules/zod/v4/locales/bg.js +16 -24
- package/.output/server/node_modules/zod/v4/locales/ca.js +14 -25
- package/.output/server/node_modules/zod/v4/locales/cs.js +18 -42
- package/.output/server/node_modules/zod/v4/locales/da.js +23 -39
- package/.output/server/node_modules/zod/v4/locales/de.js +16 -24
- package/.output/server/node_modules/zod/v4/locales/en.js +16 -24
- package/.output/server/node_modules/zod/v4/locales/eo.js +17 -24
- package/.output/server/node_modules/zod/v4/locales/es.js +42 -59
- package/.output/server/node_modules/zod/v4/locales/fa.js +16 -24
- package/.output/server/node_modules/zod/v4/locales/fi.js +14 -24
- package/.output/server/node_modules/zod/v4/locales/fr-CA.js +14 -24
- package/.output/server/node_modules/zod/v4/locales/fr.js +16 -24
- package/.output/server/node_modules/zod/v4/locales/he.js +175 -78
- package/.output/server/node_modules/zod/v4/locales/hu.js +16 -25
- package/.output/server/node_modules/zod/v4/locales/hy.js +147 -0
- package/.output/server/node_modules/zod/v4/locales/id.js +14 -24
- package/.output/server/node_modules/zod/v4/locales/index.js +2 -0
- package/.output/server/node_modules/zod/v4/locales/is.js +16 -24
- package/.output/server/node_modules/zod/v4/locales/it.js +16 -25
- package/.output/server/node_modules/zod/v4/locales/ja.js +16 -24
- package/.output/server/node_modules/zod/v4/locales/ka.js +19 -32
- package/.output/server/node_modules/zod/v4/locales/km.js +17 -24
- package/.output/server/node_modules/zod/v4/locales/ko.js +14 -24
- package/.output/server/node_modules/zod/v4/locales/lt.js +27 -54
- package/.output/server/node_modules/zod/v4/locales/mk.js +16 -25
- package/.output/server/node_modules/zod/v4/locales/ms.js +15 -24
- package/.output/server/node_modules/zod/v4/locales/nl.js +25 -32
- package/.output/server/node_modules/zod/v4/locales/no.js +16 -24
- package/.output/server/node_modules/zod/v4/locales/ota.js +17 -25
- package/.output/server/node_modules/zod/v4/locales/pl.js +16 -24
- package/.output/server/node_modules/zod/v4/locales/ps.js +16 -24
- package/.output/server/node_modules/zod/v4/locales/pt.js +16 -24
- package/.output/server/node_modules/zod/v4/locales/ru.js +16 -24
- package/.output/server/node_modules/zod/v4/locales/sl.js +16 -24
- package/.output/server/node_modules/zod/v4/locales/sv.js +16 -24
- package/.output/server/node_modules/zod/v4/locales/ta.js +17 -24
- package/.output/server/node_modules/zod/v4/locales/th.js +17 -24
- package/.output/server/node_modules/zod/v4/locales/tr.js +14 -24
- package/.output/server/node_modules/zod/v4/locales/uk.js +16 -25
- package/.output/server/node_modules/zod/v4/locales/ur.js +17 -24
- package/.output/server/node_modules/zod/v4/locales/uz.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/vi.js +16 -24
- package/.output/server/node_modules/zod/v4/locales/yo.js +16 -24
- package/.output/server/node_modules/zod/v4/locales/zh-CN.js +17 -24
- package/.output/server/node_modules/zod/v4/locales/zh-TW.js +14 -24
- package/.output/server/package.json +22 -22
- package/package.json +20 -14
- package/.output/public/_nuxt/-oaD50UK.js +0 -1
- package/.output/public/_nuxt/0ekw3e2V.js +0 -1
- package/.output/public/_nuxt/1DNp92w6.js +0 -1
- package/.output/public/_nuxt/1f5tAgHw.js +0 -1
- package/.output/public/_nuxt/5ggY4uig.js +0 -1
- package/.output/public/_nuxt/6nHXG8SA.js +0 -1
- package/.output/public/_nuxt/9hmcqHPO.js +0 -1
- package/.output/public/_nuxt/BBxmzUt6.js +0 -1
- package/.output/public/_nuxt/BE2KfCdU.js +0 -1
- package/.output/public/_nuxt/BFNM2w_f.js +0 -1
- package/.output/public/_nuxt/BGLu70Yq.js +0 -1
- package/.output/public/_nuxt/BIuj43Wh.js +0 -1
- package/.output/public/_nuxt/BLsOQd1H.js +0 -280
- package/.output/public/_nuxt/BNGfscqk.js +0 -1
- package/.output/public/_nuxt/BQvybpQq.js +0 -1
- package/.output/public/_nuxt/BU7Cl-8B.js +0 -1
- package/.output/public/_nuxt/BUXOnL59.js +0 -1
- package/.output/public/_nuxt/Bbwybh3N.js +0 -2
- package/.output/public/_nuxt/BczD6j-v.js +0 -1
- package/.output/public/_nuxt/BepWV7mh.js +0 -1
- package/.output/public/_nuxt/Bh0qehhp.js +0 -1
- package/.output/public/_nuxt/Bl2oy6fF.js +0 -1
- package/.output/public/_nuxt/BmDdxTjo.js +0 -1
- package/.output/public/_nuxt/BqeRdtD4.js +0 -2
- package/.output/public/_nuxt/BvAqAH-y.js +0 -1
- package/.output/public/_nuxt/BxZD33h1.js +0 -1
- package/.output/public/_nuxt/C4zpeTvm.js +0 -1
- package/.output/public/_nuxt/C7Pw0Ztw.js +0 -1
- package/.output/public/_nuxt/C8-UwF3o.js +0 -1
- package/.output/public/_nuxt/CCd08HS_.js +0 -1
- package/.output/public/_nuxt/CEYFgC8B.js +0 -1
- package/.output/public/_nuxt/CHadp7IV.js +0 -1
- package/.output/public/_nuxt/CHh-QcGE.js +0 -1
- package/.output/public/_nuxt/CIUZ1G5V.js +0 -1
- package/.output/public/_nuxt/CJ6lOLXp.js +0 -1
- package/.output/public/_nuxt/CN9dMhDM.js +0 -1
- package/.output/public/_nuxt/CQ4fj8p0.js +0 -1
- package/.output/public/_nuxt/CTWiQX6C.js +0 -1
- package/.output/public/_nuxt/CUEJCptM.js +0 -1
- package/.output/public/_nuxt/CXxzV4dz.js +0 -1
- package/.output/public/_nuxt/CZlF05X6.js +0 -1
- package/.output/public/_nuxt/CatV_12G.js +0 -1
- package/.output/public/_nuxt/CeMkeBDb.js +0 -1
- package/.output/public/_nuxt/CelvVQyk.js +0 -1
- package/.output/public/_nuxt/CfV455SO.js +0 -1
- package/.output/public/_nuxt/CfeIJUat.js +0 -1
- package/.output/public/_nuxt/CfqrF6sE.js +0 -1
- package/.output/public/_nuxt/Cfs9EX91.js +0 -1
- package/.output/public/_nuxt/ChH_ziBE.js +0 -1
- package/.output/public/_nuxt/ChM1GEGa.js +0 -1
- package/.output/public/_nuxt/Cp2bjttb.js +0 -1
- package/.output/public/_nuxt/Cu8OsqJL.js +0 -1
- package/.output/public/_nuxt/CusJppg0.js +0 -1
- package/.output/public/_nuxt/Cv9koXgw.js +0 -1
- package/.output/public/_nuxt/CvELRi2k.js +0 -5
- package/.output/public/_nuxt/Cw6nGM9K.js +0 -1
- package/.output/public/_nuxt/CwUT5n6w.js +0 -1
- package/.output/public/_nuxt/D-AHKB2i.js +0 -6
- package/.output/public/_nuxt/D-kcn2fr.js +0 -1
- package/.output/public/_nuxt/D08WgyRC.js +0 -1
- package/.output/public/_nuxt/D1Jbgd7O.js +0 -13
- package/.output/public/_nuxt/D1ibY74j.js +0 -1
- package/.output/public/_nuxt/D22FLkUw.js +0 -1
- package/.output/public/_nuxt/D2CYqzqI.js +0 -1
- package/.output/public/_nuxt/D34EmFco.js +0 -1
- package/.output/public/_nuxt/D4OhWExI.js +0 -1
- package/.output/public/_nuxt/DDHikT5j.js +0 -1
- package/.output/public/_nuxt/DDTT3lYc.js +0 -1
- package/.output/public/_nuxt/DHLkt8Yr.js +0 -1
- package/.output/public/_nuxt/DHuTDtaT.js +0 -12
- package/.output/public/_nuxt/DKYwYmdq.js +0 -1
- package/.output/public/_nuxt/DMDPKkZ0.js +0 -1
- package/.output/public/_nuxt/DNEoBllO.js +0 -1
- package/.output/public/_nuxt/DRzH1pOL.js +0 -1
- package/.output/public/_nuxt/DSUF3NDE.js +0 -1
- package/.output/public/_nuxt/DTAwr92a.js +0 -1
- package/.output/public/_nuxt/DWmtspXK.js +0 -1
- package/.output/public/_nuxt/DXh9HyqW.js +0 -1
- package/.output/public/_nuxt/DXtl0MQI.js +0 -1
- package/.output/public/_nuxt/D_zCY0Xl.js +0 -1
- package/.output/public/_nuxt/DaZJpzOl.js +0 -1
- package/.output/public/_nuxt/Df68jz8_.js +0 -1
- package/.output/public/_nuxt/DhQfdAdO.js +0 -1
- package/.output/public/_nuxt/DiinP2Uv.js +0 -1
- package/.output/public/_nuxt/DljmTZ5-.js +0 -1
- package/.output/public/_nuxt/Dm4QKadl.js +0 -26
- package/.output/public/_nuxt/DmCK90gL.js +0 -1
- package/.output/public/_nuxt/Dn2_MT6a.js +0 -1
- package/.output/public/_nuxt/Don94nLk.js +0 -1
- package/.output/public/_nuxt/Dr8Zlu6v.js +0 -1
- package/.output/public/_nuxt/Drp5UXmf.js +0 -1
- package/.output/public/_nuxt/DtFoCuZo.js +0 -1
- package/.output/public/_nuxt/Dv7Oe6Be.js +0 -1
- package/.output/public/_nuxt/DxuitVdg.js +0 -2
- package/.output/public/_nuxt/DyJlTyXw.js +0 -1
- package/.output/public/_nuxt/Jep7L2Wt.js +0 -1
- package/.output/public/_nuxt/LUl67wzp.js +0 -1
- package/.output/public/_nuxt/M2rHlmBj.js +0 -1
- package/.output/public/_nuxt/N3RVRbLb.js +0 -1
- package/.output/public/_nuxt/NBseiqgx.js +0 -1
- package/.output/public/_nuxt/PoHY5YXO.js +0 -1
- package/.output/public/_nuxt/SdwduGaY.js +0 -1
- package/.output/public/_nuxt/SytC7lKg.js +0 -1
- package/.output/public/_nuxt/U3pqMjXV.js +0 -1
- package/.output/public/_nuxt/UInuXPgp.js +0 -1
- package/.output/public/_nuxt/YXI84j39.js +0 -2
- package/.output/public/_nuxt/ZZ6g6dXy.js +0 -2
- package/.output/public/_nuxt/builds/meta/033f259e-8ba9-4c82-8824-56febea80b7d.json +0 -1
- package/.output/public/_nuxt/dglhsJpM.js +0 -1
- package/.output/public/_nuxt/dwrHE3tM.js +0 -14
- package/.output/public/_nuxt/edge-router-yEORMNQw.js +0 -4
- package/.output/public/_nuxt/error-404.CttAF9VE.css +0 -1
- package/.output/public/_nuxt/error-500.DXXd6-x4.css +0 -1
- package/.output/public/_nuxt/ga9TZ2z5.js +0 -1
- package/.output/public/_nuxt/graph-layout-CFj469YF.js +0 -1
- package/.output/public/_nuxt/graph-resolver-eG1ZUsYn.js +0 -166
- package/.output/public/_nuxt/monaco-editor.D_J4ItrK.css +0 -1
- package/.output/public/_nuxt/ov4D99rA.js +0 -1
- package/.output/public/_nuxt/qYU5Tabh.js +0 -1
- package/.output/public/_nuxt/qliWkHmV.js +0 -1
- package/.output/public/_nuxt/uMbE6_td.js +0 -1
- package/.output/public/_nuxt/vuetify.BrkCt9t5.css +0 -5
- package/.output/public/_nuxt/yaml.worker-CQ6dFw39.js +0 -405
- package/.output/server/node_modules/@trpc/server/dist/adapters/ws.mjs +0 -15
- package/.output/server/node_modules/@trpc/server/dist/node-http-8dtdvMrE.mjs +0 -222
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import-D89CaGtL.mjs +0 -29
- package/.output/server/node_modules/@trpc/server/dist/ws-BR20IWki.mjs +0 -420
- package/.output/server/node_modules/entities/lib/generated/decode-data-html.js +0 -9
- package/.output/server/node_modules/entities/lib/generated/decode-data-xml.js +0 -9
- package/.output/server/node_modules/unhead/dist/shared/unhead.CApf5sj3.mjs +0 -148
- package/.output/server/node_modules/ws/lib/buffer-util.js +0 -131
- package/.output/server/node_modules/ws/lib/constants.js +0 -18
- package/.output/server/node_modules/ws/lib/event-target.js +0 -292
- package/.output/server/node_modules/ws/lib/extension.js +0 -203
- package/.output/server/node_modules/ws/lib/limiter.js +0 -55
- package/.output/server/node_modules/ws/lib/permessage-deflate.js +0 -528
- package/.output/server/node_modules/ws/lib/receiver.js +0 -706
- package/.output/server/node_modules/ws/lib/sender.js +0 -602
- package/.output/server/node_modules/ws/lib/stream.js +0 -161
- package/.output/server/node_modules/ws/lib/subprotocol.js +0 -62
- package/.output/server/node_modules/ws/lib/validation.js +0 -152
- package/.output/server/node_modules/ws/lib/websocket-server.js +0 -550
- package/.output/server/node_modules/ws/lib/websocket.js +0 -1388
- package/.output/server/node_modules/ws/package.json +0 -69
- package/.output/server/node_modules/ws/wrapper.mjs +0 -8
- package/LICENSE +0 -21
- /package/.output/server/node_modules/@trpc/server/dist/{http-CWyjOa1l.mjs → http-DXy3XyhL.cjs} +0 -0
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
is_plain_object,
|
|
6
6
|
is_primitive,
|
|
7
7
|
stringify_key,
|
|
8
|
-
stringify_string
|
|
8
|
+
stringify_string,
|
|
9
|
+
valid_array_indices
|
|
9
10
|
} from './utils.js';
|
|
10
11
|
import {
|
|
11
12
|
HOLE,
|
|
@@ -13,6 +14,7 @@ import {
|
|
|
13
14
|
NEGATIVE_INFINITY,
|
|
14
15
|
NEGATIVE_ZERO,
|
|
15
16
|
POSITIVE_INFINITY,
|
|
17
|
+
SPARSE,
|
|
16
18
|
UNDEFINED
|
|
17
19
|
} from './constants.js';
|
|
18
20
|
import { encode64 } from './base64.js';
|
|
@@ -44,17 +46,13 @@ export function stringify(value, reducers) {
|
|
|
44
46
|
|
|
45
47
|
/** @param {any} thing */
|
|
46
48
|
function flatten(thing) {
|
|
47
|
-
if (typeof thing === 'function') {
|
|
48
|
-
throw new DevalueError(`Cannot stringify a function`, keys);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
49
|
if (thing === undefined) return UNDEFINED;
|
|
52
50
|
if (Number.isNaN(thing)) return NAN;
|
|
53
51
|
if (thing === Infinity) return POSITIVE_INFINITY;
|
|
54
52
|
if (thing === -Infinity) return NEGATIVE_INFINITY;
|
|
55
53
|
if (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO;
|
|
56
54
|
|
|
57
|
-
if (indexes.has(thing)) return indexes.get(thing);
|
|
55
|
+
if (indexes.has(thing)) return /** @type {number} */ (indexes.get(thing));
|
|
58
56
|
|
|
59
57
|
const index = p++;
|
|
60
58
|
indexes.set(thing, index);
|
|
@@ -67,6 +65,12 @@ export function stringify(value, reducers) {
|
|
|
67
65
|
}
|
|
68
66
|
}
|
|
69
67
|
|
|
68
|
+
if (typeof thing === 'function') {
|
|
69
|
+
throw new DevalueError(`Cannot stringify a function`, keys, thing, value);
|
|
70
|
+
} else if (typeof thing === 'symbol') {
|
|
71
|
+
throw new DevalueError(`Cannot stringify a Symbol primitive`, keys, thing, value);
|
|
72
|
+
}
|
|
73
|
+
|
|
70
74
|
let str = '';
|
|
71
75
|
|
|
72
76
|
if (is_primitive(thing)) {
|
|
@@ -78,11 +82,8 @@ export function stringify(value, reducers) {
|
|
|
78
82
|
case 'Number':
|
|
79
83
|
case 'String':
|
|
80
84
|
case 'Boolean':
|
|
81
|
-
str = `["Object",${stringify_primitive(thing)}]`;
|
|
82
|
-
break;
|
|
83
|
-
|
|
84
85
|
case 'BigInt':
|
|
85
|
-
str = `["
|
|
86
|
+
str = `["Object",${flatten(thing.valueOf())}]`;
|
|
86
87
|
break;
|
|
87
88
|
|
|
88
89
|
case 'Date':
|
|
@@ -105,24 +106,89 @@ export function stringify(value, reducers) {
|
|
|
105
106
|
: `["RegExp",${stringify_string(source)}]`;
|
|
106
107
|
break;
|
|
107
108
|
|
|
108
|
-
case 'Array':
|
|
109
|
+
case 'Array': {
|
|
110
|
+
// For dense arrays (no holes), we iterate normally.
|
|
111
|
+
// When we encounter the first hole, we call Object.keys
|
|
112
|
+
// to determine the sparseness, then decide between:
|
|
113
|
+
// - HOLE encoding: [-2, val, -2, ...] (default)
|
|
114
|
+
// - Sparse encoding: [-7, length, idx, val, ...] (for very sparse arrays)
|
|
115
|
+
// Only the sparse path avoids iterating every slot, which
|
|
116
|
+
// is what protects against the DoS of e.g. `arr[1000000] = 1`.
|
|
117
|
+
let mostly_dense = false;
|
|
118
|
+
|
|
109
119
|
str = '[';
|
|
110
120
|
|
|
111
121
|
for (let i = 0; i < thing.length; i += 1) {
|
|
112
122
|
if (i > 0) str += ',';
|
|
113
123
|
|
|
114
|
-
if (i
|
|
124
|
+
if (Object.hasOwn(thing, i)) {
|
|
115
125
|
keys.push(`[${i}]`);
|
|
116
126
|
str += flatten(thing[i]);
|
|
117
127
|
keys.pop();
|
|
118
|
-
} else {
|
|
128
|
+
} else if (mostly_dense) {
|
|
129
|
+
// Use dense encoding. The heuristic guarantees the
|
|
130
|
+
// array is only mildly sparse, so iterating over every
|
|
131
|
+
// slot is fine.
|
|
119
132
|
str += HOLE;
|
|
133
|
+
} else {
|
|
134
|
+
// Decide between HOLE encoding and sparse encoding.
|
|
135
|
+
//
|
|
136
|
+
// HOLE encoding: each hole is serialized as the HOLE
|
|
137
|
+
// sentinel (-2). For example, [, "a", ,] becomes
|
|
138
|
+
// [-2, 0, -2]. Each hole costs 3 chars ("-2" + comma).
|
|
139
|
+
//
|
|
140
|
+
// Sparse encoding: lists only populated indices.
|
|
141
|
+
// For example, [, "a", ,] becomes [-7, 3, 1, 0] — the
|
|
142
|
+
// -7 sentinel, the array length (3), then index-value
|
|
143
|
+
// pairs. This avoids paying per-hole, but each element
|
|
144
|
+
// costs extra chars to write its index.
|
|
145
|
+
//
|
|
146
|
+
// The values are the same size either way, so the
|
|
147
|
+
// choice comes down to structural overhead:
|
|
148
|
+
//
|
|
149
|
+
// HOLE overhead:
|
|
150
|
+
// 3 chars per hole ("-2" + comma)
|
|
151
|
+
// = (L - P) * 3
|
|
152
|
+
//
|
|
153
|
+
// Sparse overhead:
|
|
154
|
+
// "-7," — 3 chars (sparse sentinel + comma)
|
|
155
|
+
// + length + "," — (d + 1) chars (array length + comma)
|
|
156
|
+
// + per element: index + "," — (d + 1) chars
|
|
157
|
+
// = (4 + d) + P * (d + 1)
|
|
158
|
+
//
|
|
159
|
+
// where L is the array length, P is the number of
|
|
160
|
+
// populated elements, and d is the number of digits
|
|
161
|
+
// in L (an upper bound on the digits in any index).
|
|
162
|
+
//
|
|
163
|
+
// Sparse encoding is cheaper when:
|
|
164
|
+
// (4 + d) + P * (d + 1) < (L - P) * 3
|
|
165
|
+
const populated_keys = valid_array_indices(/** @type {any[]} */ (thing));
|
|
166
|
+
const population = populated_keys.length;
|
|
167
|
+
const d = String(thing.length).length;
|
|
168
|
+
|
|
169
|
+
const hole_cost = (thing.length - population) * 3;
|
|
170
|
+
const sparse_cost = 4 + d + population * (d + 1);
|
|
171
|
+
|
|
172
|
+
if (hole_cost > sparse_cost) {
|
|
173
|
+
str = '[' + SPARSE + ',' + thing.length;
|
|
174
|
+
for (let j = 0; j < populated_keys.length; j++) {
|
|
175
|
+
const key = populated_keys[j];
|
|
176
|
+
keys.push(`[${key}]`);
|
|
177
|
+
str += ',' + key + ',' + flatten(thing[key]);
|
|
178
|
+
keys.pop();
|
|
179
|
+
}
|
|
180
|
+
break;
|
|
181
|
+
} else {
|
|
182
|
+
mostly_dense = true;
|
|
183
|
+
str += HOLE;
|
|
184
|
+
}
|
|
120
185
|
}
|
|
121
186
|
}
|
|
122
187
|
|
|
123
188
|
str += ']';
|
|
124
189
|
|
|
125
190
|
break;
|
|
191
|
+
}
|
|
126
192
|
|
|
127
193
|
case 'Set':
|
|
128
194
|
str = '["Set"';
|
|
@@ -138,9 +204,7 @@ export function stringify(value, reducers) {
|
|
|
138
204
|
str = '["Map"';
|
|
139
205
|
|
|
140
206
|
for (const [key, value] of thing) {
|
|
141
|
-
keys.push(
|
|
142
|
-
`.get(${is_primitive(key) ? stringify_primitive(key) : '...'})`
|
|
143
|
-
);
|
|
207
|
+
keys.push(`.get(${is_primitive(key) ? stringify_primitive(key) : '...'})`);
|
|
144
208
|
str += `,${flatten(key)},${flatten(value)}`;
|
|
145
209
|
keys.pop();
|
|
146
210
|
}
|
|
@@ -153,23 +217,22 @@ export function stringify(value, reducers) {
|
|
|
153
217
|
case 'Uint8ClampedArray':
|
|
154
218
|
case 'Int16Array':
|
|
155
219
|
case 'Uint16Array':
|
|
220
|
+
case 'Float16Array':
|
|
156
221
|
case 'Int32Array':
|
|
157
222
|
case 'Uint32Array':
|
|
158
223
|
case 'Float32Array':
|
|
159
224
|
case 'Float64Array':
|
|
160
225
|
case 'BigInt64Array':
|
|
161
|
-
case 'BigUint64Array':
|
|
226
|
+
case 'BigUint64Array':
|
|
227
|
+
case 'DataView': {
|
|
162
228
|
/** @type {import("./types.js").TypedArray} */
|
|
163
229
|
const typedArray = thing;
|
|
164
230
|
str = '["' + type + '",' + flatten(typedArray.buffer);
|
|
165
231
|
|
|
166
|
-
const a = thing.byteOffset;
|
|
167
|
-
const b = a + thing.byteLength;
|
|
168
|
-
|
|
169
232
|
// handle subarrays
|
|
170
|
-
if (
|
|
171
|
-
|
|
172
|
-
str += `,${
|
|
233
|
+
if (typedArray.byteLength !== typedArray.buffer.byteLength) {
|
|
234
|
+
// to be used with `new TypedArray(buffer, byteOffset, length)`
|
|
235
|
+
str += `,${typedArray.byteOffset},${typedArray.length}`;
|
|
173
236
|
}
|
|
174
237
|
|
|
175
238
|
str += ']';
|
|
@@ -198,22 +261,25 @@ export function stringify(value, reducers) {
|
|
|
198
261
|
|
|
199
262
|
default:
|
|
200
263
|
if (!is_plain_object(thing)) {
|
|
201
|
-
throw new DevalueError(
|
|
202
|
-
`Cannot stringify arbitrary non-POJOs`,
|
|
203
|
-
keys
|
|
204
|
-
);
|
|
264
|
+
throw new DevalueError(`Cannot stringify arbitrary non-POJOs`, keys, thing, value);
|
|
205
265
|
}
|
|
206
266
|
|
|
207
267
|
if (enumerable_symbols(thing).length > 0) {
|
|
208
|
-
throw new DevalueError(
|
|
209
|
-
`Cannot stringify POJOs with symbolic keys`,
|
|
210
|
-
keys
|
|
211
|
-
);
|
|
268
|
+
throw new DevalueError(`Cannot stringify POJOs with symbolic keys`, keys, thing, value);
|
|
212
269
|
}
|
|
213
270
|
|
|
214
271
|
if (Object.getPrototypeOf(thing) === null) {
|
|
215
272
|
str = '["null"';
|
|
216
|
-
for (const key
|
|
273
|
+
for (const key of Object.keys(thing)) {
|
|
274
|
+
if (key === '__proto__') {
|
|
275
|
+
throw new DevalueError(
|
|
276
|
+
`Cannot stringify objects with __proto__ keys`,
|
|
277
|
+
keys,
|
|
278
|
+
thing,
|
|
279
|
+
value
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
|
|
217
283
|
keys.push(stringify_key(key));
|
|
218
284
|
str += `,${stringify_string(key)},${flatten(thing[key])}`;
|
|
219
285
|
keys.pop();
|
|
@@ -222,7 +288,16 @@ export function stringify(value, reducers) {
|
|
|
222
288
|
} else {
|
|
223
289
|
str = '{';
|
|
224
290
|
let started = false;
|
|
225
|
-
for (const key
|
|
291
|
+
for (const key of Object.keys(thing)) {
|
|
292
|
+
if (key === '__proto__') {
|
|
293
|
+
throw new DevalueError(
|
|
294
|
+
`Cannot stringify objects with __proto__ keys`,
|
|
295
|
+
keys,
|
|
296
|
+
thing,
|
|
297
|
+
value
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
|
|
226
301
|
if (started) str += ',';
|
|
227
302
|
started = true;
|
|
228
303
|
keys.push(stringify_key(key));
|
|
@@ -253,7 +328,6 @@ export function stringify(value, reducers) {
|
|
|
253
328
|
function stringify_primitive(thing) {
|
|
254
329
|
const type = typeof thing;
|
|
255
330
|
if (type === 'string') return stringify_string(thing);
|
|
256
|
-
if (thing instanceof String) return stringify_string(thing.toString());
|
|
257
331
|
if (thing === void 0) return UNDEFINED.toString();
|
|
258
332
|
if (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO.toString();
|
|
259
333
|
if (type === 'bigint') return `["BigInt","${thing}"]`;
|
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
is_plain_object,
|
|
7
7
|
is_primitive,
|
|
8
8
|
stringify_key,
|
|
9
|
-
stringify_string
|
|
9
|
+
stringify_string,
|
|
10
|
+
valid_array_indices
|
|
10
11
|
} from './utils.js';
|
|
11
12
|
|
|
12
13
|
const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$';
|
|
@@ -29,10 +30,6 @@ export function uneval(value, replacer) {
|
|
|
29
30
|
|
|
30
31
|
/** @param {any} thing */
|
|
31
32
|
function walk(thing) {
|
|
32
|
-
if (typeof thing === 'function') {
|
|
33
|
-
throw new DevalueError(`Cannot stringify a function`, keys);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
33
|
if (!is_primitive(thing)) {
|
|
37
34
|
if (counts.has(thing)) {
|
|
38
35
|
counts.set(thing, counts.get(thing) + 1);
|
|
@@ -50,6 +47,10 @@ export function uneval(value, replacer) {
|
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
49
|
|
|
50
|
+
if (typeof thing === 'function') {
|
|
51
|
+
throw new DevalueError(`Cannot stringify a function`, keys, thing, value);
|
|
52
|
+
}
|
|
53
|
+
|
|
53
54
|
const type = get_type(thing);
|
|
54
55
|
|
|
55
56
|
switch (type) {
|
|
@@ -77,9 +78,7 @@ export function uneval(value, replacer) {
|
|
|
77
78
|
|
|
78
79
|
case 'Map':
|
|
79
80
|
for (const [key, value] of thing) {
|
|
80
|
-
keys.push(
|
|
81
|
-
`.get(${is_primitive(key) ? stringify_primitive(key) : '...'})`
|
|
82
|
-
);
|
|
81
|
+
keys.push(`.get(${is_primitive(key) ? stringify_primitive(key) : '...'})`);
|
|
83
82
|
walk(value);
|
|
84
83
|
keys.pop();
|
|
85
84
|
}
|
|
@@ -90,12 +89,14 @@ export function uneval(value, replacer) {
|
|
|
90
89
|
case 'Uint8ClampedArray':
|
|
91
90
|
case 'Int16Array':
|
|
92
91
|
case 'Uint16Array':
|
|
92
|
+
case 'Float16Array':
|
|
93
93
|
case 'Int32Array':
|
|
94
94
|
case 'Uint32Array':
|
|
95
95
|
case 'Float32Array':
|
|
96
96
|
case 'Float64Array':
|
|
97
97
|
case 'BigInt64Array':
|
|
98
98
|
case 'BigUint64Array':
|
|
99
|
+
case 'DataView':
|
|
99
100
|
walk(thing.buffer);
|
|
100
101
|
return;
|
|
101
102
|
|
|
@@ -114,25 +115,30 @@ export function uneval(value, replacer) {
|
|
|
114
115
|
|
|
115
116
|
default:
|
|
116
117
|
if (!is_plain_object(thing)) {
|
|
117
|
-
throw new DevalueError(
|
|
118
|
-
`Cannot stringify arbitrary non-POJOs`,
|
|
119
|
-
keys
|
|
120
|
-
);
|
|
118
|
+
throw new DevalueError(`Cannot stringify arbitrary non-POJOs`, keys, thing, value);
|
|
121
119
|
}
|
|
122
120
|
|
|
123
121
|
if (enumerable_symbols(thing).length > 0) {
|
|
124
|
-
throw new DevalueError(
|
|
125
|
-
`Cannot stringify POJOs with symbolic keys`,
|
|
126
|
-
keys
|
|
127
|
-
);
|
|
122
|
+
throw new DevalueError(`Cannot stringify POJOs with symbolic keys`, keys, thing, value);
|
|
128
123
|
}
|
|
129
124
|
|
|
130
|
-
for (const key
|
|
125
|
+
for (const key of Object.keys(thing)) {
|
|
126
|
+
if (key === '__proto__') {
|
|
127
|
+
throw new DevalueError(
|
|
128
|
+
`Cannot stringify objects with __proto__ keys`,
|
|
129
|
+
keys,
|
|
130
|
+
thing,
|
|
131
|
+
value
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
131
135
|
keys.push(stringify_key(key));
|
|
132
136
|
walk(thing[key]);
|
|
133
137
|
keys.pop();
|
|
134
138
|
}
|
|
135
139
|
}
|
|
140
|
+
} else if (typeof thing === 'symbol') {
|
|
141
|
+
throw new DevalueError(`Cannot stringify a Symbol primitive`, keys, thing, value);
|
|
136
142
|
}
|
|
137
143
|
}
|
|
138
144
|
|
|
@@ -170,12 +176,14 @@ export function uneval(value, replacer) {
|
|
|
170
176
|
case 'Number':
|
|
171
177
|
case 'String':
|
|
172
178
|
case 'Boolean':
|
|
179
|
+
case 'BigInt':
|
|
173
180
|
return `Object(${stringify(thing.valueOf())})`;
|
|
174
181
|
|
|
175
182
|
case 'RegExp':
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
183
|
+
const { source, flags } = thing;
|
|
184
|
+
return flags
|
|
185
|
+
? `new RegExp(${stringify_string(source)},"${flags}")`
|
|
186
|
+
: `new RegExp(${stringify_string(source)})`;
|
|
179
187
|
|
|
180
188
|
case 'Date':
|
|
181
189
|
return `new Date(${thing.getTime()})`;
|
|
@@ -186,12 +194,83 @@ export function uneval(value, replacer) {
|
|
|
186
194
|
case 'URLSearchParams':
|
|
187
195
|
return `new URLSearchParams(${stringify_string(thing.toString())})`;
|
|
188
196
|
|
|
189
|
-
case 'Array':
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
197
|
+
case 'Array': {
|
|
198
|
+
// For dense arrays (no holes), we iterate normally.
|
|
199
|
+
// When we encounter the first hole, we call Object.keys
|
|
200
|
+
// to determine the sparseness, then decide between:
|
|
201
|
+
// - Array literal with holes: [,"a",,] (default)
|
|
202
|
+
// - Object.assign: Object.assign(Array(n),{...}) (for very sparse arrays)
|
|
203
|
+
// Only the Object.assign path avoids iterating every slot, which
|
|
204
|
+
// is what protects against the DoS of e.g. `arr[1000000] = 1`.
|
|
205
|
+
let has_holes = false;
|
|
206
|
+
|
|
207
|
+
let result = '[';
|
|
208
|
+
|
|
209
|
+
for (let i = 0; i < thing.length; i += 1) {
|
|
210
|
+
if (i > 0) result += ',';
|
|
211
|
+
|
|
212
|
+
if (Object.hasOwn(thing, i)) {
|
|
213
|
+
result += stringify(thing[i]);
|
|
214
|
+
} else if (!has_holes) {
|
|
215
|
+
// Decide between array literal and Object.assign.
|
|
216
|
+
//
|
|
217
|
+
// Array literal: holes are consecutive commas.
|
|
218
|
+
// For example, [, "a", ,] is written as [,"a",,].
|
|
219
|
+
// Each hole costs 1 char (a comma).
|
|
220
|
+
//
|
|
221
|
+
// Object.assign: populated indices are listed explicitly.
|
|
222
|
+
// For example, [, "a", ,] would be written as
|
|
223
|
+
// Object.assign(Array(3),{1:"a"}). This avoids paying
|
|
224
|
+
// per-hole, but has a large fixed overhead for the
|
|
225
|
+
// "Object.assign(Array(n),{...})" wrapper, and each
|
|
226
|
+
// element costs extra chars for its index and colon.
|
|
227
|
+
//
|
|
228
|
+
// The serialized values are the same size either way, so
|
|
229
|
+
// the choice comes down to the structural overhead:
|
|
230
|
+
//
|
|
231
|
+
// Array literal overhead:
|
|
232
|
+
// 1 char per element or hole (comma separators)
|
|
233
|
+
// + 2 chars for "[" and "]"
|
|
234
|
+
// = L + 2
|
|
235
|
+
//
|
|
236
|
+
// Object.assign overhead:
|
|
237
|
+
// "Object.assign(Array(" — 20 chars
|
|
238
|
+
// + length — d chars
|
|
239
|
+
// + "),{" — 3 chars
|
|
240
|
+
// + for each populated element:
|
|
241
|
+
// index + ":" + "," — (d + 2) chars
|
|
242
|
+
// + "})" — 2 chars
|
|
243
|
+
// = (25 + d) + P * (d + 2)
|
|
244
|
+
//
|
|
245
|
+
// where L is the array length, P is the number of
|
|
246
|
+
// populated elements, and d is the number of digits
|
|
247
|
+
// in L (an upper bound on the digits in any index).
|
|
248
|
+
//
|
|
249
|
+
// Object.assign is cheaper when:
|
|
250
|
+
// (25 + d) + P * (d + 2) < L + 2
|
|
251
|
+
const populated_keys = valid_array_indices(/** @type {any[]} */ (thing));
|
|
252
|
+
const population = populated_keys.length;
|
|
253
|
+
const d = String(thing.length).length;
|
|
254
|
+
|
|
255
|
+
const hole_cost = thing.length + 2;
|
|
256
|
+
const sparse_cost = 25 + d + population * (d + 2);
|
|
257
|
+
|
|
258
|
+
if (hole_cost > sparse_cost) {
|
|
259
|
+
const entries = populated_keys.map((k) => `${k}:${stringify(thing[k])}`).join(',');
|
|
260
|
+
return `Object.assign(Array(${thing.length}),{${entries}})`;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// Re-process this index as a hole in the array literal
|
|
264
|
+
has_holes = true;
|
|
265
|
+
i -= 1;
|
|
266
|
+
}
|
|
267
|
+
// else: already decided on array literal, hole is just an empty slot
|
|
268
|
+
// (the comma separator is all we need — no content for this position)
|
|
269
|
+
}
|
|
270
|
+
|
|
193
271
|
const tail = thing.length === 0 || thing.length - 1 in thing ? '' : ',';
|
|
194
|
-
return
|
|
272
|
+
return result + tail + ']';
|
|
273
|
+
}
|
|
195
274
|
|
|
196
275
|
case 'Set':
|
|
197
276
|
case 'Map':
|
|
@@ -202,6 +281,7 @@ export function uneval(value, replacer) {
|
|
|
202
281
|
case 'Uint8ClampedArray':
|
|
203
282
|
case 'Int16Array':
|
|
204
283
|
case 'Uint16Array':
|
|
284
|
+
case 'Float16Array':
|
|
205
285
|
case 'Int32Array':
|
|
206
286
|
case 'Uint32Array':
|
|
207
287
|
case 'Float32Array':
|
|
@@ -210,25 +290,40 @@ export function uneval(value, replacer) {
|
|
|
210
290
|
case 'BigUint64Array': {
|
|
211
291
|
let str = `new ${type}`;
|
|
212
292
|
|
|
213
|
-
if (
|
|
293
|
+
if (!names.has(thing.buffer)) {
|
|
214
294
|
const array = new thing.constructor(thing.buffer);
|
|
215
295
|
str += `([${array}])`;
|
|
216
296
|
} else {
|
|
217
|
-
str += `(
|
|
297
|
+
str += `(${stringify(thing.buffer)})`;
|
|
218
298
|
}
|
|
219
299
|
|
|
220
|
-
const a = thing.byteOffset;
|
|
221
|
-
const b = a + thing.byteLength;
|
|
222
|
-
|
|
223
300
|
// handle subarrays
|
|
224
|
-
if (
|
|
225
|
-
const
|
|
226
|
-
|
|
301
|
+
if (thing.byteLength !== thing.buffer.byteLength) {
|
|
302
|
+
const start = thing.byteOffset / thing.BYTES_PER_ELEMENT;
|
|
303
|
+
const end = start + thing.length;
|
|
304
|
+
str += `.subarray(${start},${end})`;
|
|
227
305
|
}
|
|
228
306
|
|
|
229
307
|
return str;
|
|
230
308
|
}
|
|
231
309
|
|
|
310
|
+
case 'DataView': {
|
|
311
|
+
let str = `new DataView`;
|
|
312
|
+
|
|
313
|
+
if (!names.has(thing.buffer)) {
|
|
314
|
+
str += `(new Uint8Array([${new Uint8Array(thing.buffer)}]).buffer`;
|
|
315
|
+
} else {
|
|
316
|
+
str += `(${stringify(thing.buffer)}`;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// handle subviews
|
|
320
|
+
if (thing.byteLength !== thing.buffer.byteLength) {
|
|
321
|
+
str += `,${thing.startOffset},${thing.byteLength}`;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
return str + ')';
|
|
325
|
+
}
|
|
326
|
+
|
|
232
327
|
case 'ArrayBuffer': {
|
|
233
328
|
const ui8 = new Uint8Array(thing);
|
|
234
329
|
return `new Uint8Array([${ui8.toString()}]).buffer`;
|
|
@@ -246,14 +341,10 @@ export function uneval(value, replacer) {
|
|
|
246
341
|
|
|
247
342
|
default:
|
|
248
343
|
const keys = Object.keys(thing);
|
|
249
|
-
const obj = keys
|
|
250
|
-
.map((key) => `${safe_key(key)}:${stringify(thing[key])}`)
|
|
251
|
-
.join(',');
|
|
344
|
+
const obj = keys.map((key) => `${safe_key(key)}:${stringify(thing[key])}`).join(',');
|
|
252
345
|
const proto = Object.getPrototypeOf(thing);
|
|
253
346
|
if (proto === null) {
|
|
254
|
-
return keys.length > 0
|
|
255
|
-
? `{${obj},__proto__:null}`
|
|
256
|
-
: `{__proto__:null}`;
|
|
347
|
+
return keys.length > 0 ? `{${obj},__proto__:null}` : `{__proto__:null}`;
|
|
257
348
|
}
|
|
258
349
|
|
|
259
350
|
return `{${obj}}`;
|
|
@@ -291,17 +382,30 @@ export function uneval(value, replacer) {
|
|
|
291
382
|
case 'Number':
|
|
292
383
|
case 'String':
|
|
293
384
|
case 'Boolean':
|
|
385
|
+
case 'BigInt':
|
|
294
386
|
values.push(`Object(${stringify(thing.valueOf())})`);
|
|
295
387
|
break;
|
|
296
388
|
|
|
297
389
|
case 'RegExp':
|
|
298
|
-
|
|
390
|
+
const { source, flags } = thing;
|
|
391
|
+
const regexp = flags
|
|
392
|
+
? `new RegExp(${stringify_string(source)},"${flags}")`
|
|
393
|
+
: `new RegExp(${stringify_string(source)})`
|
|
394
|
+
values.push(regexp);
|
|
299
395
|
break;
|
|
300
396
|
|
|
301
397
|
case 'Date':
|
|
302
398
|
values.push(`new Date(${thing.getTime()})`);
|
|
303
399
|
break;
|
|
304
400
|
|
|
401
|
+
case 'URL':
|
|
402
|
+
values.push(`new URL(${stringify_string(thing.toString())})`);
|
|
403
|
+
break;
|
|
404
|
+
|
|
405
|
+
case 'URLSearchParams':
|
|
406
|
+
values.push(`new URLSearchParams(${stringify_string(thing.toString())})`);
|
|
407
|
+
break;
|
|
408
|
+
|
|
305
409
|
case 'Array':
|
|
306
410
|
values.push(`Array(${thing.length})`);
|
|
307
411
|
/** @type {any[]} */ (thing).forEach((v, i) => {
|
|
@@ -327,29 +431,75 @@ export function uneval(value, replacer) {
|
|
|
327
431
|
);
|
|
328
432
|
break;
|
|
329
433
|
|
|
434
|
+
case 'Int8Array':
|
|
435
|
+
case 'Uint8Array':
|
|
436
|
+
case 'Uint8ClampedArray':
|
|
437
|
+
case 'Int16Array':
|
|
438
|
+
case 'Uint16Array':
|
|
439
|
+
case 'Float16Array':
|
|
440
|
+
case 'Int32Array':
|
|
441
|
+
case 'Uint32Array':
|
|
442
|
+
case 'Float32Array':
|
|
443
|
+
case 'Float64Array':
|
|
444
|
+
case 'BigInt64Array':
|
|
445
|
+
case 'BigUint64Array': {
|
|
446
|
+
let str = `new ${type}`;
|
|
447
|
+
|
|
448
|
+
if (!names.has(thing.buffer)) {
|
|
449
|
+
const array = new thing.constructor(thing.buffer);
|
|
450
|
+
str += `([${array}])`;
|
|
451
|
+
} else {
|
|
452
|
+
str += `(${stringify(thing.buffer)})`;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
// handle subarrays
|
|
456
|
+
if (thing.byteLength !== thing.buffer.byteLength) {
|
|
457
|
+
const start = thing.byteOffset / thing.BYTES_PER_ELEMENT;
|
|
458
|
+
const end = start + thing.length;
|
|
459
|
+
str += `.subarray(${start},${end})`;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
values.push(`{}`);
|
|
463
|
+
statements.push(`${name}=${str}`);
|
|
464
|
+
break;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
case 'DataView': {
|
|
468
|
+
let str = `new DataView`;
|
|
469
|
+
|
|
470
|
+
if (!names.has(thing.buffer)) {
|
|
471
|
+
str += `(new Uint8Array([${new Uint8Array(thing.buffer)}]).buffer`;
|
|
472
|
+
} else {
|
|
473
|
+
str += `(${stringify(thing.buffer)}`;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
// handle subviews
|
|
477
|
+
if (thing.byteLength !== thing.buffer.byteLength) {
|
|
478
|
+
str += `,${thing.byteOffset},${thing.byteLength}`;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
str += ')';
|
|
482
|
+
|
|
483
|
+
values.push(`{}`);
|
|
484
|
+
statements.push(`${name}=${str}`);
|
|
485
|
+
break;
|
|
486
|
+
}
|
|
487
|
+
|
|
330
488
|
case 'ArrayBuffer':
|
|
331
|
-
values.push(
|
|
332
|
-
`new Uint8Array([${new Uint8Array(thing).join(',')}]).buffer`
|
|
333
|
-
);
|
|
489
|
+
values.push(`new Uint8Array([${new Uint8Array(thing)}]).buffer`);
|
|
334
490
|
break;
|
|
335
491
|
|
|
336
492
|
default:
|
|
337
|
-
values.push(
|
|
338
|
-
Object.getPrototypeOf(thing) === null ? 'Object.create(null)' : '{}'
|
|
339
|
-
);
|
|
493
|
+
values.push(Object.getPrototypeOf(thing) === null ? 'Object.create(null)' : '{}');
|
|
340
494
|
Object.keys(thing).forEach((key) => {
|
|
341
|
-
statements.push(
|
|
342
|
-
`${name}${safe_prop(key)}=${stringify(thing[key])}`
|
|
343
|
-
);
|
|
495
|
+
statements.push(`${name}${safe_prop(key)}=${stringify(thing[key])}`);
|
|
344
496
|
});
|
|
345
497
|
}
|
|
346
498
|
});
|
|
347
499
|
|
|
348
500
|
statements.push(`return ${str}`);
|
|
349
501
|
|
|
350
|
-
return `(function(${params.join(',')}){${statements.join(
|
|
351
|
-
';'
|
|
352
|
-
)}}(${values.join(',')}))`;
|
|
502
|
+
return `(function(${params.join(',')}){${statements.join(';')}}(${values.join(',')}))`;
|
|
353
503
|
} else {
|
|
354
504
|
return str;
|
|
355
505
|
}
|
|
@@ -379,9 +529,7 @@ function escape_unsafe_chars(str) {
|
|
|
379
529
|
|
|
380
530
|
/** @param {string} key */
|
|
381
531
|
function safe_key(key) {
|
|
382
|
-
return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key)
|
|
383
|
-
? key
|
|
384
|
-
: escape_unsafe_chars(JSON.stringify(key));
|
|
532
|
+
return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key) ? key : escape_unsafe_chars(JSON.stringify(key));
|
|
385
533
|
}
|
|
386
534
|
|
|
387
535
|
/** @param {string} key */
|
|
@@ -393,11 +541,12 @@ function safe_prop(key) {
|
|
|
393
541
|
|
|
394
542
|
/** @param {any} thing */
|
|
395
543
|
function stringify_primitive(thing) {
|
|
396
|
-
|
|
544
|
+
const type = typeof thing;
|
|
545
|
+
if (type === 'string') return stringify_string(thing);
|
|
397
546
|
if (thing === void 0) return 'void 0';
|
|
398
547
|
if (thing === 0 && 1 / thing < 0) return '-0';
|
|
399
548
|
const str = String(thing);
|
|
400
|
-
if (
|
|
401
|
-
if (
|
|
549
|
+
if (type === 'number') return str.replace(/^(-)?0\./, '$1.');
|
|
550
|
+
if (type === 'bigint') return thing + 'n';
|
|
402
551
|
return str;
|
|
403
552
|
}
|