@elgap/edukaai 0.1.0
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 +15 -0
- package/.output/public/_nuxt/BHDzAs85.js +1 -0
- package/.output/public/_nuxt/BJzbfdL_.js +1 -0
- package/.output/public/_nuxt/BKGLlKXk.js +6 -0
- package/.output/public/_nuxt/BLuXzJk3.js +1 -0
- package/.output/public/_nuxt/BNOzzLI3.js +1 -0
- package/.output/public/_nuxt/BO5GMwXh.js +1 -0
- package/.output/public/_nuxt/BQRbsFGy.js +1 -0
- package/.output/public/_nuxt/Be4MVdOg.js +1 -0
- package/.output/public/_nuxt/Bu4d3Z1T.js +1 -0
- package/.output/public/_nuxt/BwpBBNv4.js +1 -0
- package/.output/public/_nuxt/C1Og9-6n.js +97 -0
- package/.output/public/_nuxt/C3CjAhtj.js +1 -0
- package/.output/public/_nuxt/C6E3Ty3z.js +1 -0
- package/.output/public/_nuxt/COct4B42.js +1 -0
- package/.output/public/_nuxt/CQ6g2dtj.js +1 -0
- package/.output/public/_nuxt/CURSW5TV.js +246 -0
- package/.output/public/_nuxt/CW57JW4s.js +1 -0
- package/.output/public/_nuxt/Cg2fM61o.js +18 -0
- package/.output/public/_nuxt/CgGOeWta.js +1 -0
- package/.output/public/_nuxt/CoyYbT7u.js +1 -0
- package/.output/public/_nuxt/D11MHbGc.js +133 -0
- package/.output/public/_nuxt/D24dz0S8.js +1 -0
- package/.output/public/_nuxt/D3EFPr8x.js +1 -0
- package/.output/public/_nuxt/Dvt4ZHil.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -0
- package/.output/public/_nuxt/builds/meta/ab87ba0e-6d0d-4466-8b12-00d44f8fb9d3.json +1 -0
- package/.output/public/_nuxt/default.C1K1-g4D.css +1 -0
- package/.output/public/_nuxt/entry.CH8k-Mga.css +1 -0
- package/.output/public/_nuxt/error-404.C-Ezrlz-.css +1 -0
- package/.output/public/_nuxt/error-500.DBWf9FGj.css +1 -0
- package/.output/public/_nuxt/first-training.wFDD65zm.css +1 -0
- package/.output/public/_nuxt/import.cUKYdCrq.css +1 -0
- package/.output/public/_nuxt/index.D-2VHyHA.css +1 -0
- package/.output/public/_nuxt/index.D4J_vHmL.css +1 -0
- package/.output/public/_nuxt/mPJeLIz7.js +1 -0
- package/.output/server/chunks/_/error-500.mjs +19 -0
- package/.output/server/chunks/_/error-500.mjs.map +1 -0
- package/.output/server/chunks/build/ExampleCard-styles.BUOJhEg0.mjs +8 -0
- package/.output/server/chunks/build/ExampleCard-styles.BUOJhEg0.mjs.map +1 -0
- package/.output/server/chunks/build/ExampleForm-Bcpl0CfL.mjs +238 -0
- package/.output/server/chunks/build/ExampleForm-Bcpl0CfL.mjs.map +1 -0
- package/.output/server/chunks/build/ImportPreview-styles.CFmMl5Ok.mjs +8 -0
- package/.output/server/chunks/build/ImportPreview-styles.CFmMl5Ok.mjs.map +1 -0
- package/.output/server/chunks/build/_id_-BUSGcL-H.mjs +113 -0
- package/.output/server/chunks/build/_id_-BUSGcL-H.mjs.map +1 -0
- package/.output/server/chunks/build/axolotl-C-EXGgM8.mjs +112 -0
- package/.output/server/chunks/build/axolotl-C-EXGgM8.mjs.map +1 -0
- package/.output/server/chunks/build/best-practices-DsadorHb.mjs +38 -0
- package/.output/server/chunks/build/best-practices-DsadorHb.mjs.map +1 -0
- package/.output/server/chunks/build/client.precomputed.mjs +4 -0
- package/.output/server/chunks/build/client.precomputed.mjs.map +1 -0
- package/.output/server/chunks/build/default-DPkqqHOE.mjs +354 -0
- package/.output/server/chunks/build/default-DPkqqHOE.mjs.map +1 -0
- package/.output/server/chunks/build/default-styles.DsqVVS7k.mjs +8 -0
- package/.output/server/chunks/build/default-styles.DsqVVS7k.mjs.map +1 -0
- package/.output/server/chunks/build/error-404-K4UfZNck.mjs +97 -0
- package/.output/server/chunks/build/error-404-K4UfZNck.mjs.map +1 -0
- package/.output/server/chunks/build/error-404-styles.DuDrf-v0.mjs +8 -0
- package/.output/server/chunks/build/error-404-styles.DuDrf-v0.mjs.map +1 -0
- package/.output/server/chunks/build/error-500-CA7TEPNg.mjs +79 -0
- package/.output/server/chunks/build/error-500-CA7TEPNg.mjs.map +1 -0
- package/.output/server/chunks/build/error-500-styles.8IYEHzz6.mjs +8 -0
- package/.output/server/chunks/build/error-500-styles.8IYEHzz6.mjs.map +1 -0
- package/.output/server/chunks/build/examples-BHK8MDrs.mjs +134 -0
- package/.output/server/chunks/build/examples-BHK8MDrs.mjs.map +1 -0
- package/.output/server/chunks/build/export-BzxFqqfP.mjs +233 -0
- package/.output/server/chunks/build/export-BzxFqqfP.mjs.map +1 -0
- package/.output/server/chunks/build/faq-DKch73dS.mjs +112 -0
- package/.output/server/chunks/build/faq-DKch73dS.mjs.map +1 -0
- package/.output/server/chunks/build/field-guide-qbukT8F0.mjs +38 -0
- package/.output/server/chunks/build/field-guide-qbukT8F0.mjs.map +1 -0
- package/.output/server/chunks/build/first-training-BbEOBcEW.mjs +343 -0
- package/.output/server/chunks/build/first-training-BbEOBcEW.mjs.map +1 -0
- package/.output/server/chunks/build/first-training-styles.BzOa_KRD.mjs +8 -0
- package/.output/server/chunks/build/first-training-styles.BzOa_KRD.mjs.map +1 -0
- package/.output/server/chunks/build/glossary-CxSGCJoH.mjs +397 -0
- package/.output/server/chunks/build/glossary-CxSGCJoH.mjs.map +1 -0
- package/.output/server/chunks/build/huggingface-TSmyUzZU.mjs +128 -0
- package/.output/server/chunks/build/huggingface-TSmyUzZU.mjs.map +1 -0
- package/.output/server/chunks/build/import-C0kYhRv9.mjs +247 -0
- package/.output/server/chunks/build/import-C0kYhRv9.mjs.map +1 -0
- package/.output/server/chunks/build/index-C1ntBEWd.mjs +235 -0
- package/.output/server/chunks/build/index-C1ntBEWd.mjs.map +1 -0
- package/.output/server/chunks/build/index-D3CxihcX.mjs +320 -0
- package/.output/server/chunks/build/index-D3CxihcX.mjs.map +1 -0
- package/.output/server/chunks/build/index-DgKa1cy0.mjs +360 -0
- package/.output/server/chunks/build/index-DgKa1cy0.mjs.map +1 -0
- package/.output/server/chunks/build/index-cG54gaKX.mjs +513 -0
- package/.output/server/chunks/build/index-cG54gaKX.mjs.map +1 -0
- package/.output/server/chunks/build/index-styles.BX2SZiiS.mjs +8 -0
- package/.output/server/chunks/build/index-styles.BX2SZiiS.mjs.map +1 -0
- package/.output/server/chunks/build/llm-training-DIqc0eiM.mjs +91 -0
- package/.output/server/chunks/build/llm-training-DIqc0eiM.mjs.map +1 -0
- package/.output/server/chunks/build/new-b3338aLF.mjs +92 -0
- package/.output/server/chunks/build/new-b3338aLF.mjs.map +1 -0
- package/.output/server/chunks/build/nuxt-link-Ceyd90PQ.mjs +290 -0
- package/.output/server/chunks/build/nuxt-link-Ceyd90PQ.mjs.map +1 -0
- package/.output/server/chunks/build/sample-datasets-CVLWMQUA.mjs +45 -0
- package/.output/server/chunks/build/sample-datasets-CVLWMQUA.mjs.map +1 -0
- package/.output/server/chunks/build/server.mjs +1979 -0
- package/.output/server/chunks/build/server.mjs.map +1 -0
- package/.output/server/chunks/build/styles.mjs +20 -0
- package/.output/server/chunks/build/styles.mjs.map +1 -0
- package/.output/server/chunks/build/test-router-BYM6Cpst.mjs +105 -0
- package/.output/server/chunks/build/test-router-BYM6Cpst.mjs.map +1 -0
- package/.output/server/chunks/nitro/nitro.mjs +5800 -0
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -0
- package/.output/server/chunks/routes/renderer.mjs +481 -0
- package/.output/server/chunks/routes/renderer.mjs.map +1 -0
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs +4 -0
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs.map +1 -0
- package/.output/server/index.mjs +12 -0
- package/.output/server/index.mjs.map +1 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/api.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/app.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/component.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/context.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/hooks.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/index.js +22 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/util.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/const.js +5 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/env.js +17 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/index.js +45 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/plugin.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/proxy.js +111 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/time.js +28 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/package.json +37 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@7.7.9/dist/index.cjs +42 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@7.7.9/package.json +32 -0
- package/.output/server/node_modules/.nitro/hookable@5.5.3/dist/index.cjs +299 -0
- package/.output/server/node_modules/.nitro/hookable@5.5.3/package.json +49 -0
- package/.output/server/node_modules/.nitro/hookable@6.0.1/dist/index.mjs +266 -0
- package/.output/server/node_modules/.nitro/hookable@6.0.1/package.json +52 -0
- package/.output/server/node_modules/.nitro/perfect-debounce@1.0.0/dist/index.cjs +59 -0
- package/.output/server/node_modules/.nitro/perfect-debounce@1.0.0/package.json +44 -0
- package/.output/server/node_modules/.nitro/perfect-debounce@2.1.0/dist/index.mjs +89 -0
- package/.output/server/node_modules/.nitro/perfect-debounce@2.1.0/package.json +41 -0
- package/.output/server/node_modules/@babel/parser/lib/index.js +14582 -0
- package/.output/server/node_modules/@babel/parser/package.json +50 -0
- package/.output/server/node_modules/@iconify/utils/lib/colors/index.js +292 -0
- package/.output/server/node_modules/@iconify/utils/lib/colors/keywords.js +702 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/common.js +76 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/format.js +40 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/icon.js +52 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/icons.js +133 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/bool.js +20 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/defaults.js +15 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/flip.js +18 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/merge.js +18 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/rotate.js +31 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/cleanup.js +80 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/convert.js +102 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/data.js +29 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/format.js +60 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/parse.js +50 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/base.js +204 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/create.js +35 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/numbers.js +134 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/similar.js +167 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/tree.js +81 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/find.js +94 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/replace.js +28 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/components.js +78 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/missing.js +68 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/name.js +47 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/parse.js +105 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/similar.js +38 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/tree.js +94 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/variations.js +64 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/defaults.js +26 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/merge.js +18 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/name.js +58 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/square.js +34 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/transformations.js +13 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/convert-info.js +126 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/expand.js +21 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icon.js +27 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icons.js +38 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/minify.js +93 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/parse.js +48 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/tree.js +24 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate-basic.js +44 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate.js +125 -0
- package/.output/server/node_modules/@iconify/utils/lib/index.js +53 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/custom.js +32 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/loader.js +28 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/modern.js +42 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/utils.js +63 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/objects.js +27 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/strings.js +27 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/title.js +10 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/build.js +115 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/defs.js +32 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.js +15 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/html.js +10 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/id.js +42 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/inner-html.js +23 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/parse.js +69 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/pretty.js +55 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/size.js +28 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/trim.js +8 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/url.js +23 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/viewbox.js +9 -0
- package/.output/server/node_modules/@iconify/utils/package.json +118 -0
- package/.output/server/node_modules/@iconify/vue/dist/iconify.mjs +1893 -0
- package/.output/server/node_modules/@iconify/vue/package.json +64 -0
- package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6763 -0
- package/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
- package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +689 -0
- package/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
- package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1413 -0
- package/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
- package/.output/server/node_modules/@vue/devtools-kit/dist/index.cjs +6850 -0
- package/.output/server/node_modules/@vue/devtools-kit/package.json +44 -0
- package/.output/server/node_modules/@vue/devtools-shared/dist/index.cjs +378 -0
- package/.output/server/node_modules/@vue/devtools-shared/package.json +34 -0
- package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1870 -0
- package/.output/server/node_modules/@vue/reactivity/package.json +55 -0
- package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6810 -0
- package/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
- package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1750 -0
- package/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
- package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +883 -0
- package/.output/server/node_modules/@vue/server-renderer/package.json +55 -0
- package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +604 -0
- package/.output/server/node_modules/@vue/shared/package.json +47 -0
- package/.output/server/node_modules/birpc/dist/index.cjs +296 -0
- package/.output/server/node_modules/birpc/package.json +57 -0
- package/.output/server/node_modules/consola/dist/chunks/prompt.mjs +280 -0
- package/.output/server/node_modules/consola/dist/core.mjs +512 -0
- package/.output/server/node_modules/consola/dist/index.mjs +651 -0
- package/.output/server/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +72 -0
- package/.output/server/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +288 -0
- package/.output/server/node_modules/consola/package.json +136 -0
- package/.output/server/node_modules/devalue/index.js +4 -0
- package/.output/server/node_modules/devalue/package.json +37 -0
- package/.output/server/node_modules/devalue/src/base64.js +110 -0
- package/.output/server/node_modules/devalue/src/constants.js +7 -0
- package/.output/server/node_modules/devalue/src/parse.js +246 -0
- package/.output/server/node_modules/devalue/src/stringify.js +350 -0
- package/.output/server/node_modules/devalue/src/uneval.js +490 -0
- package/.output/server/node_modules/devalue/src/utils.js +148 -0
- package/.output/server/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
- package/.output/server/node_modules/entities/dist/commonjs/decode.js +568 -0
- 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 +120 -0
- package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
- package/.output/server/node_modules/estree-walker/package.json +37 -0
- package/.output/server/node_modules/pinia/dist/pinia.prod.cjs +719 -0
- package/.output/server/node_modules/pinia/package.json +94 -0
- package/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
- package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- package/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
- package/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
- package/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
- package/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- package/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
- package/.output/server/node_modules/source-map-js/lib/util.js +594 -0
- package/.output/server/node_modules/source-map-js/package.json +71 -0
- package/.output/server/node_modules/source-map-js/source-map.js +8 -0
- package/.output/server/node_modules/tailwindcss/dist/chunk-X4GG3EDV.mjs +1 -0
- package/.output/server/node_modules/tailwindcss/dist/colors.mjs +1 -0
- package/.output/server/node_modules/tailwindcss/package.json +89 -0
- package/.output/server/node_modules/ufo/dist/index.mjs +645 -0
- package/.output/server/node_modules/ufo/package.json +48 -0
- package/.output/server/node_modules/unhead/dist/index.mjs +9 -0
- package/.output/server/node_modules/unhead/dist/parser.mjs +508 -0
- package/.output/server/node_modules/unhead/dist/plugins.mjs +101 -0
- package/.output/server/node_modules/unhead/dist/scripts.mjs +30 -0
- package/.output/server/node_modules/unhead/dist/server.mjs +180 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BPM0-cfG.mjs +44 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BYvz9V1x.mjs +43 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BnoAbrHA.mjs +269 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CApf5sj3.mjs +148 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CbpEuj3y.mjs +71 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs +196 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.D_nrZZPH.mjs +182 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.ckV6dpEQ.mjs +166 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.fVVqDC1O.mjs +203 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs +38 -0
- package/.output/server/node_modules/unhead/dist/utils.mjs +5 -0
- package/.output/server/node_modules/unhead/package.json +105 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
- package/.output/server/node_modules/vue/index.js +7 -0
- package/.output/server/node_modules/vue/index.mjs +1 -0
- package/.output/server/node_modules/vue/package.json +112 -0
- package/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
- package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +301 -0
- package/.output/server/node_modules/vue-bundle-renderer/package.json +55 -0
- package/.output/server/node_modules/vue-router/dist/devtools-EWN81iOl.mjs +1220 -0
- package/.output/server/node_modules/vue-router/dist/vue-router.mjs +1557 -0
- package/.output/server/node_modules/vue-router/package.json +153 -0
- package/.output/server/node_modules/vue-router/vue-router.node.mjs +2 -0
- package/.output/server/package.json +37 -0
- package/LICENSE +21 -0
- package/README.md +132 -0
- package/bin/cli.js +75 -0
- package/package.json +71 -0
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DevalueError,
|
|
3
|
+
enumerable_symbols,
|
|
4
|
+
escaped,
|
|
5
|
+
get_type,
|
|
6
|
+
is_plain_object,
|
|
7
|
+
is_primitive,
|
|
8
|
+
stringify_key,
|
|
9
|
+
stringify_string,
|
|
10
|
+
valid_array_indices
|
|
11
|
+
} from './utils.js';
|
|
12
|
+
|
|
13
|
+
const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$';
|
|
14
|
+
const unsafe_chars = /[<\b\f\n\r\t\0\u2028\u2029]/g;
|
|
15
|
+
const reserved =
|
|
16
|
+
/^(?: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)$/;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Turn a value into the JavaScript that creates an equivalent value
|
|
20
|
+
* @param {any} value
|
|
21
|
+
* @param {(value: any, uneval: (value: any) => string) => string | void} [replacer]
|
|
22
|
+
*/
|
|
23
|
+
export function uneval(value, replacer) {
|
|
24
|
+
const counts = new Map();
|
|
25
|
+
|
|
26
|
+
/** @type {string[]} */
|
|
27
|
+
const keys = [];
|
|
28
|
+
|
|
29
|
+
const custom = new Map();
|
|
30
|
+
|
|
31
|
+
/** @param {any} thing */
|
|
32
|
+
function walk(thing) {
|
|
33
|
+
if (!is_primitive(thing)) {
|
|
34
|
+
if (counts.has(thing)) {
|
|
35
|
+
counts.set(thing, counts.get(thing) + 1);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
counts.set(thing, 1);
|
|
40
|
+
|
|
41
|
+
if (replacer) {
|
|
42
|
+
const str = replacer(thing, (value) => uneval(value, replacer));
|
|
43
|
+
|
|
44
|
+
if (typeof str === 'string') {
|
|
45
|
+
custom.set(thing, str);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (typeof thing === 'function') {
|
|
51
|
+
throw new DevalueError(`Cannot stringify a function`, keys, thing, value);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const type = get_type(thing);
|
|
55
|
+
|
|
56
|
+
switch (type) {
|
|
57
|
+
case 'Number':
|
|
58
|
+
case 'BigInt':
|
|
59
|
+
case 'String':
|
|
60
|
+
case 'Boolean':
|
|
61
|
+
case 'Date':
|
|
62
|
+
case 'RegExp':
|
|
63
|
+
case 'URL':
|
|
64
|
+
case 'URLSearchParams':
|
|
65
|
+
return;
|
|
66
|
+
|
|
67
|
+
case 'Array':
|
|
68
|
+
/** @type {any[]} */ (thing).forEach((value, i) => {
|
|
69
|
+
keys.push(`[${i}]`);
|
|
70
|
+
walk(value);
|
|
71
|
+
keys.pop();
|
|
72
|
+
});
|
|
73
|
+
break;
|
|
74
|
+
|
|
75
|
+
case 'Set':
|
|
76
|
+
Array.from(thing).forEach(walk);
|
|
77
|
+
break;
|
|
78
|
+
|
|
79
|
+
case 'Map':
|
|
80
|
+
for (const [key, value] of thing) {
|
|
81
|
+
keys.push(
|
|
82
|
+
`.get(${is_primitive(key) ? stringify_primitive(key) : '...'})`
|
|
83
|
+
);
|
|
84
|
+
walk(value);
|
|
85
|
+
keys.pop();
|
|
86
|
+
}
|
|
87
|
+
break;
|
|
88
|
+
|
|
89
|
+
case 'Int8Array':
|
|
90
|
+
case 'Uint8Array':
|
|
91
|
+
case 'Uint8ClampedArray':
|
|
92
|
+
case 'Int16Array':
|
|
93
|
+
case 'Uint16Array':
|
|
94
|
+
case 'Int32Array':
|
|
95
|
+
case 'Uint32Array':
|
|
96
|
+
case 'Float32Array':
|
|
97
|
+
case 'Float64Array':
|
|
98
|
+
case 'BigInt64Array':
|
|
99
|
+
case 'BigUint64Array':
|
|
100
|
+
walk(thing.buffer);
|
|
101
|
+
return;
|
|
102
|
+
|
|
103
|
+
case 'ArrayBuffer':
|
|
104
|
+
return;
|
|
105
|
+
|
|
106
|
+
case 'Temporal.Duration':
|
|
107
|
+
case 'Temporal.Instant':
|
|
108
|
+
case 'Temporal.PlainDate':
|
|
109
|
+
case 'Temporal.PlainTime':
|
|
110
|
+
case 'Temporal.PlainDateTime':
|
|
111
|
+
case 'Temporal.PlainMonthDay':
|
|
112
|
+
case 'Temporal.PlainYearMonth':
|
|
113
|
+
case 'Temporal.ZonedDateTime':
|
|
114
|
+
return;
|
|
115
|
+
|
|
116
|
+
default:
|
|
117
|
+
if (!is_plain_object(thing)) {
|
|
118
|
+
throw new DevalueError(
|
|
119
|
+
`Cannot stringify arbitrary non-POJOs`,
|
|
120
|
+
keys,
|
|
121
|
+
thing,
|
|
122
|
+
value
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (enumerable_symbols(thing).length > 0) {
|
|
127
|
+
throw new DevalueError(
|
|
128
|
+
`Cannot stringify POJOs with symbolic keys`,
|
|
129
|
+
keys,
|
|
130
|
+
thing,
|
|
131
|
+
value
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
for (const key of Object.keys(thing)) {
|
|
136
|
+
if (key === '__proto__') {
|
|
137
|
+
throw new DevalueError(
|
|
138
|
+
`Cannot stringify objects with __proto__ keys`,
|
|
139
|
+
keys,
|
|
140
|
+
thing,
|
|
141
|
+
value
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
keys.push(stringify_key(key));
|
|
146
|
+
walk(thing[key]);
|
|
147
|
+
keys.pop();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
walk(value);
|
|
154
|
+
|
|
155
|
+
const names = new Map();
|
|
156
|
+
|
|
157
|
+
Array.from(counts)
|
|
158
|
+
.filter((entry) => entry[1] > 1)
|
|
159
|
+
.sort((a, b) => b[1] - a[1])
|
|
160
|
+
.forEach((entry, i) => {
|
|
161
|
+
names.set(entry[0], get_name(i));
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @param {any} thing
|
|
166
|
+
* @returns {string}
|
|
167
|
+
*/
|
|
168
|
+
function stringify(thing) {
|
|
169
|
+
if (names.has(thing)) {
|
|
170
|
+
return names.get(thing);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (is_primitive(thing)) {
|
|
174
|
+
return stringify_primitive(thing);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (custom.has(thing)) {
|
|
178
|
+
return custom.get(thing);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const type = get_type(thing);
|
|
182
|
+
|
|
183
|
+
switch (type) {
|
|
184
|
+
case 'Number':
|
|
185
|
+
case 'String':
|
|
186
|
+
case 'Boolean':
|
|
187
|
+
return `Object(${stringify(thing.valueOf())})`;
|
|
188
|
+
|
|
189
|
+
case 'RegExp':
|
|
190
|
+
return `new RegExp(${stringify_string(thing.source)}, "${
|
|
191
|
+
thing.flags
|
|
192
|
+
}")`;
|
|
193
|
+
|
|
194
|
+
case 'Date':
|
|
195
|
+
return `new Date(${thing.getTime()})`;
|
|
196
|
+
|
|
197
|
+
case 'URL':
|
|
198
|
+
return `new URL(${stringify_string(thing.toString())})`;
|
|
199
|
+
|
|
200
|
+
case 'URLSearchParams':
|
|
201
|
+
return `new URLSearchParams(${stringify_string(thing.toString())})`;
|
|
202
|
+
|
|
203
|
+
case 'Array': {
|
|
204
|
+
// For dense arrays (no holes), we iterate normally.
|
|
205
|
+
// When we encounter the first hole, we call Object.keys
|
|
206
|
+
// to determine the sparseness, then decide between:
|
|
207
|
+
// - Array literal with holes: [,"a",,] (default)
|
|
208
|
+
// - Object.assign: Object.assign(Array(n),{...}) (for very sparse arrays)
|
|
209
|
+
// Only the Object.assign path avoids iterating every slot, which
|
|
210
|
+
// is what protects against the DoS of e.g. `arr[1000000] = 1`.
|
|
211
|
+
let has_holes = false;
|
|
212
|
+
|
|
213
|
+
let result = '[';
|
|
214
|
+
|
|
215
|
+
for (let i = 0; i < thing.length; i += 1) {
|
|
216
|
+
if (i > 0) result += ',';
|
|
217
|
+
|
|
218
|
+
if (Object.hasOwn(thing, i)) {
|
|
219
|
+
result += stringify(thing[i]);
|
|
220
|
+
} else if (!has_holes) {
|
|
221
|
+
// Decide between array literal and Object.assign.
|
|
222
|
+
//
|
|
223
|
+
// Array literal: holes are consecutive commas.
|
|
224
|
+
// For example, [, "a", ,] is written as [,"a",,].
|
|
225
|
+
// Each hole costs 1 char (a comma).
|
|
226
|
+
//
|
|
227
|
+
// Object.assign: populated indices are listed explicitly.
|
|
228
|
+
// 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.
|
|
233
|
+
//
|
|
234
|
+
// The serialized values are the same size either way, so
|
|
235
|
+
// the choice comes down to the structural overhead:
|
|
236
|
+
//
|
|
237
|
+
// Array literal overhead:
|
|
238
|
+
// 1 char per element or hole (comma separators)
|
|
239
|
+
// + 2 chars for "[" and "]"
|
|
240
|
+
// = L + 2
|
|
241
|
+
//
|
|
242
|
+
// Object.assign overhead:
|
|
243
|
+
// "Object.assign(Array(" — 20 chars
|
|
244
|
+
// + length — d chars
|
|
245
|
+
// + "),{" — 3 chars
|
|
246
|
+
// + for each populated element:
|
|
247
|
+
// index + ":" + "," — (d + 2) chars
|
|
248
|
+
// + "})" — 2 chars
|
|
249
|
+
// = (25 + d) + P * (d + 2)
|
|
250
|
+
//
|
|
251
|
+
// 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).
|
|
254
|
+
//
|
|
255
|
+
// Object.assign is cheaper when:
|
|
256
|
+
// (25 + d) + P * (d + 2) < L + 2
|
|
257
|
+
const populated_keys = valid_array_indices(/** @type {any[]} */ (thing));
|
|
258
|
+
const population = populated_keys.length;
|
|
259
|
+
const d = String(thing.length).length;
|
|
260
|
+
|
|
261
|
+
const hole_cost = thing.length + 2;
|
|
262
|
+
const sparse_cost = (25 + d) + population * (d + 2);
|
|
263
|
+
|
|
264
|
+
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}})`;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// Re-process this index as a hole in the array literal
|
|
272
|
+
has_holes = true;
|
|
273
|
+
i -= 1;
|
|
274
|
+
}
|
|
275
|
+
// else: already decided on array literal, hole is just an empty slot
|
|
276
|
+
// (the comma separator is all we need — no content for this position)
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const tail = thing.length === 0 || thing.length - 1 in thing ? '' : ',';
|
|
280
|
+
return result + tail + ']';
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
case 'Set':
|
|
284
|
+
case 'Map':
|
|
285
|
+
return `new ${type}([${Array.from(thing).map(stringify).join(',')}])`;
|
|
286
|
+
|
|
287
|
+
case 'Int8Array':
|
|
288
|
+
case 'Uint8Array':
|
|
289
|
+
case 'Uint8ClampedArray':
|
|
290
|
+
case 'Int16Array':
|
|
291
|
+
case 'Uint16Array':
|
|
292
|
+
case 'Int32Array':
|
|
293
|
+
case 'Uint32Array':
|
|
294
|
+
case 'Float32Array':
|
|
295
|
+
case 'Float64Array':
|
|
296
|
+
case 'BigInt64Array':
|
|
297
|
+
case 'BigUint64Array': {
|
|
298
|
+
let str = `new ${type}`;
|
|
299
|
+
|
|
300
|
+
if (counts.get(thing.buffer) === 1) {
|
|
301
|
+
const array = new thing.constructor(thing.buffer);
|
|
302
|
+
str += `([${array}])`;
|
|
303
|
+
} else {
|
|
304
|
+
str += `([${stringify(thing.buffer)}])`;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
const a = thing.byteOffset;
|
|
308
|
+
const b = a + thing.byteLength;
|
|
309
|
+
|
|
310
|
+
// 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})`;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
return str;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
case 'ArrayBuffer': {
|
|
320
|
+
const ui8 = new Uint8Array(thing);
|
|
321
|
+
return `new Uint8Array([${ui8.toString()}]).buffer`;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
case 'Temporal.Duration':
|
|
325
|
+
case 'Temporal.Instant':
|
|
326
|
+
case 'Temporal.PlainDate':
|
|
327
|
+
case 'Temporal.PlainTime':
|
|
328
|
+
case 'Temporal.PlainDateTime':
|
|
329
|
+
case 'Temporal.PlainMonthDay':
|
|
330
|
+
case 'Temporal.PlainYearMonth':
|
|
331
|
+
case 'Temporal.ZonedDateTime':
|
|
332
|
+
return `${type}.from(${stringify_string(thing.toString())})`;
|
|
333
|
+
|
|
334
|
+
default:
|
|
335
|
+
const keys = Object.keys(thing);
|
|
336
|
+
const obj = keys
|
|
337
|
+
.map((key) => `${safe_key(key)}:${stringify(thing[key])}`)
|
|
338
|
+
.join(',');
|
|
339
|
+
const proto = Object.getPrototypeOf(thing);
|
|
340
|
+
if (proto === null) {
|
|
341
|
+
return keys.length > 0
|
|
342
|
+
? `{${obj},__proto__:null}`
|
|
343
|
+
: `{__proto__:null}`;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
return `{${obj}}`;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
const str = stringify(value);
|
|
351
|
+
|
|
352
|
+
if (names.size) {
|
|
353
|
+
/** @type {string[]} */
|
|
354
|
+
const params = [];
|
|
355
|
+
|
|
356
|
+
/** @type {string[]} */
|
|
357
|
+
const statements = [];
|
|
358
|
+
|
|
359
|
+
/** @type {string[]} */
|
|
360
|
+
const values = [];
|
|
361
|
+
|
|
362
|
+
names.forEach((name, thing) => {
|
|
363
|
+
params.push(name);
|
|
364
|
+
|
|
365
|
+
if (custom.has(thing)) {
|
|
366
|
+
values.push(/** @type {string} */ (custom.get(thing)));
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
if (is_primitive(thing)) {
|
|
371
|
+
values.push(stringify_primitive(thing));
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
const type = get_type(thing);
|
|
376
|
+
|
|
377
|
+
switch (type) {
|
|
378
|
+
case 'Number':
|
|
379
|
+
case 'String':
|
|
380
|
+
case 'Boolean':
|
|
381
|
+
values.push(`Object(${stringify(thing.valueOf())})`);
|
|
382
|
+
break;
|
|
383
|
+
|
|
384
|
+
case 'RegExp':
|
|
385
|
+
values.push(thing.toString());
|
|
386
|
+
break;
|
|
387
|
+
|
|
388
|
+
case 'Date':
|
|
389
|
+
values.push(`new Date(${thing.getTime()})`);
|
|
390
|
+
break;
|
|
391
|
+
|
|
392
|
+
case 'Array':
|
|
393
|
+
values.push(`Array(${thing.length})`);
|
|
394
|
+
/** @type {any[]} */ (thing).forEach((v, i) => {
|
|
395
|
+
statements.push(`${name}[${i}]=${stringify(v)}`);
|
|
396
|
+
});
|
|
397
|
+
break;
|
|
398
|
+
|
|
399
|
+
case 'Set':
|
|
400
|
+
values.push(`new Set`);
|
|
401
|
+
statements.push(
|
|
402
|
+
`${name}.${Array.from(thing)
|
|
403
|
+
.map((v) => `add(${stringify(v)})`)
|
|
404
|
+
.join('.')}`
|
|
405
|
+
);
|
|
406
|
+
break;
|
|
407
|
+
|
|
408
|
+
case 'Map':
|
|
409
|
+
values.push(`new Map`);
|
|
410
|
+
statements.push(
|
|
411
|
+
`${name}.${Array.from(thing)
|
|
412
|
+
.map(([k, v]) => `set(${stringify(k)}, ${stringify(v)})`)
|
|
413
|
+
.join('.')}`
|
|
414
|
+
);
|
|
415
|
+
break;
|
|
416
|
+
|
|
417
|
+
case 'ArrayBuffer':
|
|
418
|
+
values.push(
|
|
419
|
+
`new Uint8Array([${new Uint8Array(thing).join(',')}]).buffer`
|
|
420
|
+
);
|
|
421
|
+
break;
|
|
422
|
+
|
|
423
|
+
default:
|
|
424
|
+
values.push(
|
|
425
|
+
Object.getPrototypeOf(thing) === null ? 'Object.create(null)' : '{}'
|
|
426
|
+
);
|
|
427
|
+
Object.keys(thing).forEach((key) => {
|
|
428
|
+
statements.push(
|
|
429
|
+
`${name}${safe_prop(key)}=${stringify(thing[key])}`
|
|
430
|
+
);
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
statements.push(`return ${str}`);
|
|
436
|
+
|
|
437
|
+
return `(function(${params.join(',')}){${statements.join(
|
|
438
|
+
';'
|
|
439
|
+
)}}(${values.join(',')}))`;
|
|
440
|
+
} else {
|
|
441
|
+
return str;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/** @param {number} num */
|
|
446
|
+
function get_name(num) {
|
|
447
|
+
let name = '';
|
|
448
|
+
|
|
449
|
+
do {
|
|
450
|
+
name = chars[num % chars.length] + name;
|
|
451
|
+
num = ~~(num / chars.length) - 1;
|
|
452
|
+
} while (num >= 0);
|
|
453
|
+
|
|
454
|
+
return reserved.test(name) ? `${name}0` : name;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/** @param {string} c */
|
|
458
|
+
function escape_unsafe_char(c) {
|
|
459
|
+
return escaped[c] || c;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/** @param {string} str */
|
|
463
|
+
function escape_unsafe_chars(str) {
|
|
464
|
+
return str.replace(unsafe_chars, escape_unsafe_char);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/** @param {string} key */
|
|
468
|
+
function safe_key(key) {
|
|
469
|
+
return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key)
|
|
470
|
+
? key
|
|
471
|
+
: escape_unsafe_chars(JSON.stringify(key));
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/** @param {string} key */
|
|
475
|
+
function safe_prop(key) {
|
|
476
|
+
return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key)
|
|
477
|
+
? `.${key}`
|
|
478
|
+
: `[${escape_unsafe_chars(JSON.stringify(key))}]`;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/** @param {any} thing */
|
|
482
|
+
function stringify_primitive(thing) {
|
|
483
|
+
if (typeof thing === 'string') return stringify_string(thing);
|
|
484
|
+
if (thing === void 0) return 'void 0';
|
|
485
|
+
if (thing === 0 && 1 / thing < 0) return '-0';
|
|
486
|
+
const str = String(thing);
|
|
487
|
+
if (typeof thing === 'number') return str.replace(/^(-)?0\./, '$1.');
|
|
488
|
+
if (typeof thing === 'bigint') return thing + 'n';
|
|
489
|
+
return str;
|
|
490
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/** @type {Record<string, string>} */
|
|
2
|
+
export const escaped = {
|
|
3
|
+
'<': '\\u003C',
|
|
4
|
+
'\\': '\\\\',
|
|
5
|
+
'\b': '\\b',
|
|
6
|
+
'\f': '\\f',
|
|
7
|
+
'\n': '\\n',
|
|
8
|
+
'\r': '\\r',
|
|
9
|
+
'\t': '\\t',
|
|
10
|
+
'\u2028': '\\u2028',
|
|
11
|
+
'\u2029': '\\u2029'
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export class DevalueError extends Error {
|
|
15
|
+
/**
|
|
16
|
+
* @param {string} message
|
|
17
|
+
* @param {string[]} keys
|
|
18
|
+
* @param {any} [value] - The value that failed to be serialized
|
|
19
|
+
* @param {any} [root] - The root value being serialized
|
|
20
|
+
*/
|
|
21
|
+
constructor(message, keys, value, root) {
|
|
22
|
+
super(message);
|
|
23
|
+
this.name = 'DevalueError';
|
|
24
|
+
this.path = keys.join('');
|
|
25
|
+
this.value = value;
|
|
26
|
+
this.root = root;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** @param {any} thing */
|
|
31
|
+
export function is_primitive(thing) {
|
|
32
|
+
return Object(thing) !== thing;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(
|
|
36
|
+
Object.prototype
|
|
37
|
+
)
|
|
38
|
+
.sort()
|
|
39
|
+
.join('\0');
|
|
40
|
+
|
|
41
|
+
/** @param {any} thing */
|
|
42
|
+
export function is_plain_object(thing) {
|
|
43
|
+
const proto = Object.getPrototypeOf(thing);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
proto === Object.prototype ||
|
|
47
|
+
proto === null ||
|
|
48
|
+
Object.getPrototypeOf(proto) === null ||
|
|
49
|
+
Object.getOwnPropertyNames(proto).sort().join('\0') === object_proto_names
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** @param {any} thing */
|
|
54
|
+
export function get_type(thing) {
|
|
55
|
+
return Object.prototype.toString.call(thing).slice(8, -1);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** @param {string} char */
|
|
59
|
+
function get_escaped_char(char) {
|
|
60
|
+
switch (char) {
|
|
61
|
+
case '"':
|
|
62
|
+
return '\\"';
|
|
63
|
+
case '<':
|
|
64
|
+
return '\\u003C';
|
|
65
|
+
case '\\':
|
|
66
|
+
return '\\\\';
|
|
67
|
+
case '\n':
|
|
68
|
+
return '\\n';
|
|
69
|
+
case '\r':
|
|
70
|
+
return '\\r';
|
|
71
|
+
case '\t':
|
|
72
|
+
return '\\t';
|
|
73
|
+
case '\b':
|
|
74
|
+
return '\\b';
|
|
75
|
+
case '\f':
|
|
76
|
+
return '\\f';
|
|
77
|
+
case '\u2028':
|
|
78
|
+
return '\\u2028';
|
|
79
|
+
case '\u2029':
|
|
80
|
+
return '\\u2029';
|
|
81
|
+
default:
|
|
82
|
+
return char < ' '
|
|
83
|
+
? `\\u${char.charCodeAt(0).toString(16).padStart(4, '0')}`
|
|
84
|
+
: '';
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** @param {string} str */
|
|
89
|
+
export function stringify_string(str) {
|
|
90
|
+
let result = '';
|
|
91
|
+
let last_pos = 0;
|
|
92
|
+
const len = str.length;
|
|
93
|
+
|
|
94
|
+
for (let i = 0; i < len; i += 1) {
|
|
95
|
+
const char = str[i];
|
|
96
|
+
const replacement = get_escaped_char(char);
|
|
97
|
+
if (replacement) {
|
|
98
|
+
result += str.slice(last_pos, i) + replacement;
|
|
99
|
+
last_pos = i + 1;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return `"${last_pos === 0 ? str : result + str.slice(last_pos)}"`;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** @param {Record<string | symbol, any>} object */
|
|
107
|
+
export function enumerable_symbols(object) {
|
|
108
|
+
return Object.getOwnPropertySymbols(object).filter(
|
|
109
|
+
(symbol) => Object.getOwnPropertyDescriptor(object, symbol).enumerable
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const is_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
|
|
114
|
+
|
|
115
|
+
/** @param {string} key */
|
|
116
|
+
export function stringify_key(key) {
|
|
117
|
+
return is_identifier.test(key) ? '.' + key : '[' + JSON.stringify(key) + ']';
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** @param {string} s */
|
|
121
|
+
function is_valid_array_index(s) {
|
|
122
|
+
if (s.length === 0) return false;
|
|
123
|
+
if (s.length > 1 && s.charCodeAt(0) === 48) return false; // leading zero
|
|
124
|
+
for (let i = 0; i < s.length; i++) {
|
|
125
|
+
const c = s.charCodeAt(i);
|
|
126
|
+
if (c < 48 || c > 57) return false;
|
|
127
|
+
}
|
|
128
|
+
// by this point we know it's a string of digits, but it has to be within the range of valid array indices
|
|
129
|
+
const n = +s;
|
|
130
|
+
if (n >= 2 ** 32 - 1) return false;
|
|
131
|
+
if (n < 0) return false;
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Finds the populated indices of an array.
|
|
137
|
+
* @param {unknown[]} array
|
|
138
|
+
*/
|
|
139
|
+
export function valid_array_indices(array) {
|
|
140
|
+
const keys = Object.keys(array);
|
|
141
|
+
for (var i = keys.length - 1; i >= 0; i--) {
|
|
142
|
+
if (is_valid_array_index(keys[i])) {
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
keys.length = i + 1;
|
|
147
|
+
return keys;
|
|
148
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134
|
|
3
|
+
var _a;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.fromCodePoint = void 0;
|
|
6
|
+
exports.replaceCodePoint = replaceCodePoint;
|
|
7
|
+
exports.decodeCodePoint = decodeCodePoint;
|
|
8
|
+
const decodeMap = new Map([
|
|
9
|
+
[0, 65533],
|
|
10
|
+
// C1 Unicode control character reference replacements
|
|
11
|
+
[128, 8364],
|
|
12
|
+
[130, 8218],
|
|
13
|
+
[131, 402],
|
|
14
|
+
[132, 8222],
|
|
15
|
+
[133, 8230],
|
|
16
|
+
[134, 8224],
|
|
17
|
+
[135, 8225],
|
|
18
|
+
[136, 710],
|
|
19
|
+
[137, 8240],
|
|
20
|
+
[138, 352],
|
|
21
|
+
[139, 8249],
|
|
22
|
+
[140, 338],
|
|
23
|
+
[142, 381],
|
|
24
|
+
[145, 8216],
|
|
25
|
+
[146, 8217],
|
|
26
|
+
[147, 8220],
|
|
27
|
+
[148, 8221],
|
|
28
|
+
[149, 8226],
|
|
29
|
+
[150, 8211],
|
|
30
|
+
[151, 8212],
|
|
31
|
+
[152, 732],
|
|
32
|
+
[153, 8482],
|
|
33
|
+
[154, 353],
|
|
34
|
+
[155, 8250],
|
|
35
|
+
[156, 339],
|
|
36
|
+
[158, 382],
|
|
37
|
+
[159, 376],
|
|
38
|
+
]);
|
|
39
|
+
/**
|
|
40
|
+
* Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point.
|
|
41
|
+
*/
|
|
42
|
+
exports.fromCodePoint =
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, n/no-unsupported-features/es-builtins
|
|
44
|
+
(_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : ((codePoint) => {
|
|
45
|
+
let output = "";
|
|
46
|
+
if (codePoint > 65535) {
|
|
47
|
+
codePoint -= 65536;
|
|
48
|
+
output += String.fromCharCode(((codePoint >>> 10) & 1023) | 55296);
|
|
49
|
+
codePoint = 56320 | (codePoint & 1023);
|
|
50
|
+
}
|
|
51
|
+
output += String.fromCharCode(codePoint);
|
|
52
|
+
return output;
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* Replace the given code point with a replacement character if it is a
|
|
56
|
+
* surrogate or is outside the valid range. Otherwise return the code
|
|
57
|
+
* point unchanged.
|
|
58
|
+
*/
|
|
59
|
+
function replaceCodePoint(codePoint) {
|
|
60
|
+
var _a;
|
|
61
|
+
if ((codePoint >= 55296 && codePoint <= 57343) ||
|
|
62
|
+
codePoint > 1114111) {
|
|
63
|
+
return 65533;
|
|
64
|
+
}
|
|
65
|
+
return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Replace the code point if relevant, then convert it to a string.
|
|
69
|
+
*
|
|
70
|
+
* @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead.
|
|
71
|
+
* @param codePoint The code point to decode.
|
|
72
|
+
* @returns The decoded code point.
|
|
73
|
+
*/
|
|
74
|
+
function decodeCodePoint(codePoint) {
|
|
75
|
+
return (0, exports.fromCodePoint)(replaceCodePoint(codePoint));
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=decode-codepoint.js.map
|