nitro-nightly 3.0.0-beta-28969273.f7aa9de6 → 4.0.0-20251010-091516-7cafddba
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/README.md +8 -39
- package/dist/_chunks/app.mjs +19797 -0
- package/dist/_chunks/build.mjs +84 -0
- package/dist/_chunks/build2.mjs +318 -0
- package/dist/_chunks/build3.mjs +6452 -0
- package/dist/_chunks/detect-acorn.mjs +503 -0
- package/dist/_chunks/index.mjs +22242 -0
- package/dist/_chunks/index2.mjs +297 -0
- package/dist/_chunks/index3.mjs +1058 -0
- package/dist/_chunks/index4.mjs +1206 -0
- package/dist/_chunks/info.mjs +11157 -0
- package/dist/_chunks/json5.mjs +68 -0
- package/dist/_chunks/jsonc.mjs +51 -0
- package/dist/_chunks/pathe.M-eThtNZ.mjs +204 -0
- package/dist/_chunks/plugin.mjs +960 -0
- package/dist/_chunks/server.mjs +254 -0
- package/dist/_chunks/snapshot.mjs +284 -0
- package/dist/_chunks/toml.mjs +259 -0
- package/dist/_chunks/yaml.mjs +86 -0
- package/dist/cli/build.mjs +10 -3
- package/dist/cli/dev.mjs +41 -9
- package/dist/cli/index.mjs +460 -1
- package/dist/cli/index2.mjs +4 -1
- package/dist/cli/list.mjs +10 -4
- package/dist/cli/prepare.mjs +6 -3
- package/dist/cli/run.mjs +7 -4
- package/dist/index.d.mts +52 -0
- package/dist/index.mjs +55 -0
- package/dist/node_modules/@poppinss/colors/build/index.js +169 -0
- package/dist/node_modules/@poppinss/colors/package.json +116 -0
- package/dist/node_modules/@poppinss/dumper/build/chunk-26HALFTP.js +602 -0
- package/dist/node_modules/@poppinss/dumper/build/formatters/console/main.js +441 -0
- package/dist/node_modules/@poppinss/dumper/build/formatters/html/main.js +717 -0
- package/dist/node_modules/@poppinss/dumper/package.json +122 -0
- package/dist/node_modules/@poppinss/exception/build/index.js +63 -0
- package/dist/node_modules/@poppinss/exception/package.json +106 -0
- package/dist/node_modules/@sindresorhus/is/distribution/index.js +1313 -0
- package/dist/node_modules/@sindresorhus/is/distribution/utilities.js +3 -0
- package/dist/node_modules/@sindresorhus/is/package.json +81 -0
- package/dist/node_modules/@speed-highlight/core/dist/index.js +4 -0
- package/dist/node_modules/@speed-highlight/core/dist/terminal.js +2 -0
- package/dist/node_modules/@speed-highlight/core/package.json +90 -0
- package/dist/node_modules/cookie/dist/index.js +239 -0
- package/dist/node_modules/cookie/package.json +42 -0
- package/dist/node_modules/croner/dist/croner.js +1 -0
- package/dist/node_modules/croner/package.json +63 -0
- package/dist/node_modules/defu/dist/defu.mjs +69 -0
- package/dist/node_modules/defu/package.json +43 -0
- package/dist/node_modules/destr/dist/index.mjs +72 -0
- package/dist/node_modules/destr/package.json +47 -0
- package/dist/node_modules/error-stack-parser-es/dist/index.mjs +38 -0
- package/dist/node_modules/error-stack-parser-es/dist/lite.mjs +167 -0
- package/dist/node_modules/error-stack-parser-es/package.json +83 -0
- package/dist/node_modules/get-port-please/dist/index.mjs +430 -0
- package/dist/node_modules/get-port-please/package.json +39 -0
- package/dist/node_modules/hookable/dist/index.mjs +290 -0
- package/dist/node_modules/hookable/package.json +49 -0
- package/dist/node_modules/kleur/index.js +110 -0
- package/dist/node_modules/kleur/index.mjs +110 -0
- package/dist/node_modules/kleur/package.json +51 -0
- package/dist/node_modules/klona/dist/index.mjs +81 -0
- package/dist/node_modules/klona/full/index.mjs +53 -0
- package/dist/node_modules/klona/package.json +74 -0
- package/dist/node_modules/scule/dist/index.mjs +80 -0
- package/dist/node_modules/scule/package.json +43 -0
- package/dist/node_modules/source-map/lib/array-set.js +100 -0
- package/dist/node_modules/source-map/lib/base64-vlq.js +94 -0
- package/dist/node_modules/source-map/lib/base64.js +19 -0
- package/dist/node_modules/source-map/lib/binary-search.js +113 -0
- package/dist/node_modules/source-map/lib/mapping-list.js +83 -0
- package/dist/node_modules/source-map/lib/mappings.wasm +0 -0
- package/dist/node_modules/source-map/lib/read-wasm.js +27 -0
- package/dist/node_modules/source-map/lib/source-map-consumer.js +1081 -0
- package/dist/node_modules/source-map/lib/source-map-generator.js +439 -0
- package/dist/node_modules/source-map/lib/source-node.js +430 -0
- package/dist/node_modules/source-map/lib/url.js +13 -0
- package/dist/node_modules/source-map/lib/util.js +444 -0
- package/dist/node_modules/source-map/lib/wasm.js +138 -0
- package/dist/node_modules/source-map/package.json +79 -0
- package/dist/node_modules/source-map/source-map.js +10 -0
- package/dist/node_modules/std-env/dist/index.mjs +1 -0
- package/dist/node_modules/std-env/package.json +46 -0
- package/dist/node_modules/supports-color/index.js +202 -0
- package/dist/node_modules/supports-color/package.json +64 -0
- package/dist/node_modules/ufo/dist/index.mjs +638 -0
- package/dist/node_modules/ufo/package.json +47 -0
- package/dist/node_modules/unctx/dist/index.mjs +131 -0
- package/dist/node_modules/unctx/package.json +67 -0
- package/dist/node_modules/youch/build/chunk-4L7RY2JA.js +42 -0
- package/dist/node_modules/youch/build/chunk-4XB2BYKC.js +85 -0
- package/dist/node_modules/youch/build/chunk-4YEN7HVQ.js +61 -0
- package/dist/node_modules/youch/build/chunk-EUJBVOYB.js +83 -0
- package/dist/node_modules/youch/build/chunk-HFSXRSKS.js +85 -0
- package/dist/node_modules/youch/build/chunk-JAN2TFI2.js +222 -0
- package/dist/node_modules/youch/build/chunk-OSUFJZHZ.js +6 -0
- package/dist/node_modules/youch/build/chunk-PINJDICN.js +72 -0
- package/dist/node_modules/youch/build/chunk-PUHGL6HA.js +41 -0
- package/dist/node_modules/youch/build/chunk-VE4LENUR.js +45 -0
- package/dist/node_modules/youch/build/index.js +352 -0
- package/dist/node_modules/youch/build/public/error_cause/style.css +5 -0
- package/dist/node_modules/youch/build/public/error_info/script.js +13 -0
- package/dist/node_modules/youch/build/public/error_info/style.css +144 -0
- package/dist/node_modules/youch/build/public/error_stack/script.js +74 -0
- package/dist/node_modules/youch/build/public/error_stack/style.css +220 -0
- package/dist/node_modules/youch/build/public/error_stack_source/style.css +123 -0
- package/dist/node_modules/youch/build/public/header/script.js +16 -0
- package/dist/node_modules/youch/build/public/header/style.css +56 -0
- package/dist/node_modules/youch/build/public/layout/script.js +20 -0
- package/dist/node_modules/youch/build/public/layout/style.css +431 -0
- package/dist/node_modules/youch/package.json +133 -0
- package/dist/node_modules/youch-core/build/index.js +316 -0
- package/dist/node_modules/youch-core/package.json +124 -0
- package/dist/presets/_nitro/runtime/nitro-dev.mjs +48 -73
- package/dist/presets/_nitro/runtime/{nitro-prerenderer.d.ts → nitro-prerenderer.d.mts} +1 -1
- package/dist/presets/_nitro/runtime/nitro-prerenderer.mjs +12 -1
- package/dist/presets/_nitro/runtime/service-worker.mjs +5 -15
- package/dist/presets/aws-amplify/runtime/aws-amplify.mjs +2 -2
- package/dist/presets/aws-lambda/runtime/_utils.d.mts +18 -0
- package/dist/presets/aws-lambda/runtime/_utils.mjs +102 -0
- package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.d.mts +3 -0
- package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.mjs +12 -32
- package/dist/presets/aws-lambda/runtime/aws-lambda.d.mts +3 -0
- package/dist/presets/aws-lambda/runtime/aws-lambda.mjs +6 -38
- package/dist/{runtime/internal/utils.azure.d.ts → presets/azure/runtime/_utils.d.mts} +1 -1
- package/dist/{runtime/internal/utils.azure.mjs → presets/azure/runtime/_utils.mjs} +3 -4
- package/dist/presets/azure/runtime/azure-swa.mjs +11 -13
- package/dist/presets/bun/runtime/bun.mjs +13 -18
- package/dist/presets/cloudflare/runtime/_module-handler.d.mts +13 -0
- package/dist/presets/cloudflare/runtime/_module-handler.mjs +93 -0
- package/dist/presets/cloudflare/runtime/cloudflare-durable.d.mts +19 -0
- package/dist/presets/cloudflare/runtime/cloudflare-durable.mjs +74 -0
- package/dist/presets/cloudflare/runtime/cloudflare-module.d.mts +9 -0
- package/dist/presets/cloudflare/runtime/cloudflare-module.mjs +13 -97
- package/dist/presets/cloudflare/runtime/{cloudflare-pages.d.ts → cloudflare-pages.d.mts} +1 -1
- package/dist/presets/cloudflare/runtime/cloudflare-pages.mjs +19 -27
- package/dist/{runtime/internal/timing.d.ts → presets/cloudflare/runtime/plugin.dev.d.mts} +1 -0
- package/dist/presets/cloudflare/runtime/plugin.dev.mjs +89 -0
- package/dist/presets/deno/runtime/deno-deploy.mjs +11 -25
- package/dist/presets/deno/runtime/deno-server.d.mts +6 -0
- package/dist/presets/deno/runtime/deno-server.mjs +15 -21
- package/dist/presets/netlify/runtime/netlify-edge.d.mts +3 -0
- package/dist/presets/netlify/runtime/netlify-edge.mjs +8 -16
- package/dist/presets/netlify/runtime/netlify.mjs +16 -45
- package/dist/presets/node/runtime/{cluster.mjs → node-cluster.mjs} +1 -3
- package/dist/presets/node/runtime/node-middleware.d.mts +4 -0
- package/dist/presets/node/runtime/{node-listener.mjs → node-middleware.mjs} +3 -4
- package/dist/presets/node/runtime/node-server.mjs +3 -4
- package/dist/presets/standard/runtime/server.d.mts +5 -0
- package/dist/presets/standard/runtime/server.mjs +6 -0
- package/dist/presets/stormkit/runtime/stormkit.mjs +8 -12
- package/dist/presets/vercel/runtime/vercel.d.mts +8 -0
- package/dist/presets/vercel/runtime/vercel.mjs +11 -11
- package/dist/presets/winterjs/runtime/winterjs.mjs +22 -4
- package/dist/presets/{node/runtime/node-server.d.ts → zeabur/runtime/zeabur.d.mts} +1 -1
- package/dist/presets/zeabur/runtime/zeabur.mjs +2 -6
- package/dist/presets.mjs +2460 -0
- package/dist/runtime/index.d.mts +11 -0
- package/dist/runtime/index.mjs +8 -8
- package/dist/runtime/internal/app.d.mts +2 -0
- package/dist/runtime/internal/app.mjs +129 -128
- package/dist/runtime/internal/cache.d.mts +7 -0
- package/dist/runtime/internal/cache.mjs +82 -175
- package/dist/runtime/internal/{context.d.ts → context.d.mts} +3 -3
- package/dist/runtime/internal/context.mjs +6 -6
- package/dist/runtime/internal/error/dev.d.mts +9 -0
- package/dist/runtime/internal/error/dev.mjs +122 -0
- package/dist/runtime/internal/error/prod.d.mts +8 -0
- package/dist/runtime/internal/error/prod.mjs +62 -0
- package/dist/runtime/internal/error/utils.d.mts +8 -0
- package/dist/runtime/internal/error/utils.mjs +3 -0
- package/dist/runtime/internal/index.d.mts +3 -0
- package/dist/runtime/internal/index.mjs +1 -14
- package/dist/runtime/internal/renderer.d.mts +3 -0
- package/dist/runtime/internal/renderer.mjs +29 -33
- package/dist/runtime/internal/route-rules.d.mts +8 -0
- package/dist/runtime/internal/route-rules.mjs +58 -63
- package/dist/runtime/internal/routes/dev-tasks.d.mts +3 -0
- package/dist/runtime/internal/routes/dev-tasks.mjs +23 -0
- package/dist/runtime/internal/routes/openapi.d.mts +3 -0
- package/dist/runtime/internal/routes/openapi.mjs +24 -9
- package/dist/runtime/internal/routes/renderer-template.d.mts +2 -0
- package/dist/runtime/internal/routes/renderer-template.dev.d.mts +3 -0
- package/dist/runtime/internal/routes/renderer-template.dev.mjs +21 -0
- package/dist/runtime/internal/routes/renderer-template.mjs +4 -0
- package/dist/runtime/internal/routes/scalar.d.mts +3 -0
- package/dist/runtime/internal/routes/scalar.mjs +7 -4
- package/dist/runtime/internal/routes/swagger.d.mts +3 -0
- package/dist/runtime/internal/routes/swagger.mjs +5 -4
- package/dist/runtime/internal/{utils.env.d.ts → runtime-config.d.mts} +4 -2
- package/dist/runtime/internal/{utils.env.mjs → runtime-config.mjs} +16 -6
- package/dist/runtime/internal/static.d.mts +3 -0
- package/dist/runtime/internal/static.mjs +24 -36
- package/dist/runtime/internal/storage.mjs +2 -1
- package/dist/runtime/internal/task.mjs +6 -6
- package/dist/runtime/internal/utils.d.mts +1 -0
- package/dist/runtime/internal/utils.mjs +1 -116
- package/dist/runtime/internal/vite/dev-entry.d.mts +1 -0
- package/dist/runtime/internal/vite/dev-entry.mjs +6 -0
- package/dist/runtime/internal/vite/dev-worker.mjs +362 -0
- package/dist/runtime/internal/vite/prod-setup.d.mts +4 -0
- package/dist/runtime/internal/vite/prod-setup.mjs +55 -0
- package/dist/runtime/internal/vite/ssr-renderer.d.mts +4 -0
- package/dist/runtime/internal/vite/ssr-renderer.mjs +4 -0
- package/dist/types/index.d.mts +2688 -138
- package/dist/vite.d.mts +59 -0
- package/dist/vite.mjs +68 -0
- package/lib/config.d.mts +9 -0
- package/lib/deps/h3.d.mts +1 -0
- package/lib/deps/h3.mjs +1 -0
- package/lib/deps/ofetch.mjs +1 -0
- package/lib/deps/ofetch.mts +1 -0
- package/lib/meta.d.mts +5 -0
- package/lib/meta.mjs +21 -0
- package/{runtime-meta.d.ts → lib/runtime-meta.d.mts} +1 -0
- package/{runtime-meta.mjs → lib/runtime-meta.mjs} +12 -4
- package/package.json +142 -160
- package/cli.d.ts +0 -1
- package/config.d.ts +0 -1
- package/core.d.ts +0 -1
- package/dist/cli/index.d.ts +0 -1
- package/dist/config/index.d.mts +0 -6
- package/dist/config/index.d.ts +0 -6
- package/dist/core/index.d.mts +0 -30
- package/dist/core/index.d.ts +0 -30
- package/dist/core/index.mjs +0 -2456
- package/dist/kit/index.d.mts +0 -44
- package/dist/kit/index.d.ts +0 -44
- package/dist/kit/index.mjs +0 -71
- package/dist/meta/index.d.mts +0 -3
- package/dist/meta/index.d.ts +0 -3
- package/dist/meta/index.mjs +0 -3
- package/dist/presets/_all.gen.d.ts +0 -2
- package/dist/presets/_all.gen.mjs +0 -52
- package/dist/presets/_nitro/base-worker.d.ts +0 -2
- package/dist/presets/_nitro/base-worker.mjs +0 -25
- package/dist/presets/_nitro/nitro-dev.d.ts +0 -2
- package/dist/presets/_nitro/nitro-dev.mjs +0 -19
- package/dist/presets/_nitro/nitro-prerender.d.ts +0 -2
- package/dist/presets/_nitro/nitro-prerender.mjs +0 -17
- package/dist/presets/_nitro/preset.d.ts +0 -2
- package/dist/presets/_nitro/preset.mjs +0 -5
- package/dist/presets/_nitro/service-worker.d.ts +0 -2
- package/dist/presets/_nitro/service-worker.mjs +0 -110
- package/dist/presets/_resolve.d.ts +0 -8
- package/dist/presets/_resolve.mjs +0 -44
- package/dist/presets/_static/preset.d.ts +0 -2
- package/dist/presets/_static/preset.mjs +0 -69
- package/dist/presets/_types.gen.d.ts +0 -16
- package/dist/presets/alwaysdata/preset.d.ts +0 -2
- package/dist/presets/alwaysdata/preset.mjs +0 -14
- package/dist/presets/aws-amplify/preset.d.ts +0 -3
- package/dist/presets/aws-amplify/preset.mjs +0 -27
- package/dist/presets/aws-amplify/types.d.ts +0 -141
- package/dist/presets/aws-amplify/utils.d.ts +0 -2
- package/dist/presets/aws-amplify/utils.mjs +0 -82
- package/dist/presets/aws-lambda/preset.d.ts +0 -2
- package/dist/presets/aws-lambda/preset.mjs +0 -21
- package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.d.ts +0 -14
- package/dist/presets/aws-lambda/runtime/aws-lambda.d.ts +0 -4
- package/dist/presets/azure/preset.d.ts +0 -3
- package/dist/presets/azure/preset.mjs +0 -44
- package/dist/presets/azure/runtime/azure-functions.mjs +0 -24
- package/dist/presets/azure/runtime/azure-swa.d.ts +0 -5
- package/dist/presets/azure/types.d.ts +0 -13
- package/dist/presets/azure/types.mjs +0 -0
- package/dist/presets/azure/utils.d.ts +0 -3
- package/dist/presets/azure/utils.mjs +0 -183
- package/dist/presets/bun/preset.d.ts +0 -2
- package/dist/presets/bun/preset.mjs +0 -17
- package/dist/presets/cleavr/preset.d.ts +0 -2
- package/dist/presets/cleavr/preset.mjs +0 -12
- package/dist/presets/cloudflare/preset.d.ts +0 -3
- package/dist/presets/cloudflare/preset.mjs +0 -145
- package/dist/presets/cloudflare/runtime/cloudflare-module.d.ts +0 -13
- package/dist/presets/cloudflare/runtime/cloudflare-worker.mjs +0 -64
- package/dist/presets/cloudflare/types.d.ts +0 -89
- package/dist/presets/cloudflare/types.mjs +0 -0
- package/dist/presets/cloudflare/types.wrangler.d.ts +0 -974
- package/dist/presets/cloudflare/types.wrangler.mjs +0 -0
- package/dist/presets/cloudflare/utils.d.ts +0 -3
- package/dist/presets/cloudflare/utils.mjs +0 -163
- package/dist/presets/deno/preset.d.ts +0 -2
- package/dist/presets/deno/preset.mjs +0 -148
- package/dist/presets/deno/runtime/_deno-env-polyfill.d.ts +0 -0
- package/dist/presets/deno/runtime/_deno-env-polyfill.mjs +0 -1
- package/dist/presets/digitalocean/preset.d.ts +0 -2
- package/dist/presets/digitalocean/preset.mjs +0 -11
- package/dist/presets/edgio/preset.d.ts +0 -2
- package/dist/presets/edgio/preset.mjs +0 -95
- package/dist/presets/firebase/preset.d.ts +0 -3
- package/dist/presets/firebase/preset.mjs +0 -50
- package/dist/presets/firebase/runtime/firebase-gen-1.d.ts +0 -2
- package/dist/presets/firebase/runtime/firebase-gen-1.mjs +0 -7
- package/dist/presets/firebase/runtime/firebase-gen-2.d.ts +0 -2
- package/dist/presets/firebase/runtime/firebase-gen-2.mjs +0 -14
- package/dist/presets/firebase/runtime/firebase-gen-default.d.ts +0 -1
- package/dist/presets/firebase/runtime/firebase-gen-default.mjs +0 -1
- package/dist/presets/firebase/types.d.ts +0 -38
- package/dist/presets/firebase/types.mjs +0 -0
- package/dist/presets/firebase/utils.d.ts +0 -3
- package/dist/presets/firebase/utils.mjs +0 -50
- package/dist/presets/flightcontrol/preset.d.ts +0 -2
- package/dist/presets/flightcontrol/preset.mjs +0 -11
- package/dist/presets/heroku/preset.d.ts +0 -2
- package/dist/presets/heroku/preset.mjs +0 -11
- package/dist/presets/iis/preset.d.ts +0 -2
- package/dist/presets/iis/preset.mjs +0 -32
- package/dist/presets/iis/utils.d.ts +0 -3
- package/dist/presets/iis/utils.mjs +0 -161
- package/dist/presets/index.d.mts +0 -1
- package/dist/presets/index.d.ts +0 -2
- package/dist/presets/index.mjs +0 -1
- package/dist/presets/koyeb/preset.d.ts +0 -2
- package/dist/presets/koyeb/preset.mjs +0 -11
- package/dist/presets/netlify/legacy/preset.d.ts +0 -2
- package/dist/presets/netlify/legacy/preset.mjs +0 -143
- package/dist/presets/netlify/legacy/runtime/_deno-env-polyfill.d.ts +0 -0
- package/dist/presets/netlify/legacy/runtime/_deno-env-polyfill.mjs +0 -1
- package/dist/presets/netlify/legacy/runtime/netlify-builder.d.ts +0 -3
- package/dist/presets/netlify/legacy/runtime/netlify-builder.mjs +0 -5
- package/dist/presets/netlify/legacy/runtime/netlify-edge.d.ts +0 -2
- package/dist/presets/netlify/legacy/runtime/netlify-edge.mjs +0 -25
- package/dist/presets/netlify/legacy/runtime/netlify-lambda.d.ts +0 -3
- package/dist/presets/netlify/legacy/runtime/netlify-lambda.mjs +0 -38
- package/dist/presets/netlify/legacy/runtime/netlify.d.ts +0 -4
- package/dist/presets/netlify/legacy/runtime/netlify.mjs +0 -22
- package/dist/presets/netlify/legacy/utils.d.ts +0 -4
- package/dist/presets/netlify/legacy/utils.mjs +0 -113
- package/dist/presets/netlify/preset.d.ts +0 -3
- package/dist/presets/netlify/preset.mjs +0 -128
- package/dist/presets/netlify/runtime/_deno-env-polyfill.d.ts +0 -0
- package/dist/presets/netlify/runtime/_deno-env-polyfill.mjs +0 -1
- package/dist/presets/netlify/runtime/netlify-edge.d.ts +0 -2
- package/dist/presets/netlify/types.d.ts +0 -12
- package/dist/presets/netlify/types.mjs +0 -0
- package/dist/presets/netlify/utils.d.ts +0 -5
- package/dist/presets/netlify/utils.mjs +0 -94
- package/dist/presets/node/preset.d.ts +0 -2
- package/dist/presets/node/preset.mjs +0 -49
- package/dist/presets/node/runtime/cli.d.ts +0 -1
- package/dist/presets/node/runtime/cli.mjs +0 -22
- package/dist/presets/node/runtime/node-listener.d.ts +0 -6
- package/dist/presets/platform.sh/preset.d.ts +0 -2
- package/dist/presets/platform.sh/preset.mjs +0 -11
- package/dist/presets/render.com/preset.d.ts +0 -2
- package/dist/presets/render.com/preset.mjs +0 -11
- package/dist/presets/stormkit/preset.d.ts +0 -2
- package/dist/presets/stormkit/preset.mjs +0 -15
- package/dist/presets/vercel/preset.d.ts +0 -3
- package/dist/presets/vercel/preset.mjs +0 -104
- package/dist/presets/vercel/runtime/vercel-edge.d.ts +0 -2
- package/dist/presets/vercel/runtime/vercel-edge.mjs +0 -22
- package/dist/presets/vercel/runtime/vercel.d.ts +0 -4
- package/dist/presets/vercel/types.d.ts +0 -78
- package/dist/presets/vercel/types.mjs +0 -0
- package/dist/presets/vercel/utils.d.ts +0 -5
- package/dist/presets/vercel/utils.mjs +0 -186
- package/dist/presets/winterjs/preset.d.ts +0 -2
- package/dist/presets/winterjs/preset.mjs +0 -20
- package/dist/presets/winterjs/runtime/winterjs.d.ts +0 -1
- package/dist/presets/zeabur/preset.d.ts +0 -2
- package/dist/presets/zeabur/preset.mjs +0 -70
- package/dist/presets/zeabur/runtime/zeabur.d.ts +0 -4
- package/dist/rollup/index.d.mts +0 -5
- package/dist/rollup/index.d.ts +0 -5
- package/dist/rollup/index.mjs +0 -1673
- package/dist/runtime/index.d.ts +0 -12
- package/dist/runtime/internal/app.d.ts +0 -3
- package/dist/runtime/internal/cache.d.ts +0 -8
- package/dist/runtime/internal/client.mjs +0 -4
- package/dist/runtime/internal/config.d.ts +0 -5
- package/dist/runtime/internal/config.mjs +0 -45
- package/dist/runtime/internal/error.d.ts +0 -4
- package/dist/runtime/internal/error.mjs +0 -73
- package/dist/runtime/internal/index.d.ts +0 -6
- package/dist/runtime/internal/renderer.d.ts +0 -2
- package/dist/runtime/internal/route-rules.d.ts +0 -14
- package/dist/runtime/internal/routes/openapi.d.ts +0 -3
- package/dist/runtime/internal/routes/scalar.d.ts +0 -2
- package/dist/runtime/internal/routes/swagger.d.ts +0 -2
- package/dist/runtime/internal/static.d.ts +0 -2
- package/dist/runtime/internal/timing.mjs +0 -29
- package/dist/runtime/internal/utils.d.ts +0 -21
- package/dist/runtime/internal/utils.lambda.d.ts +0 -10
- package/dist/runtime/internal/utils.lambda.mjs +0 -30
- package/dist/shared/nitro.bra5i6ER.d.mts +0 -620
- package/dist/shared/nitro.bra5i6ER.d.ts +0 -620
- package/dist/types/index.d.ts +0 -260
- package/kit.d.ts +0 -1
- package/meta.d.ts +0 -1
- package/presets.d.ts +0 -1
- package/rollup.d.ts +0 -1
- package/runtime.d.ts +0 -1
- package/types.d.ts +0 -1
- /package/dist/presets/_nitro/runtime/{nitro-dev.d.ts → nitro-dev.d.mts} +0 -0
- /package/dist/presets/_nitro/runtime/{service-worker.d.ts → service-worker.d.mts} +0 -0
- /package/dist/presets/aws-amplify/runtime/{aws-amplify.d.ts → aws-amplify.d.mts} +0 -0
- /package/dist/presets/azure/runtime/{azure-functions.d.ts → azure-swa.d.mts} +0 -0
- /package/dist/presets/bun/runtime/{bun.d.ts → bun.d.mts} +0 -0
- /package/dist/presets/{cloudflare/runtime/cloudflare-worker.d.ts → deno/runtime/deno-deploy.d.mts} +0 -0
- /package/dist/presets/netlify/runtime/{netlify.d.ts → netlify.d.mts} +0 -0
- /package/dist/presets/node/runtime/{cluster.d.ts → node-cluster.d.mts} +0 -0
- /package/dist/presets/{deno/runtime/deno-server.d.ts → node/runtime/node-server.d.mts} +0 -0
- /package/dist/presets/stormkit/runtime/{stormkit.d.ts → stormkit.d.mts} +0 -0
- /package/dist/presets/{deno/runtime/deno-deploy.d.ts → winterjs/runtime/winterjs.d.mts} +0 -0
- /package/dist/runtime/internal/{database.d.ts → database.d.mts} +0 -0
- /package/dist/runtime/internal/{debug.d.ts → debug.d.mts} +0 -0
- /package/dist/{presets/_types.gen.mjs → runtime/internal/empty.d.mts} +0 -0
- /package/dist/{presets/aws-amplify/types.mjs → runtime/internal/empty.mjs} +0 -0
- /package/dist/runtime/internal/lib/{http-graceful-shutdown.d.ts → http-graceful-shutdown.d.mts} +0 -0
- /package/dist/runtime/internal/{meta.d.ts → meta.d.mts} +0 -0
- /package/dist/runtime/internal/{plugin.d.ts → plugin.d.mts} +0 -0
- /package/dist/runtime/internal/{shutdown.d.ts → shutdown.d.mts} +0 -0
- /package/dist/runtime/internal/{storage.d.ts → storage.d.mts} +0 -0
- /package/dist/runtime/internal/{task.d.ts → task.d.mts} +0 -0
- /package/dist/runtime/internal/{client.d.ts → vite/dev-worker.d.mts} +0 -0
- /package/{dist/config/index.mjs → lib/config.mjs} +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
function set(obj, key, val) {
|
|
2
|
+
if (typeof val.value === 'object') val.value = klona(val.value);
|
|
3
|
+
if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === '__proto__') {
|
|
4
|
+
Object.defineProperty(obj, key, val);
|
|
5
|
+
} else obj[key] = val.value;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function klona(x) {
|
|
9
|
+
if (typeof x !== 'object') return x;
|
|
10
|
+
|
|
11
|
+
var i=0, k, list, tmp, str=Object.prototype.toString.call(x);
|
|
12
|
+
|
|
13
|
+
if (str === '[object Object]') {
|
|
14
|
+
tmp = Object.create(x.__proto__ || null);
|
|
15
|
+
} else if (str === '[object Array]') {
|
|
16
|
+
tmp = Array(x.length);
|
|
17
|
+
} else if (str === '[object Set]') {
|
|
18
|
+
tmp = new Set;
|
|
19
|
+
x.forEach(function (val) {
|
|
20
|
+
tmp.add(klona(val));
|
|
21
|
+
});
|
|
22
|
+
} else if (str === '[object Map]') {
|
|
23
|
+
tmp = new Map;
|
|
24
|
+
x.forEach(function (val, key) {
|
|
25
|
+
tmp.set(klona(key), klona(val));
|
|
26
|
+
});
|
|
27
|
+
} else if (str === '[object Date]') {
|
|
28
|
+
tmp = new Date(+x);
|
|
29
|
+
} else if (str === '[object RegExp]') {
|
|
30
|
+
tmp = new RegExp(x.source, x.flags);
|
|
31
|
+
} else if (str === '[object DataView]') {
|
|
32
|
+
tmp = new x.constructor( klona(x.buffer) );
|
|
33
|
+
} else if (str === '[object ArrayBuffer]') {
|
|
34
|
+
tmp = x.slice(0);
|
|
35
|
+
} else if (str.slice(-6) === 'Array]') {
|
|
36
|
+
// ArrayBuffer.isView(x)
|
|
37
|
+
// ~> `new` bcuz `Buffer.slice` => ref
|
|
38
|
+
tmp = new x.constructor(x);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (tmp) {
|
|
42
|
+
for (list=Object.getOwnPropertySymbols(x); i < list.length; i++) {
|
|
43
|
+
set(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
for (i=0, list=Object.getOwnPropertyNames(x); i < list.length; i++) {
|
|
47
|
+
if (Object.hasOwnProperty.call(tmp, k=list[i]) && tmp[k] === x[k]) continue;
|
|
48
|
+
set(tmp, k, Object.getOwnPropertyDescriptor(x, k));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return tmp || x;
|
|
53
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "klona",
|
|
3
|
+
"version": "2.0.6",
|
|
4
|
+
"repository": "lukeed/klona",
|
|
5
|
+
"description": "A tiny (240B to 501B) and fast utility to \"deep clone\" Objects, Arrays, Dates, RegExps, and more!",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"unpkg": "dist/index.min.js",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"types": "index.d.ts",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"author": {
|
|
12
|
+
"name": "Luke Edwards",
|
|
13
|
+
"email": "luke.edwards05@gmail.com",
|
|
14
|
+
"url": "https://lukeed.com"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"*.d.ts",
|
|
18
|
+
"dist",
|
|
19
|
+
"full",
|
|
20
|
+
"json",
|
|
21
|
+
"lite"
|
|
22
|
+
],
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./index.d.ts",
|
|
26
|
+
"import": "./dist/index.mjs",
|
|
27
|
+
"require": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./json": {
|
|
30
|
+
"types": "./index.d.ts",
|
|
31
|
+
"import": "./json/index.mjs",
|
|
32
|
+
"require": "./json/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./lite": {
|
|
35
|
+
"types": "./index.d.ts",
|
|
36
|
+
"import": "./lite/index.mjs",
|
|
37
|
+
"require": "./lite/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./full": {
|
|
40
|
+
"types": "./index.d.ts",
|
|
41
|
+
"import": "./full/index.mjs",
|
|
42
|
+
"require": "./full/index.js"
|
|
43
|
+
},
|
|
44
|
+
"./package.json": "./package.json"
|
|
45
|
+
},
|
|
46
|
+
"modes": {
|
|
47
|
+
"json": "src/json.js",
|
|
48
|
+
"lite": "src/lite.js",
|
|
49
|
+
"default": "src/index.js",
|
|
50
|
+
"full": "src/full.js"
|
|
51
|
+
},
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">= 8"
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "bundt",
|
|
57
|
+
"pretest": "npm run build",
|
|
58
|
+
"postbuild": "echo \"lite full json\" | xargs -n1 cp -v index.d.ts",
|
|
59
|
+
"test": "uvu -r esm test -i suites"
|
|
60
|
+
},
|
|
61
|
+
"keywords": [
|
|
62
|
+
"clone",
|
|
63
|
+
"copy",
|
|
64
|
+
"deep",
|
|
65
|
+
"extend",
|
|
66
|
+
"recursive",
|
|
67
|
+
"object"
|
|
68
|
+
],
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"bundt": "1.0.2",
|
|
71
|
+
"esm": "3.2.25",
|
|
72
|
+
"uvu": "0.5.2"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
const NUMBER_CHAR_RE = /\d/;
|
|
2
|
+
const STR_SPLITTERS = ["-", "_", "/", "."];
|
|
3
|
+
function isUppercase(char = "") {
|
|
4
|
+
if (NUMBER_CHAR_RE.test(char)) {
|
|
5
|
+
return void 0;
|
|
6
|
+
}
|
|
7
|
+
return char !== char.toLowerCase();
|
|
8
|
+
}
|
|
9
|
+
function splitByCase(str, separators) {
|
|
10
|
+
const splitters = separators ?? STR_SPLITTERS;
|
|
11
|
+
const parts = [];
|
|
12
|
+
if (!str || typeof str !== "string") {
|
|
13
|
+
return parts;
|
|
14
|
+
}
|
|
15
|
+
let buff = "";
|
|
16
|
+
let previousUpper;
|
|
17
|
+
let previousSplitter;
|
|
18
|
+
for (const char of str) {
|
|
19
|
+
const isSplitter = splitters.includes(char);
|
|
20
|
+
if (isSplitter === true) {
|
|
21
|
+
parts.push(buff);
|
|
22
|
+
buff = "";
|
|
23
|
+
previousUpper = void 0;
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
const isUpper = isUppercase(char);
|
|
27
|
+
if (previousSplitter === false) {
|
|
28
|
+
if (previousUpper === false && isUpper === true) {
|
|
29
|
+
parts.push(buff);
|
|
30
|
+
buff = char;
|
|
31
|
+
previousUpper = isUpper;
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (previousUpper === true && isUpper === false && buff.length > 1) {
|
|
35
|
+
const lastChar = buff.at(-1);
|
|
36
|
+
parts.push(buff.slice(0, Math.max(0, buff.length - 1)));
|
|
37
|
+
buff = lastChar + char;
|
|
38
|
+
previousUpper = isUpper;
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
buff += char;
|
|
43
|
+
previousUpper = isUpper;
|
|
44
|
+
previousSplitter = isSplitter;
|
|
45
|
+
}
|
|
46
|
+
parts.push(buff);
|
|
47
|
+
return parts;
|
|
48
|
+
}
|
|
49
|
+
function upperFirst(str) {
|
|
50
|
+
return str ? str[0].toUpperCase() + str.slice(1) : "";
|
|
51
|
+
}
|
|
52
|
+
function lowerFirst(str) {
|
|
53
|
+
return str ? str[0].toLowerCase() + str.slice(1) : "";
|
|
54
|
+
}
|
|
55
|
+
function pascalCase(str, opts) {
|
|
56
|
+
return str ? (Array.isArray(str) ? str : splitByCase(str)).map((p) => upperFirst(opts?.normalize ? p.toLowerCase() : p)).join("") : "";
|
|
57
|
+
}
|
|
58
|
+
function camelCase(str, opts) {
|
|
59
|
+
return lowerFirst(pascalCase(str || "", opts));
|
|
60
|
+
}
|
|
61
|
+
function kebabCase(str, joiner) {
|
|
62
|
+
return str ? (Array.isArray(str) ? str : splitByCase(str)).map((p) => p.toLowerCase()).join(joiner ?? "-") : "";
|
|
63
|
+
}
|
|
64
|
+
function snakeCase(str) {
|
|
65
|
+
return kebabCase(str || "", "_");
|
|
66
|
+
}
|
|
67
|
+
function flatCase(str) {
|
|
68
|
+
return kebabCase(str || "", "");
|
|
69
|
+
}
|
|
70
|
+
function trainCase(str, opts) {
|
|
71
|
+
return (Array.isArray(str) ? str : splitByCase(str)).filter(Boolean).map((p) => upperFirst(opts?.normalize ? p.toLowerCase() : p)).join("-");
|
|
72
|
+
}
|
|
73
|
+
const titleCaseExceptions = /^(a|an|and|as|at|but|by|for|if|in|is|nor|of|on|or|the|to|with)$/i;
|
|
74
|
+
function titleCase(str, opts) {
|
|
75
|
+
return (Array.isArray(str) ? str : splitByCase(str)).filter(Boolean).map(
|
|
76
|
+
(p) => titleCaseExceptions.test(p) ? p.toLowerCase() : upperFirst(opts?.normalize ? p.toLowerCase() : p)
|
|
77
|
+
).join(" ");
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { camelCase, flatCase, isUppercase, kebabCase, lowerFirst, pascalCase, snakeCase, splitByCase, titleCase, trainCase, upperFirst };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "scule",
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "String case utils",
|
|
5
|
+
"repository": "unjs/scule",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"require": "./dist/index.cjs",
|
|
12
|
+
"import": "./dist/index.mjs"
|
|
13
|
+
},
|
|
14
|
+
"./*": "./*"
|
|
15
|
+
},
|
|
16
|
+
"main": "./dist/index.cjs",
|
|
17
|
+
"module": "./dist/index.mjs",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "unbuild",
|
|
24
|
+
"dev": "vitest dev --typecheck",
|
|
25
|
+
"lint": "eslint --cache --ext .ts,.js,.mjs,.cjs . && prettier -c src test",
|
|
26
|
+
"lint:fix": "eslint --cache --ext .ts,.js,.mjs,.cjs . --fix && prettier -c src test -w",
|
|
27
|
+
"prepack": "pnpm run build",
|
|
28
|
+
"release": "pnpm test && changelogen --release --push && npm publish",
|
|
29
|
+
"test": "pnpm lint && vitest run --typecheck --coverage"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "^20.11.3",
|
|
33
|
+
"@vitest/coverage-v8": "^1.2.0",
|
|
34
|
+
"changelogen": "^0.5.5",
|
|
35
|
+
"eslint": "^8.56.0",
|
|
36
|
+
"eslint-config-unjs": "^0.2.1",
|
|
37
|
+
"prettier": "^3.2.2",
|
|
38
|
+
"typescript": "^5.3.3",
|
|
39
|
+
"unbuild": "^2.0.0",
|
|
40
|
+
"vitest": "^1.2.0"
|
|
41
|
+
},
|
|
42
|
+
"packageManager": "pnpm@8.14.1"
|
|
43
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/* -*- Mode: js; js-indent-level: 2; -*- */
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2011 Mozilla Foundation and contributors
|
|
4
|
+
* Licensed under the New BSD license. See LICENSE or:
|
|
5
|
+
* http://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A data structure which is a combination of an array and a set. Adding a new
|
|
10
|
+
* member is O(1), testing for membership is O(1), and finding the index of an
|
|
11
|
+
* element is O(1). Removing elements from the set is not supported. Only
|
|
12
|
+
* strings are supported for membership.
|
|
13
|
+
*/
|
|
14
|
+
class ArraySet {
|
|
15
|
+
constructor() {
|
|
16
|
+
this._array = [];
|
|
17
|
+
this._set = new Map();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Static method for creating ArraySet instances from an existing array.
|
|
22
|
+
*/
|
|
23
|
+
static fromArray(aArray, aAllowDuplicates) {
|
|
24
|
+
const set = new ArraySet();
|
|
25
|
+
for (let i = 0, len = aArray.length; i < len; i++) {
|
|
26
|
+
set.add(aArray[i], aAllowDuplicates);
|
|
27
|
+
}
|
|
28
|
+
return set;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Return how many unique items are in this ArraySet. If duplicates have been
|
|
33
|
+
* added, than those do not count towards the size.
|
|
34
|
+
*
|
|
35
|
+
* @returns Number
|
|
36
|
+
*/
|
|
37
|
+
size() {
|
|
38
|
+
return this._set.size;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Add the given string to this set.
|
|
43
|
+
*
|
|
44
|
+
* @param String aStr
|
|
45
|
+
*/
|
|
46
|
+
add(aStr, aAllowDuplicates) {
|
|
47
|
+
const isDuplicate = this.has(aStr);
|
|
48
|
+
const idx = this._array.length;
|
|
49
|
+
if (!isDuplicate || aAllowDuplicates) {
|
|
50
|
+
this._array.push(aStr);
|
|
51
|
+
}
|
|
52
|
+
if (!isDuplicate) {
|
|
53
|
+
this._set.set(aStr, idx);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Is the given string a member of this set?
|
|
59
|
+
*
|
|
60
|
+
* @param String aStr
|
|
61
|
+
*/
|
|
62
|
+
has(aStr) {
|
|
63
|
+
return this._set.has(aStr);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* What is the index of the given string in the array?
|
|
68
|
+
*
|
|
69
|
+
* @param String aStr
|
|
70
|
+
*/
|
|
71
|
+
indexOf(aStr) {
|
|
72
|
+
const idx = this._set.get(aStr);
|
|
73
|
+
if (idx >= 0) {
|
|
74
|
+
return idx;
|
|
75
|
+
}
|
|
76
|
+
throw new Error('"' + aStr + '" is not in the set.');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* What is the element at the given index?
|
|
81
|
+
*
|
|
82
|
+
* @param Number aIdx
|
|
83
|
+
*/
|
|
84
|
+
at(aIdx) {
|
|
85
|
+
if (aIdx >= 0 && aIdx < this._array.length) {
|
|
86
|
+
return this._array[aIdx];
|
|
87
|
+
}
|
|
88
|
+
throw new Error("No element indexed by " + aIdx);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Returns the array representation of this set (which has the proper indices
|
|
93
|
+
* indicated by indexOf). Note that this is a copy of the internal array used
|
|
94
|
+
* for storing the members so that no one can mess with internal state.
|
|
95
|
+
*/
|
|
96
|
+
toArray() {
|
|
97
|
+
return this._array.slice();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.ArraySet = ArraySet;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/* -*- Mode: js; js-indent-level: 2; -*- */
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2011 Mozilla Foundation and contributors
|
|
4
|
+
* Licensed under the New BSD license. See LICENSE or:
|
|
5
|
+
* http://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*
|
|
7
|
+
* Based on the Base 64 VLQ implementation in Closure Compiler:
|
|
8
|
+
* https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
|
|
9
|
+
*
|
|
10
|
+
* Copyright 2011 The Closure Compiler Authors. All rights reserved.
|
|
11
|
+
* Redistribution and use in source and binary forms, with or without
|
|
12
|
+
* modification, are permitted provided that the following conditions are
|
|
13
|
+
* met:
|
|
14
|
+
*
|
|
15
|
+
* * Redistributions of source code must retain the above copyright
|
|
16
|
+
* notice, this list of conditions and the following disclaimer.
|
|
17
|
+
* * Redistributions in binary form must reproduce the above
|
|
18
|
+
* copyright notice, this list of conditions and the following
|
|
19
|
+
* disclaimer in the documentation and/or other materials provided
|
|
20
|
+
* with the distribution.
|
|
21
|
+
* * Neither the name of Google Inc. nor the names of its
|
|
22
|
+
* contributors may be used to endorse or promote products derived
|
|
23
|
+
* from this software without specific prior written permission.
|
|
24
|
+
*
|
|
25
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
26
|
+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
27
|
+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
28
|
+
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
29
|
+
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
30
|
+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
31
|
+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
32
|
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
33
|
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
34
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
35
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
const base64 = require("./base64");
|
|
39
|
+
|
|
40
|
+
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
|
|
41
|
+
// length quantities we use in the source map spec, the first bit is the sign,
|
|
42
|
+
// the next four bits are the actual value, and the 6th bit is the
|
|
43
|
+
// continuation bit. The continuation bit tells us whether there are more
|
|
44
|
+
// digits in this value following this digit.
|
|
45
|
+
//
|
|
46
|
+
// Continuation
|
|
47
|
+
// | Sign
|
|
48
|
+
// | |
|
|
49
|
+
// V V
|
|
50
|
+
// 101011
|
|
51
|
+
|
|
52
|
+
const VLQ_BASE_SHIFT = 5;
|
|
53
|
+
|
|
54
|
+
// binary: 100000
|
|
55
|
+
const VLQ_BASE = 1 << VLQ_BASE_SHIFT;
|
|
56
|
+
|
|
57
|
+
// binary: 011111
|
|
58
|
+
const VLQ_BASE_MASK = VLQ_BASE - 1;
|
|
59
|
+
|
|
60
|
+
// binary: 100000
|
|
61
|
+
const VLQ_CONTINUATION_BIT = VLQ_BASE;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Converts from a two-complement value to a value where the sign bit is
|
|
65
|
+
* placed in the least significant bit. For example, as decimals:
|
|
66
|
+
* 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
|
|
67
|
+
* 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
|
|
68
|
+
*/
|
|
69
|
+
function toVLQSigned(aValue) {
|
|
70
|
+
return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Returns the base 64 VLQ encoded value.
|
|
75
|
+
*/
|
|
76
|
+
exports.encode = function base64VLQ_encode(aValue) {
|
|
77
|
+
let encoded = "";
|
|
78
|
+
let digit;
|
|
79
|
+
|
|
80
|
+
let vlq = toVLQSigned(aValue);
|
|
81
|
+
|
|
82
|
+
do {
|
|
83
|
+
digit = vlq & VLQ_BASE_MASK;
|
|
84
|
+
vlq >>>= VLQ_BASE_SHIFT;
|
|
85
|
+
if (vlq > 0) {
|
|
86
|
+
// There are still more digits in this value, so we must make sure the
|
|
87
|
+
// continuation bit is marked.
|
|
88
|
+
digit |= VLQ_CONTINUATION_BIT;
|
|
89
|
+
}
|
|
90
|
+
encoded += base64.encode(digit);
|
|
91
|
+
} while (vlq > 0);
|
|
92
|
+
|
|
93
|
+
return encoded;
|
|
94
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* -*- Mode: js; js-indent-level: 2; -*- */
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2011 Mozilla Foundation and contributors
|
|
4
|
+
* Licensed under the New BSD license. See LICENSE or:
|
|
5
|
+
* http://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const intToCharMap =
|
|
9
|
+
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Encode an integer in the range of 0 to 63 to a single base 64 digit.
|
|
13
|
+
*/
|
|
14
|
+
exports.encode = function (number) {
|
|
15
|
+
if (0 <= number && number < intToCharMap.length) {
|
|
16
|
+
return intToCharMap[number];
|
|
17
|
+
}
|
|
18
|
+
throw new TypeError("Must be between 0 and 63: " + number);
|
|
19
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/* -*- Mode: js; js-indent-level: 2; -*- */
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2011 Mozilla Foundation and contributors
|
|
4
|
+
* Licensed under the New BSD license. See LICENSE or:
|
|
5
|
+
* http://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
exports.GREATEST_LOWER_BOUND = 1;
|
|
9
|
+
exports.LEAST_UPPER_BOUND = 2;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Recursive implementation of binary search.
|
|
13
|
+
*
|
|
14
|
+
* @param aLow Indices here and lower do not contain the needle.
|
|
15
|
+
* @param aHigh Indices here and higher do not contain the needle.
|
|
16
|
+
* @param aNeedle The element being searched for.
|
|
17
|
+
* @param aHaystack The non-empty array being searched.
|
|
18
|
+
* @param aCompare Function which takes two elements and returns -1, 0, or 1.
|
|
19
|
+
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
|
|
20
|
+
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
|
|
21
|
+
* closest element that is smaller than or greater than the one we are
|
|
22
|
+
* searching for, respectively, if the exact element cannot be found.
|
|
23
|
+
*/
|
|
24
|
+
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
|
|
25
|
+
// This function terminates when one of the following is true:
|
|
26
|
+
//
|
|
27
|
+
// 1. We find the exact element we are looking for.
|
|
28
|
+
//
|
|
29
|
+
// 2. We did not find the exact element, but we can return the index of
|
|
30
|
+
// the next-closest element.
|
|
31
|
+
//
|
|
32
|
+
// 3. We did not find the exact element, and there is no next-closest
|
|
33
|
+
// element than the one we are searching for, so we return -1.
|
|
34
|
+
const mid = Math.floor((aHigh - aLow) / 2) + aLow;
|
|
35
|
+
const cmp = aCompare(aNeedle, aHaystack[mid], true);
|
|
36
|
+
if (cmp === 0) {
|
|
37
|
+
// Found the element we are looking for.
|
|
38
|
+
return mid;
|
|
39
|
+
} else if (cmp > 0) {
|
|
40
|
+
// Our needle is greater than aHaystack[mid].
|
|
41
|
+
if (aHigh - mid > 1) {
|
|
42
|
+
// The element is in the upper half.
|
|
43
|
+
return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// The exact needle element was not found in this haystack. Determine if
|
|
47
|
+
// we are in termination case (3) or (2) and return the appropriate thing.
|
|
48
|
+
if (aBias === exports.LEAST_UPPER_BOUND) {
|
|
49
|
+
return aHigh < aHaystack.length ? aHigh : -1;
|
|
50
|
+
}
|
|
51
|
+
return mid;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Our needle is less than aHaystack[mid].
|
|
55
|
+
if (mid - aLow > 1) {
|
|
56
|
+
// The element is in the lower half.
|
|
57
|
+
return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// we are in termination case (3) or (2) and return the appropriate thing.
|
|
61
|
+
if (aBias == exports.LEAST_UPPER_BOUND) {
|
|
62
|
+
return mid;
|
|
63
|
+
}
|
|
64
|
+
return aLow < 0 ? -1 : aLow;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* This is an implementation of binary search which will always try and return
|
|
69
|
+
* the index of the closest element if there is no exact hit. This is because
|
|
70
|
+
* mappings between original and generated line/col pairs are single points,
|
|
71
|
+
* and there is an implicit region between each of them, so a miss just means
|
|
72
|
+
* that you aren't on the very start of a region.
|
|
73
|
+
*
|
|
74
|
+
* @param aNeedle The element you are looking for.
|
|
75
|
+
* @param aHaystack The array that is being searched.
|
|
76
|
+
* @param aCompare A function which takes the needle and an element in the
|
|
77
|
+
* array and returns -1, 0, or 1 depending on whether the needle is less
|
|
78
|
+
* than, equal to, or greater than the element, respectively.
|
|
79
|
+
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
|
|
80
|
+
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
|
|
81
|
+
* closest element that is smaller than or greater than the one we are
|
|
82
|
+
* searching for, respectively, if the exact element cannot be found.
|
|
83
|
+
* Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
|
|
84
|
+
*/
|
|
85
|
+
exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
|
|
86
|
+
if (aHaystack.length === 0) {
|
|
87
|
+
return -1;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
let index = recursiveSearch(
|
|
91
|
+
-1,
|
|
92
|
+
aHaystack.length,
|
|
93
|
+
aNeedle,
|
|
94
|
+
aHaystack,
|
|
95
|
+
aCompare,
|
|
96
|
+
aBias || exports.GREATEST_LOWER_BOUND
|
|
97
|
+
);
|
|
98
|
+
if (index < 0) {
|
|
99
|
+
return -1;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// We have found either the exact element, or the next-closest element to
|
|
103
|
+
// the one we are searching for. However, there may be more than one such
|
|
104
|
+
// element. Make sure we always return the smallest of these.
|
|
105
|
+
while (index - 1 >= 0) {
|
|
106
|
+
if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
--index;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return index;
|
|
113
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* -*- Mode: js; js-indent-level: 2; -*- */
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2014 Mozilla Foundation and contributors
|
|
4
|
+
* Licensed under the New BSD license. See LICENSE or:
|
|
5
|
+
* http://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const util = require("./util");
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Determine whether mappingB is after mappingA with respect to generated
|
|
12
|
+
* position.
|
|
13
|
+
*/
|
|
14
|
+
function generatedPositionAfter(mappingA, mappingB) {
|
|
15
|
+
// Optimized for most common case
|
|
16
|
+
const lineA = mappingA.generatedLine;
|
|
17
|
+
const lineB = mappingB.generatedLine;
|
|
18
|
+
const columnA = mappingA.generatedColumn;
|
|
19
|
+
const columnB = mappingB.generatedColumn;
|
|
20
|
+
return (
|
|
21
|
+
lineB > lineA ||
|
|
22
|
+
(lineB == lineA && columnB >= columnA) ||
|
|
23
|
+
util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A data structure to provide a sorted view of accumulated mappings in a
|
|
29
|
+
* performance conscious manner. It trades a negligible overhead in general
|
|
30
|
+
* case for a large speedup in case of mappings being added in order.
|
|
31
|
+
*/
|
|
32
|
+
class MappingList {
|
|
33
|
+
constructor() {
|
|
34
|
+
this._array = [];
|
|
35
|
+
this._sorted = true;
|
|
36
|
+
// Serves as infimum
|
|
37
|
+
this._last = { generatedLine: -1, generatedColumn: 0 };
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Iterate through internal items. This method takes the same arguments that
|
|
42
|
+
* `Array.prototype.forEach` takes.
|
|
43
|
+
*
|
|
44
|
+
* NOTE: The order of the mappings is NOT guaranteed.
|
|
45
|
+
*/
|
|
46
|
+
unsortedForEach(aCallback, aThisArg) {
|
|
47
|
+
this._array.forEach(aCallback, aThisArg);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Add the given source mapping.
|
|
52
|
+
*
|
|
53
|
+
* @param Object aMapping
|
|
54
|
+
*/
|
|
55
|
+
add(aMapping) {
|
|
56
|
+
if (generatedPositionAfter(this._last, aMapping)) {
|
|
57
|
+
this._last = aMapping;
|
|
58
|
+
this._array.push(aMapping);
|
|
59
|
+
} else {
|
|
60
|
+
this._sorted = false;
|
|
61
|
+
this._array.push(aMapping);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Returns the flat, sorted array of mappings. The mappings are sorted by
|
|
67
|
+
* generated position.
|
|
68
|
+
*
|
|
69
|
+
* WARNING: This method returns internal data without copying, for
|
|
70
|
+
* performance. The return value must NOT be mutated, and should be treated as
|
|
71
|
+
* an immutable borrow. If you want to take ownership, you must make your own
|
|
72
|
+
* copy.
|
|
73
|
+
*/
|
|
74
|
+
toArray() {
|
|
75
|
+
if (!this._sorted) {
|
|
76
|
+
this._array.sort(util.compareByGeneratedPositionsInflated);
|
|
77
|
+
this._sorted = true;
|
|
78
|
+
}
|
|
79
|
+
return this._array;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
exports.MappingList = MappingList;
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Note: This file is replaced with "read-wasm-browser.js" when this module is
|
|
4
|
+
// bundled with a packager that takes package.json#browser fields into account.
|
|
5
|
+
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
const path = require("path");
|
|
8
|
+
|
|
9
|
+
module.exports = function readWasm() {
|
|
10
|
+
return new Promise((resolve, reject) => {
|
|
11
|
+
const wasmPath = path.join(__dirname, "mappings.wasm");
|
|
12
|
+
fs.readFile(wasmPath, null, (error, data) => {
|
|
13
|
+
if (error) {
|
|
14
|
+
reject(error);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
resolve(data.buffer);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
module.exports.initialize = _ => {
|
|
24
|
+
console.debug(
|
|
25
|
+
"SourceMapConsumer.initialize is a no-op when running in node.js"
|
|
26
|
+
);
|
|
27
|
+
};
|