nitro-nightly 3.1.0-20251028-090722-437659e4 → 3.1.0-20251028-131831-fe9fd554
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/dist/_build/build.mjs +379 -14
- package/dist/_build/{rollup.mjs → build2.mjs} +218 -68
- package/dist/_build/info.mjs +963 -7
- package/dist/_build/prepare.mjs +1491 -2
- package/dist/_build/snapshot.mjs +155 -31
- package/dist/_build/vite.mjs +43 -2307
- package/dist/_build/vite2.mjs +149 -0
- package/dist/{_deps → _chunks/_deps}/c12.mjs +1 -1
- package/dist/{_deps → _chunks/_deps}/giget.mjs +1 -1
- package/dist/_chunks/_deps/klona.mjs +137 -0
- package/dist/{_deps → _chunks/_deps}/knitwork.mjs +1 -1
- package/dist/{_deps → _chunks/_deps}/local-pkg.mjs +1 -1
- package/dist/{_deps → _chunks/_deps}/mlly.mjs +1 -1
- package/dist/{_deps → _chunks/_deps}/nypm.mjs +1 -1
- package/dist/{_deps → _chunks/_deps}/pathe.mjs +1 -1
- package/dist/{_deps → _chunks/_deps}/pkg-types.mjs +2 -2
- package/dist/{_deps → _chunks/_deps}/rou3.mjs +1 -1
- package/dist/_chunks/_deps/std-env.mjs +3 -0
- package/dist/{_deps → _chunks/_deps}/unimport.mjs +2 -2
- package/dist/{_deps → _chunks/_deps}/unplugin-utils.mjs +1 -1
- package/dist/{_deps → _chunks/_deps}/untyped.mjs +1 -1
- package/dist/{_deps → _chunks/_deps}/unwasm.mjs +2 -2
- package/dist/{_presets → _chunks/_presets}/_resolve.mjs +2 -2
- package/dist/{_presets → _chunks/_presets}/_utils.mjs +1 -1
- package/dist/{_presets → _chunks/_presets}/azure.mjs +1 -1
- package/dist/{_presets → _chunks/_presets}/cloudflare.mjs +4 -4
- package/dist/{_presets → _chunks/_presets}/deno.mjs +1 -1
- package/dist/{_presets → _chunks/_presets}/firebase.mjs +1 -1
- package/dist/{_presets → _chunks/_presets}/iis.mjs +1 -1
- package/dist/{_presets → _chunks/_presets}/index.mjs +1 -1
- package/dist/{_presets → _chunks/_presets}/vercel.mjs +3 -3
- package/dist/{_presets → _chunks/_presets}/zeabur.mjs +1 -1
- package/dist/_chunks/app.mjs +600 -0
- package/dist/_chunks/index.mjs +648 -0
- package/dist/_chunks/server.mjs +256 -0
- package/dist/_cli/build.mjs +2 -2
- package/dist/_cli/dev.mjs +46 -130
- package/dist/_cli/index.mjs +1 -1
- package/dist/_cli/list.mjs +2 -2
- package/dist/_cli/prepare.mjs +2 -2
- package/dist/_cli/run.mjs +2 -2
- package/dist/cli/index.mjs +1 -1
- package/dist/index.mjs +94 -120
- package/dist/node_modules/cookie-es/dist/index.mjs +262 -0
- package/dist/node_modules/cookie-es/package.json +37 -0
- package/dist/node_modules/rendu/dist/index.mjs +380 -0
- package/dist/node_modules/rendu/package.json +47 -0
- package/dist/runtime/internal/task.mjs +1 -2
- package/dist/types/index.d.mts +2 -1
- package/dist/vite.mjs +103 -114
- package/lib/runtime/meta.mjs +18 -25
- package/package.json +9 -10
- package/dist/_build/assets.mjs +0 -235
- package/dist/_build/config.mjs +0 -124
- package/dist/_build/plugins.mjs +0 -1041
- package/dist/_build/rolldown.mjs +0 -494
- package/dist/_build/types.mjs +0 -268
- package/dist/node_modules/klona/dist/index.mjs +0 -81
- package/dist/node_modules/klona/full/index.mjs +0 -53
- package/dist/node_modules/klona/package.json +0 -74
- package/dist/node_modules/std-env/dist/index.mjs +0 -1
- package/dist/node_modules/std-env/package.json +0 -46
- /package/dist/{_deps → _chunks/_deps}/@jridgewell/gen-mapping.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/@jridgewell/remapping.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/@jridgewell/resolve-uri.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/@jridgewell/sourcemap-codec.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/@jridgewell/trace-mapping.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/@pi0/vite-plugin-fullstack.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/@rollup/plugin-alias.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/@rollup/plugin-commonjs.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/@rollup/plugin-inject.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/@rollup/plugin-json.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/@rollup/plugin-node-resolve.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/@rollup/plugin-replace.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/@rollup/pluginutils.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/acorn.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/chokidar.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/citty.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/commondir.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/compatx.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/confbox.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/debug.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/deepmerge.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/depd.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/dot-prop.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/dotenv.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/duplexer.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/ee-first.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/encodeurl.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/escape-html.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/escape-string-regexp.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/estree-walker.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/etag.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/exsolve.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/fdir.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/fresh.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/function-bind.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/gzip-size.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/hasown.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/http-errors.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/httpxy.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/inherits.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/is-core-module.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/is-module.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/is-reference.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/js-tokens.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/magic-string.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/mime-db.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/mime-types.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/mime.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/ms.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/node-fetch-native.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/on-finished.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/parseurl.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/path-parse.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/perfect-debounce.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/picomatch.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/pretty-bytes.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/quansync.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/range-parser.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/rc9.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/readdirp.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/resolve.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/send.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/serve-static.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/setprototypeof.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/statuses.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/strip-literal.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/supports-color.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/tinyexec.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/tinyglobby.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/toidentifier.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/ultrahtml.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/unplugin.mjs +0 -0
- /package/dist/{_deps → _chunks/_deps}/webpack-virtual-modules.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/_all.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/_nitro.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/_static.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/_types.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/alwaysdata.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/aws-amplify.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/aws-lambda.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/bun.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/cleavr.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/digitalocean.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/flightcontrol.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/genezio.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/heroku.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/koyeb.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/netlify.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/node.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/platform.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/render.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/standard.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/stormkit.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/winterjs.mjs +0 -0
- /package/dist/{_presets → _chunks/_presets}/zerops.mjs +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,143 +1,117 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { b as build } from './
|
|
3
|
-
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import '
|
|
7
|
-
import 'consola/utils';
|
|
8
|
-
import 'defu';
|
|
9
|
-
import './_deps/mime.mjs';
|
|
10
|
-
import './_deps/rou3.mjs';
|
|
11
|
-
import 'ufo';
|
|
12
|
-
import './_build/rolldown.mjs';
|
|
13
|
-
import './_deps/mlly.mjs';
|
|
14
|
-
import './_deps/acorn.mjs';
|
|
15
|
-
import 'node:module';
|
|
1
|
+
export { g as copyPublicAssets, c as createNitro, f as listTasks, l as loadOptions, p as prepare, e as runTask } from './_build/prepare.mjs';
|
|
2
|
+
export { b as build, p as prerender, w as writeTypes } from './_chunks/index.mjs';
|
|
3
|
+
export { c as createDevServer } from './_chunks/server.mjs';
|
|
4
|
+
import 'consola';
|
|
5
|
+
import 'hookable';
|
|
6
|
+
import './_chunks/_deps/c12.mjs';
|
|
16
7
|
import 'node:fs';
|
|
17
|
-
import '
|
|
18
|
-
import '
|
|
19
|
-
import '
|
|
20
|
-
import './_deps/exsolve.mjs';
|
|
8
|
+
import 'node:fs/promises';
|
|
9
|
+
import 'node:url';
|
|
10
|
+
import 'node:os';
|
|
11
|
+
import './_chunks/_deps/exsolve.mjs';
|
|
21
12
|
import 'node:path';
|
|
22
13
|
import 'node:assert';
|
|
23
14
|
import 'node:process';
|
|
24
15
|
import 'node:v8';
|
|
25
16
|
import 'node:util';
|
|
26
|
-
import '
|
|
27
|
-
import '
|
|
28
|
-
import '
|
|
29
|
-
import '
|
|
30
|
-
import './
|
|
31
|
-
import './_deps
|
|
32
|
-
import './_deps/
|
|
33
|
-
import '
|
|
34
|
-
import '
|
|
17
|
+
import 'jiti';
|
|
18
|
+
import './_chunks/_deps/rc9.mjs';
|
|
19
|
+
import 'destr';
|
|
20
|
+
import 'defu';
|
|
21
|
+
import './_chunks/_deps/pkg-types.mjs';
|
|
22
|
+
import './_chunks/_deps/mlly.mjs';
|
|
23
|
+
import './_chunks/_deps/acorn.mjs';
|
|
24
|
+
import 'node:module';
|
|
25
|
+
import 'ufo';
|
|
26
|
+
import './_chunks/_deps/pathe.mjs';
|
|
27
|
+
import './_chunks/_deps/confbox.mjs';
|
|
28
|
+
import './_chunks/_deps/dotenv.mjs';
|
|
29
|
+
import 'fs';
|
|
30
|
+
import 'os';
|
|
31
|
+
import 'crypto';
|
|
35
32
|
import 'path';
|
|
36
|
-
import './_deps/
|
|
37
|
-
import './_deps/
|
|
38
|
-
import './_deps/
|
|
33
|
+
import './_chunks/_deps/commondir.mjs';
|
|
34
|
+
import './_chunks/_deps/perfect-debounce.mjs';
|
|
35
|
+
import './_chunks/_deps/compatx.mjs';
|
|
36
|
+
import './_chunks/_deps/klona.mjs';
|
|
37
|
+
import 'nitro/runtime/meta';
|
|
38
|
+
import './_chunks/_deps/std-env.mjs';
|
|
39
|
+
import './_chunks/_deps/escape-string-regexp.mjs';
|
|
40
|
+
import './_chunks/_deps/tinyglobby.mjs';
|
|
41
|
+
import 'url';
|
|
42
|
+
import './_chunks/_deps/fdir.mjs';
|
|
43
|
+
import 'module';
|
|
44
|
+
import './_chunks/_deps/picomatch.mjs';
|
|
45
|
+
import 'ofetch';
|
|
46
|
+
import 'unstorage';
|
|
47
|
+
import './_chunks/_deps/rou3.mjs';
|
|
39
48
|
import 'ohash';
|
|
40
|
-
import './_deps/unimport.mjs';
|
|
49
|
+
import './_chunks/_deps/unimport.mjs';
|
|
41
50
|
import 'scule';
|
|
42
|
-
import '
|
|
43
|
-
import './_deps/
|
|
51
|
+
import './_chunks/_deps/magic-string.mjs';
|
|
52
|
+
import './_chunks/_deps/@jridgewell/sourcemap-codec.mjs';
|
|
53
|
+
import './_chunks/_deps/unplugin.mjs';
|
|
44
54
|
import 'node:buffer';
|
|
45
|
-
import './_deps/@jridgewell/remapping.mjs';
|
|
46
|
-
import './_deps/@jridgewell/trace-mapping.mjs';
|
|
47
|
-
import './_deps/@jridgewell/resolve-uri.mjs';
|
|
48
|
-
import './_deps/@jridgewell/gen-mapping.mjs';
|
|
55
|
+
import './_chunks/_deps/@jridgewell/remapping.mjs';
|
|
56
|
+
import './_chunks/_deps/@jridgewell/trace-mapping.mjs';
|
|
57
|
+
import './_chunks/_deps/@jridgewell/resolve-uri.mjs';
|
|
58
|
+
import './_chunks/_deps/@jridgewell/gen-mapping.mjs';
|
|
49
59
|
import 'node:querystring';
|
|
50
|
-
import './_deps/webpack-virtual-modules.mjs';
|
|
60
|
+
import './_chunks/_deps/webpack-virtual-modules.mjs';
|
|
51
61
|
import 'constants';
|
|
52
|
-
import './_deps/unplugin-utils.mjs';
|
|
53
|
-
import './_deps/
|
|
54
|
-
import '
|
|
55
|
-
import '
|
|
56
|
-
import './_deps/
|
|
57
|
-
import '
|
|
58
|
-
import '
|
|
59
|
-
import './_deps/
|
|
60
|
-
import './_deps/strip-literal.mjs';
|
|
61
|
-
import './_deps/js-tokens.mjs';
|
|
62
|
-
import './_deps/unwasm.mjs';
|
|
63
|
-
import 'node:crypto';
|
|
64
|
-
import './_deps/knitwork.mjs';
|
|
65
|
-
import 'db0';
|
|
66
|
-
import 'esbuild';
|
|
67
|
-
import './_deps/etag.mjs';
|
|
68
|
-
import 'crypto';
|
|
69
|
-
import 'unstorage';
|
|
70
|
-
import 'nf3';
|
|
71
|
-
import 'rendu';
|
|
72
|
-
import './_deps/chokidar.mjs';
|
|
73
|
-
import 'fs/promises';
|
|
74
|
-
import 'events';
|
|
75
|
-
import './_deps/readdirp.mjs';
|
|
76
|
-
import 'node:stream';
|
|
77
|
-
import 'os';
|
|
78
|
-
import './_deps/perfect-debounce.mjs';
|
|
79
|
-
import './_deps/compatx.mjs';
|
|
80
|
-
import './_deps/gzip-size.mjs';
|
|
62
|
+
import './_chunks/_deps/unplugin-utils.mjs';
|
|
63
|
+
import './_chunks/_deps/local-pkg.mjs';
|
|
64
|
+
import './_chunks/_deps/quansync.mjs';
|
|
65
|
+
import './_chunks/_deps/estree-walker.mjs';
|
|
66
|
+
import './_chunks/_deps/strip-literal.mjs';
|
|
67
|
+
import './_chunks/_deps/js-tokens.mjs';
|
|
68
|
+
import 'consola/utils';
|
|
69
|
+
import './_chunks/_deps/dot-prop.mjs';
|
|
81
70
|
import 'node:zlib';
|
|
82
|
-
import '
|
|
83
|
-
import './_deps/
|
|
84
|
-
import '
|
|
85
|
-
import './
|
|
86
|
-
import '
|
|
87
|
-
import './_build/info.mjs';
|
|
88
|
-
import 'nitro/meta';
|
|
89
|
-
import './_presets/_types.mjs';
|
|
90
|
-
import './_deps/ultrahtml.mjs';
|
|
91
|
-
import 'h3';
|
|
92
|
-
import 'consola';
|
|
93
|
-
import 'srvx/node';
|
|
94
|
-
import 'hookable';
|
|
95
|
-
import './_deps/c12.mjs';
|
|
96
|
-
import 'jiti';
|
|
97
|
-
import './_deps/rc9.mjs';
|
|
98
|
-
import 'destr';
|
|
99
|
-
import './_deps/dotenv.mjs';
|
|
100
|
-
import 'klona/full';
|
|
101
|
-
import './_deps/escape-string-regexp.mjs';
|
|
102
|
-
import 'ofetch';
|
|
71
|
+
import './_chunks/_deps/mime.mjs';
|
|
72
|
+
import './_chunks/_deps/ultrahtml.mjs';
|
|
73
|
+
import './_chunks/_deps/untyped.mjs';
|
|
74
|
+
import './_chunks/_deps/knitwork.mjs';
|
|
75
|
+
import './_chunks/app.mjs';
|
|
103
76
|
import 'node:worker_threads';
|
|
104
|
-
import '
|
|
105
|
-
import './_deps/serve-static.mjs';
|
|
106
|
-
import './_deps/encodeurl.mjs';
|
|
107
|
-
import './_deps/escape-html.mjs';
|
|
108
|
-
import './_deps/parseurl.mjs';
|
|
109
|
-
import './_deps/send.mjs';
|
|
110
|
-
import './_deps/http-errors.mjs';
|
|
111
|
-
import './_deps/depd.mjs';
|
|
112
|
-
import './_deps/setprototypeof.mjs';
|
|
113
|
-
import './_deps/statuses.mjs';
|
|
114
|
-
import './_deps/inherits.mjs';
|
|
115
|
-
import './_deps/toidentifier.mjs';
|
|
116
|
-
import './_deps/debug.mjs';
|
|
77
|
+
import 'h3';
|
|
78
|
+
import './_chunks/_deps/serve-static.mjs';
|
|
79
|
+
import './_chunks/_deps/encodeurl.mjs';
|
|
80
|
+
import './_chunks/_deps/escape-html.mjs';
|
|
81
|
+
import './_chunks/_deps/parseurl.mjs';
|
|
82
|
+
import './_chunks/_deps/send.mjs';
|
|
83
|
+
import './_chunks/_deps/http-errors.mjs';
|
|
84
|
+
import './_chunks/_deps/depd.mjs';
|
|
85
|
+
import './_chunks/_deps/setprototypeof.mjs';
|
|
86
|
+
import './_chunks/_deps/statuses.mjs';
|
|
87
|
+
import './_chunks/_deps/inherits.mjs';
|
|
88
|
+
import './_chunks/_deps/toidentifier.mjs';
|
|
89
|
+
import './_chunks/_deps/debug.mjs';
|
|
117
90
|
import 'tty';
|
|
118
91
|
import 'util';
|
|
119
|
-
import './_deps/ms.mjs';
|
|
120
|
-
import './_deps/supports-color.mjs';
|
|
121
|
-
import './_deps/
|
|
122
|
-
import './_deps/
|
|
123
|
-
import './_deps/mime-
|
|
124
|
-
import './_deps/
|
|
125
|
-
import './_deps/
|
|
126
|
-
import './_deps/
|
|
127
|
-
import './_deps/
|
|
92
|
+
import './_chunks/_deps/ms.mjs';
|
|
93
|
+
import './_chunks/_deps/supports-color.mjs';
|
|
94
|
+
import './_chunks/_deps/etag.mjs';
|
|
95
|
+
import './_chunks/_deps/fresh.mjs';
|
|
96
|
+
import './_chunks/_deps/mime-types.mjs';
|
|
97
|
+
import './_chunks/_deps/mime-db.mjs';
|
|
98
|
+
import './_chunks/_deps/on-finished.mjs';
|
|
99
|
+
import './_chunks/_deps/ee-first.mjs';
|
|
100
|
+
import './_chunks/_deps/range-parser.mjs';
|
|
101
|
+
import 'stream';
|
|
102
|
+
import './_chunks/_deps/httpxy.mjs';
|
|
128
103
|
import 'node:http';
|
|
129
104
|
import 'node:https';
|
|
130
105
|
import 'node:events';
|
|
106
|
+
import 'undici';
|
|
131
107
|
import 'youch-core';
|
|
132
108
|
import 'youch';
|
|
133
109
|
import 'source-map';
|
|
134
110
|
import 'srvx';
|
|
135
|
-
import '
|
|
136
|
-
import './_deps
|
|
137
|
-
import '
|
|
138
|
-
import '
|
|
139
|
-
import '
|
|
140
|
-
import '
|
|
141
|
-
import 'node
|
|
142
|
-
import './_deps/dot-prop.mjs';
|
|
143
|
-
import './_deps/untyped.mjs';
|
|
111
|
+
import 'nitro/meta';
|
|
112
|
+
import './_chunks/_deps/chokidar.mjs';
|
|
113
|
+
import 'fs/promises';
|
|
114
|
+
import 'events';
|
|
115
|
+
import './_chunks/_deps/readdirp.mjs';
|
|
116
|
+
import 'node:stream';
|
|
117
|
+
import 'srvx/node';
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
function parse(str, options) {
|
|
2
|
+
if (typeof str !== "string") {
|
|
3
|
+
throw new TypeError("argument str must be a string");
|
|
4
|
+
}
|
|
5
|
+
const obj = {};
|
|
6
|
+
const opt = options || {};
|
|
7
|
+
const dec = opt.decode || decode;
|
|
8
|
+
let index = 0;
|
|
9
|
+
while (index < str.length) {
|
|
10
|
+
const eqIdx = str.indexOf("=", index);
|
|
11
|
+
if (eqIdx === -1) {
|
|
12
|
+
break;
|
|
13
|
+
}
|
|
14
|
+
let endIdx = str.indexOf(";", index);
|
|
15
|
+
if (endIdx === -1) {
|
|
16
|
+
endIdx = str.length;
|
|
17
|
+
} else if (endIdx < eqIdx) {
|
|
18
|
+
index = str.lastIndexOf(";", eqIdx - 1) + 1;
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
const key = str.slice(index, eqIdx).trim();
|
|
22
|
+
if (opt?.filter && !opt?.filter(key)) {
|
|
23
|
+
index = endIdx + 1;
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
if (void 0 === obj[key]) {
|
|
27
|
+
let val = str.slice(eqIdx + 1, endIdx).trim();
|
|
28
|
+
if (val.codePointAt(0) === 34) {
|
|
29
|
+
val = val.slice(1, -1);
|
|
30
|
+
}
|
|
31
|
+
obj[key] = tryDecode(val, dec);
|
|
32
|
+
}
|
|
33
|
+
index = endIdx + 1;
|
|
34
|
+
}
|
|
35
|
+
return obj;
|
|
36
|
+
}
|
|
37
|
+
function decode(str) {
|
|
38
|
+
return str.includes("%") ? decodeURIComponent(str) : str;
|
|
39
|
+
}
|
|
40
|
+
function tryDecode(str, decode2) {
|
|
41
|
+
try {
|
|
42
|
+
return decode2(str);
|
|
43
|
+
} catch {
|
|
44
|
+
return str;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const fieldContentRegExp = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;
|
|
49
|
+
function serialize(name, value, options) {
|
|
50
|
+
const opt = options || {};
|
|
51
|
+
const enc = opt.encode || encodeURIComponent;
|
|
52
|
+
if (typeof enc !== "function") {
|
|
53
|
+
throw new TypeError("option encode is invalid");
|
|
54
|
+
}
|
|
55
|
+
if (!fieldContentRegExp.test(name)) {
|
|
56
|
+
throw new TypeError("argument name is invalid");
|
|
57
|
+
}
|
|
58
|
+
const encodedValue = enc(value);
|
|
59
|
+
if (encodedValue && !fieldContentRegExp.test(encodedValue)) {
|
|
60
|
+
throw new TypeError("argument val is invalid");
|
|
61
|
+
}
|
|
62
|
+
let str = name + "=" + encodedValue;
|
|
63
|
+
if (void 0 !== opt.maxAge && opt.maxAge !== null) {
|
|
64
|
+
const maxAge = opt.maxAge - 0;
|
|
65
|
+
if (Number.isNaN(maxAge) || !Number.isFinite(maxAge)) {
|
|
66
|
+
throw new TypeError("option maxAge is invalid");
|
|
67
|
+
}
|
|
68
|
+
str += "; Max-Age=" + Math.floor(maxAge);
|
|
69
|
+
}
|
|
70
|
+
if (opt.domain) {
|
|
71
|
+
if (!fieldContentRegExp.test(opt.domain)) {
|
|
72
|
+
throw new TypeError("option domain is invalid");
|
|
73
|
+
}
|
|
74
|
+
str += "; Domain=" + opt.domain;
|
|
75
|
+
}
|
|
76
|
+
if (opt.path) {
|
|
77
|
+
if (!fieldContentRegExp.test(opt.path)) {
|
|
78
|
+
throw new TypeError("option path is invalid");
|
|
79
|
+
}
|
|
80
|
+
str += "; Path=" + opt.path;
|
|
81
|
+
}
|
|
82
|
+
if (opt.expires) {
|
|
83
|
+
if (!isDate(opt.expires) || Number.isNaN(opt.expires.valueOf())) {
|
|
84
|
+
throw new TypeError("option expires is invalid");
|
|
85
|
+
}
|
|
86
|
+
str += "; Expires=" + opt.expires.toUTCString();
|
|
87
|
+
}
|
|
88
|
+
if (opt.httpOnly) {
|
|
89
|
+
str += "; HttpOnly";
|
|
90
|
+
}
|
|
91
|
+
if (opt.secure) {
|
|
92
|
+
str += "; Secure";
|
|
93
|
+
}
|
|
94
|
+
if (opt.priority) {
|
|
95
|
+
const priority = typeof opt.priority === "string" ? opt.priority.toLowerCase() : opt.priority;
|
|
96
|
+
switch (priority) {
|
|
97
|
+
case "low": {
|
|
98
|
+
str += "; Priority=Low";
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
case "medium": {
|
|
102
|
+
str += "; Priority=Medium";
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
case "high": {
|
|
106
|
+
str += "; Priority=High";
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
default: {
|
|
110
|
+
throw new TypeError("option priority is invalid");
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (opt.sameSite) {
|
|
115
|
+
const sameSite = typeof opt.sameSite === "string" ? opt.sameSite.toLowerCase() : opt.sameSite;
|
|
116
|
+
switch (sameSite) {
|
|
117
|
+
case true: {
|
|
118
|
+
str += "; SameSite=Strict";
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
case "lax": {
|
|
122
|
+
str += "; SameSite=Lax";
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
case "strict": {
|
|
126
|
+
str += "; SameSite=Strict";
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
case "none": {
|
|
130
|
+
str += "; SameSite=None";
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
default: {
|
|
134
|
+
throw new TypeError("option sameSite is invalid");
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (opt.partitioned) {
|
|
139
|
+
str += "; Partitioned";
|
|
140
|
+
}
|
|
141
|
+
return str;
|
|
142
|
+
}
|
|
143
|
+
function isDate(val) {
|
|
144
|
+
return Object.prototype.toString.call(val) === "[object Date]" || val instanceof Date;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function parseSetCookie(setCookieValue, options) {
|
|
148
|
+
const parts = (setCookieValue || "").split(";").filter((str) => typeof str === "string" && !!str.trim());
|
|
149
|
+
const nameValuePairStr = parts.shift() || "";
|
|
150
|
+
const parsed = _parseNameValuePair(nameValuePairStr);
|
|
151
|
+
const name = parsed.name;
|
|
152
|
+
let value = parsed.value;
|
|
153
|
+
try {
|
|
154
|
+
value = options?.decode === false ? value : (options?.decode || decodeURIComponent)(value);
|
|
155
|
+
} catch {
|
|
156
|
+
}
|
|
157
|
+
const cookie = {
|
|
158
|
+
name,
|
|
159
|
+
value
|
|
160
|
+
};
|
|
161
|
+
for (const part of parts) {
|
|
162
|
+
const sides = part.split("=");
|
|
163
|
+
const partKey = (sides.shift() || "").trimStart().toLowerCase();
|
|
164
|
+
const partValue = sides.join("=");
|
|
165
|
+
switch (partKey) {
|
|
166
|
+
case "expires": {
|
|
167
|
+
cookie.expires = new Date(partValue);
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
case "max-age": {
|
|
171
|
+
cookie.maxAge = Number.parseInt(partValue, 10);
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
case "secure": {
|
|
175
|
+
cookie.secure = true;
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
case "httponly": {
|
|
179
|
+
cookie.httpOnly = true;
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
case "samesite": {
|
|
183
|
+
cookie.sameSite = partValue;
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
default: {
|
|
187
|
+
cookie[partKey] = partValue;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return cookie;
|
|
192
|
+
}
|
|
193
|
+
function _parseNameValuePair(nameValuePairStr) {
|
|
194
|
+
let name = "";
|
|
195
|
+
let value = "";
|
|
196
|
+
const nameValueArr = nameValuePairStr.split("=");
|
|
197
|
+
if (nameValueArr.length > 1) {
|
|
198
|
+
name = nameValueArr.shift();
|
|
199
|
+
value = nameValueArr.join("=");
|
|
200
|
+
} else {
|
|
201
|
+
value = nameValuePairStr;
|
|
202
|
+
}
|
|
203
|
+
return { name, value };
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function splitSetCookieString(cookiesString) {
|
|
207
|
+
if (Array.isArray(cookiesString)) {
|
|
208
|
+
return cookiesString.flatMap((c) => splitSetCookieString(c));
|
|
209
|
+
}
|
|
210
|
+
if (typeof cookiesString !== "string") {
|
|
211
|
+
return [];
|
|
212
|
+
}
|
|
213
|
+
const cookiesStrings = [];
|
|
214
|
+
let pos = 0;
|
|
215
|
+
let start;
|
|
216
|
+
let ch;
|
|
217
|
+
let lastComma;
|
|
218
|
+
let nextStart;
|
|
219
|
+
let cookiesSeparatorFound;
|
|
220
|
+
const skipWhitespace = () => {
|
|
221
|
+
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
|
|
222
|
+
pos += 1;
|
|
223
|
+
}
|
|
224
|
+
return pos < cookiesString.length;
|
|
225
|
+
};
|
|
226
|
+
const notSpecialChar = () => {
|
|
227
|
+
ch = cookiesString.charAt(pos);
|
|
228
|
+
return ch !== "=" && ch !== ";" && ch !== ",";
|
|
229
|
+
};
|
|
230
|
+
while (pos < cookiesString.length) {
|
|
231
|
+
start = pos;
|
|
232
|
+
cookiesSeparatorFound = false;
|
|
233
|
+
while (skipWhitespace()) {
|
|
234
|
+
ch = cookiesString.charAt(pos);
|
|
235
|
+
if (ch === ",") {
|
|
236
|
+
lastComma = pos;
|
|
237
|
+
pos += 1;
|
|
238
|
+
skipWhitespace();
|
|
239
|
+
nextStart = pos;
|
|
240
|
+
while (pos < cookiesString.length && notSpecialChar()) {
|
|
241
|
+
pos += 1;
|
|
242
|
+
}
|
|
243
|
+
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
|
|
244
|
+
cookiesSeparatorFound = true;
|
|
245
|
+
pos = nextStart;
|
|
246
|
+
cookiesStrings.push(cookiesString.slice(start, lastComma));
|
|
247
|
+
start = pos;
|
|
248
|
+
} else {
|
|
249
|
+
pos = lastComma + 1;
|
|
250
|
+
}
|
|
251
|
+
} else {
|
|
252
|
+
pos += 1;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
|
|
256
|
+
cookiesStrings.push(cookiesString.slice(start));
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return cookiesStrings;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export { parse, parseSetCookie, serialize, splitSetCookieString };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cookie-es",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"repository": "unjs/cookie-es",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"type": "module",
|
|
8
|
+
"exports": {
|
|
9
|
+
"types": "./dist/index.d.mts",
|
|
10
|
+
"default": "./dist/index.mjs"
|
|
11
|
+
},
|
|
12
|
+
"types": "./dist/index.d.mts",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "unbuild",
|
|
18
|
+
"dev": "vitest --coverage",
|
|
19
|
+
"lint": "eslint --cache . && prettier -c src test",
|
|
20
|
+
"lint:fix": "automd && eslint --cache . --fix && prettier -c src test -w",
|
|
21
|
+
"release": "pnpm test && pnpm build && changelogen --release --push && npm publish",
|
|
22
|
+
"test": "pnpm lint && vitest run --coverage"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^22.13.5",
|
|
26
|
+
"@vitest/coverage-v8": "^3.0.7",
|
|
27
|
+
"automd": "^0.4.0",
|
|
28
|
+
"changelogen": "^0.6.0",
|
|
29
|
+
"eslint": "^9.21.0",
|
|
30
|
+
"eslint-config-unjs": "^0.4.2",
|
|
31
|
+
"prettier": "^3.5.2",
|
|
32
|
+
"typescript": "^5.7.3",
|
|
33
|
+
"unbuild": "^3.5.0",
|
|
34
|
+
"vitest": "^3.0.7"
|
|
35
|
+
},
|
|
36
|
+
"packageManager": "pnpm@10.5.2"
|
|
37
|
+
}
|