@kasperpeulen/vitest-plugin-nextjs 0.0.0-alpha.0 → 0.1.0-alpha.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/README.md +249 -2
- package/dist/_virtual/_rolldown/runtime.js +14 -0
- package/dist/action-ids.d.ts +18 -0
- package/dist/action-ids.js +44 -0
- package/dist/adapter.d.ts +8 -0
- package/dist/adapter.js +12 -0
- package/dist/app-requests.d.ts +63 -0
- package/dist/app-requests.js +253 -0
- package/dist/browser-context.d.ts +24 -0
- package/dist/browser-context.js +157 -0
- package/dist/build-output.d.ts +68 -0
- package/dist/build-output.js +216 -0
- package/dist/build.d.ts +26 -0
- package/dist/build.js +39 -0
- package/dist/built-files.d.ts +9 -0
- package/dist/built-files.js +22 -0
- package/dist/cache.d.ts +44 -0
- package/dist/cache.js +99 -0
- package/dist/client-components.d.ts +3 -0
- package/dist/client-components.js +4 -0
- package/dist/client-file-key.d.ts +5 -0
- package/dist/client-file-key.js +5 -0
- package/dist/client-files.d.ts +83 -0
- package/dist/client-files.js +186 -0
- package/dist/client-graph.d.ts +94 -0
- package/dist/client-graph.js +266 -0
- package/dist/client-modules.d.ts +10 -0
- package/dist/client-modules.js +43 -0
- package/dist/client.d.ts +42 -0
- package/dist/client.js +263 -0
- package/dist/commonjs.d.ts +44 -0
- package/dist/commonjs.js +111 -0
- package/dist/compat/browser/client.d.ts +19 -0
- package/dist/compat/browser/client.js +13 -0
- package/dist/compat/build.d.ts +145 -0
- package/dist/compat/build.js +149 -0
- package/dist/compat/checks.d.ts +16 -0
- package/dist/compat/checks.js +148 -0
- package/dist/compat/patches.d.ts +13 -0
- package/dist/compat/patches.js +30 -0
- package/dist/compat/paths.d.ts +74 -0
- package/dist/compat/paths.js +160 -0
- package/dist/compat/rsc/handlers.d.ts +2 -0
- package/dist/compat/rsc/handlers.js +2 -0
- package/dist/compat/rsc/prerender.d.ts +10 -0
- package/dist/compat/rsc/prerender.js +9 -0
- package/dist/compat/server/headers.d.ts +3 -0
- package/dist/compat/server/headers.js +3 -0
- package/dist/compat/ssr/build-output.d.ts +4 -0
- package/dist/compat/ssr/build-output.js +3 -0
- package/dist/compat/ssr/cache.d.ts +6 -0
- package/dist/compat/ssr/cache.js +6 -0
- package/dist/compat/ssr/handler.d.ts +8 -0
- package/dist/compat/ssr/handler.js +8 -0
- package/dist/compat/ssr/node-server.d.ts +5 -0
- package/dist/compat/ssr/node-server.js +4 -0
- package/dist/compat/ssr/render-errors.d.ts +4 -0
- package/dist/compat/ssr/render-errors.js +4 -0
- package/dist/compat/ssr/senders.d.ts +6 -0
- package/dist/compat/ssr/senders.js +6 -0
- package/dist/compat/types.d.ts +8 -0
- package/dist/compat/types.js +1 -0
- package/dist/compile.d.ts +31 -0
- package/dist/compile.js +140 -0
- package/dist/disk.d.ts +16 -0
- package/dist/disk.js +13 -0
- package/dist/document-loads.d.ts +15 -0
- package/dist/document-loads.js +53 -0
- package/dist/document.d.ts +79 -0
- package/dist/document.js +328 -0
- package/dist/downloads.d.ts +15 -0
- package/dist/downloads.js +71 -0
- package/dist/esm-require.d.ts +11 -0
- package/dist/esm-require.js +32 -0
- package/dist/fast-crypto/index.js +1093 -0
- package/dist/fast-crypto.d.ts +20 -0
- package/dist/fast-crypto.js +151 -0
- package/dist/flight.d.ts +19 -0
- package/dist/flight.js +42 -0
- package/dist/form-submission.d.ts +15 -0
- package/dist/form-submission.js +27 -0
- package/dist/from-page.d.ts +5 -0
- package/dist/from-page.js +44 -0
- package/dist/globals.d.ts +1 -0
- package/dist/globals.js +197 -0
- package/dist/host-document.d.ts +26 -0
- package/dist/host-document.js +34 -0
- package/dist/index.d.ts +280 -0
- package/dist/index.js +281 -0
- package/dist/internal.d.ts +2 -0
- package/dist/internal.js +3 -0
- package/dist/leftovers.d.ts +11 -0
- package/dist/leftovers.js +55 -0
- package/dist/mode.d.ts +169 -0
- package/dist/mode.js +31 -0
- package/dist/node/LICENSES.md +3540 -0
- package/dist/node/assert/strict.js +29 -0
- package/dist/node/assert.js +3044 -0
- package/dist/node/buffer.js +1499 -0
- package/dist/node/child_process.js +45 -0
- package/dist/node/cluster.js +85 -0
- package/dist/node/console.js +96 -0
- package/dist/node/constants.js +495 -0
- package/dist/node/crypto.js +1388 -0
- package/dist/node/dgram.js +78 -0
- package/dist/node/diagnostics_channel.js +122 -0
- package/dist/node/dns/promises.js +129 -0
- package/dist/node/dns.js +137 -0
- package/dist/node/domain.js +43 -0
- package/dist/node/events.js +1155 -0
- package/dist/node/fs/promises.js +40 -0
- package/dist/node/fs.js +10375 -0
- package/dist/node/http.js +326 -0
- package/dist/node/http2.js +305 -0
- package/dist/node/https.js +57 -0
- package/dist/node/inspector/promises.js +66 -0
- package/dist/node/inspector.js +76 -0
- package/dist/node/module.js +205 -0
- package/dist/node/net.js +392 -0
- package/dist/node/os.js +259 -0
- package/dist/node/path/posix.js +25 -0
- package/dist/node/path/win32.js +25 -0
- package/dist/node/path.js +384 -0
- package/dist/node/perf_hooks.js +313 -0
- package/dist/node/process.js +452 -0
- package/dist/node/punycode.js +178 -0
- package/dist/node/querystring.js +934 -0
- package/dist/node/readline/promises.js +71 -0
- package/dist/node/readline.js +56 -0
- package/dist/node/repl.js +44 -0
- package/dist/node/sqlite.js +22 -0
- package/dist/node/stream/consumers.js +47 -0
- package/dist/node/stream/promises.js +6 -0
- package/dist/node/stream/web.js +52 -0
- package/dist/node/stream.js +4323 -0
- package/dist/node/string_decoder.js +276 -0
- package/dist/node/sys.js +6 -0
- package/dist/node/timers/promises.js +71 -0
- package/dist/node/timers.js +133 -0
- package/dist/node/tls.js +122 -0
- package/dist/node/trace_events.js +23 -0
- package/dist/node/tty.js +69 -0
- package/dist/node/url.js +1426 -0
- package/dist/node/util/types.js +1456 -0
- package/dist/node/util.js +4807 -0
- package/dist/node/v8.js +160 -0
- package/dist/node/vm.js +88 -0
- package/dist/node/wasi.js +16 -0
- package/dist/node/worker_threads.js +123 -0
- package/dist/node/zlib.js +1396 -0
- package/dist/node-builtins.d.ts +40 -0
- package/dist/node-builtins.js +74 -0
- package/dist/node-on-page.d.ts +46 -0
- package/dist/node-on-page.js +101 -0
- package/dist/node-platform.d.ts +36 -0
- package/dist/node-platform.js +152 -0
- package/dist/node-rendered.d.ts +21 -0
- package/dist/node-rendered.js +26 -0
- package/dist/node-server.d.ts +46 -0
- package/dist/node-server.js +193 -0
- package/dist/optimizer-cache-key.d.ts +26 -0
- package/dist/optimizer-cache-key.js +73 -0
- package/dist/own-package.d.ts +1 -0
- package/dist/own-package.js +6 -0
- package/dist/page-store.d.ts +33 -0
- package/dist/page-store.js +80 -0
- package/dist/page-timers.d.ts +22 -0
- package/dist/page-timers.js +47 -0
- package/dist/page.d.ts +112 -0
- package/dist/page.js +549 -0
- package/dist/paths.d.ts +13 -0
- package/dist/paths.js +47 -0
- package/dist/plugin.d.ts +22 -0
- package/dist/plugin.js +995 -0
- package/dist/prerender-verdict.d.ts +8 -0
- package/dist/prerender-verdict.js +67 -0
- package/dist/project/context.d.ts +546 -0
- package/dist/project/context.js +111 -0
- package/dist/project/entries.d.ts +42 -0
- package/dist/project/entries.js +189 -0
- package/dist/project/env-worker.d.ts +1 -0
- package/dist/project/env-worker.js +9 -0
- package/dist/project/env.d.ts +36 -0
- package/dist/project/env.js +82 -0
- package/dist/project/layers.d.ts +31 -0
- package/dist/project/layers.js +150 -0
- package/dist/project/loaders.d.ts +71 -0
- package/dist/project/loaders.js +300 -0
- package/dist/project/metadata.d.ts +8 -0
- package/dist/project/metadata.js +34 -0
- package/dist/project/module-exports.d.ts +29 -0
- package/dist/project/module-exports.js +77 -0
- package/dist/project/routes.d.ts +19 -0
- package/dist/project/routes.js +92 -0
- package/dist/project/routing.d.ts +46 -0
- package/dist/project/routing.js +280 -0
- package/dist/project/transform.d.ts +8 -0
- package/dist/project/transform.js +110 -0
- package/dist/project/webpack.d.ts +46 -0
- package/dist/project/webpack.js +160 -0
- package/dist/project.d.ts +264 -0
- package/dist/project.js +58 -0
- package/dist/registry-global.d.ts +5 -0
- package/dist/registry-global.js +5 -0
- package/dist/registry.d.ts +241 -0
- package/dist/registry.js +30 -0
- package/dist/route-chunks.d.ts +13 -0
- package/dist/route-chunks.js +32 -0
- package/dist/route-lookup.d.ts +34 -0
- package/dist/route-lookup.js +207 -0
- package/dist/routes-ahead-shared.d.ts +17 -0
- package/dist/routes-ahead-shared.js +9 -0
- package/dist/routes-ahead.d.ts +10 -0
- package/dist/routes-ahead.js +54 -0
- package/dist/rsc.d.ts +19 -0
- package/dist/rsc.js +171 -0
- package/dist/server-action.d.ts +9 -0
- package/dist/server-action.js +15 -0
- package/dist/server-code.d.ts +176 -0
- package/dist/server-code.js +357 -0
- package/dist/server-in-front.d.ts +37 -0
- package/dist/server-in-front.js +90 -0
- package/dist/server-layers.d.ts +22 -0
- package/dist/server-layers.js +33 -0
- package/dist/setup-browser.d.ts +1 -0
- package/dist/setup-browser.js +8 -0
- package/dist/setup-node.d.ts +1 -0
- package/dist/setup-node.js +6 -0
- package/dist/setup.d.ts +8 -0
- package/dist/setup.js +62 -0
- package/dist/speed-features.d.ts +13 -0
- package/dist/speed-features.js +95 -0
- package/dist/ssr.d.ts +70 -0
- package/dist/ssr.js +480 -0
- package/dist/static-build.d.ts +36 -0
- package/dist/static-build.js +92 -0
- package/dist/storage.d.ts +31 -0
- package/dist/storage.js +94 -0
- package/dist/styles-shared.d.ts +137 -0
- package/dist/styles-shared.js +124 -0
- package/dist/styles.d.ts +102 -0
- package/dist/styles.js +730 -0
- package/dist/stylesheet-versions.d.ts +17 -0
- package/dist/stylesheet-versions.js +43 -0
- package/dist/tester.html +10 -0
- package/dist/use-cache.d.ts +15 -0
- package/dist/use-cache.js +93 -0
- package/dist/vitest-version.d.ts +6 -0
- package/dist/vitest-version.js +12 -0
- package/package.json +125 -4
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { EventEmitter } from "node:events";
|
|
2
|
+
//#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/readline/interface.mjs
|
|
3
|
+
var Interface$1 = class extends EventEmitter {
|
|
4
|
+
terminal = false;
|
|
5
|
+
line = "";
|
|
6
|
+
cursor = 0;
|
|
7
|
+
getPrompt() {
|
|
8
|
+
return "";
|
|
9
|
+
}
|
|
10
|
+
setPrompt(prompt) {}
|
|
11
|
+
prompt(preserveCursor) {}
|
|
12
|
+
question(query, options, callback) {
|
|
13
|
+
callback && typeof callback === "function" && callback("");
|
|
14
|
+
}
|
|
15
|
+
resume() {
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
close() {}
|
|
19
|
+
write(data, key) {}
|
|
20
|
+
getCursorPos() {
|
|
21
|
+
return {
|
|
22
|
+
rows: 0,
|
|
23
|
+
cols: 0
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
pause() {
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
async *[Symbol.asyncIterator]() {
|
|
30
|
+
yield "";
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/readline/promises/interface.mjs
|
|
35
|
+
var Interface = class extends Interface$1 {
|
|
36
|
+
question(query, options) {
|
|
37
|
+
return Promise.resolve("");
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/readline/promises/readline.mjs
|
|
42
|
+
var Readline = class {
|
|
43
|
+
clearLine(dir) {
|
|
44
|
+
return this;
|
|
45
|
+
}
|
|
46
|
+
clearScreenDown() {
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
commit() {
|
|
50
|
+
return Promise.resolve();
|
|
51
|
+
}
|
|
52
|
+
cursorTo(x, y) {
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
moveCursor(dx, dy) {
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
rollback() {
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/readline/promises.mjs
|
|
64
|
+
const createInterface = () => new Interface();
|
|
65
|
+
var promises_default = {
|
|
66
|
+
Interface,
|
|
67
|
+
Readline,
|
|
68
|
+
createInterface
|
|
69
|
+
};
|
|
70
|
+
//#endregion
|
|
71
|
+
export { Interface, Readline, createInterface, promises_default as default };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import promises from "node:readline/promises";
|
|
2
|
+
import { EventEmitter } from "node:events";
|
|
3
|
+
//#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/mock/noop.mjs
|
|
4
|
+
var noop_default = Object.assign(() => {}, { __unenv__: true });
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/readline/interface.mjs
|
|
7
|
+
var Interface = class extends EventEmitter {
|
|
8
|
+
terminal = false;
|
|
9
|
+
line = "";
|
|
10
|
+
cursor = 0;
|
|
11
|
+
getPrompt() {
|
|
12
|
+
return "";
|
|
13
|
+
}
|
|
14
|
+
setPrompt(prompt) {}
|
|
15
|
+
prompt(preserveCursor) {}
|
|
16
|
+
question(query, options, callback) {
|
|
17
|
+
callback && typeof callback === "function" && callback("");
|
|
18
|
+
}
|
|
19
|
+
resume() {
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
close() {}
|
|
23
|
+
write(data, key) {}
|
|
24
|
+
getCursorPos() {
|
|
25
|
+
return {
|
|
26
|
+
rows: 0,
|
|
27
|
+
cols: 0
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
pause() {
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
async *[Symbol.asyncIterator]() {
|
|
34
|
+
yield "";
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/readline.mjs
|
|
39
|
+
const clearLine = () => false;
|
|
40
|
+
const clearScreenDown = () => false;
|
|
41
|
+
const createInterface = () => new Interface();
|
|
42
|
+
const cursorTo = () => false;
|
|
43
|
+
const emitKeypressEvents = noop_default;
|
|
44
|
+
const moveCursor = () => false;
|
|
45
|
+
var readline_default = {
|
|
46
|
+
clearLine,
|
|
47
|
+
clearScreenDown,
|
|
48
|
+
createInterface,
|
|
49
|
+
cursorTo,
|
|
50
|
+
emitKeypressEvents,
|
|
51
|
+
moveCursor,
|
|
52
|
+
Interface,
|
|
53
|
+
promises
|
|
54
|
+
};
|
|
55
|
+
//#endregion
|
|
56
|
+
export { Interface, clearLine, clearScreenDown, createInterface, cursorTo, readline_default as default, emitKeypressEvents, moveCursor, promises };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { builtinModules as builtinModules$1 } from "node:module";
|
|
2
|
+
//#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/_internal/utils.mjs
|
|
3
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
4
|
+
function createNotImplementedError(name) {
|
|
5
|
+
return /* @__PURE__ */ new Error(`[unenv] ${name} is not implemented yet!`);
|
|
6
|
+
}
|
|
7
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
8
|
+
function notImplemented(name) {
|
|
9
|
+
const fn = () => {
|
|
10
|
+
throw /* @__PURE__ */ createNotImplementedError(name);
|
|
11
|
+
};
|
|
12
|
+
return Object.assign(fn, { __unenv__: true });
|
|
13
|
+
}
|
|
14
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
15
|
+
function notImplementedClass(name) {
|
|
16
|
+
return class {
|
|
17
|
+
__unenv__ = true;
|
|
18
|
+
constructor() {
|
|
19
|
+
throw new Error(`[unenv] ${name} is not implemented yet!`);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/repl.mjs
|
|
25
|
+
const writer = /* @__PURE__ */ notImplementedClass("repl.writer");
|
|
26
|
+
const start = /* @__PURE__ */ notImplemented("repl.start");
|
|
27
|
+
const Recoverable = /* @__PURE__ */ notImplementedClass("repl.Recoverable");
|
|
28
|
+
const REPLServer = /* @__PURE__ */ notImplementedClass("repl.REPLServer");
|
|
29
|
+
const REPL_MODE_SLOPPY = /* @__PURE__ */ Symbol("repl-sloppy");
|
|
30
|
+
const REPL_MODE_STRICT = /* @__PURE__ */ Symbol("repl-strict");
|
|
31
|
+
const builtinModules = /* @__PURE__ */ builtinModules$1.filter((m) => m[0] !== "_");
|
|
32
|
+
const _builtinLibs = builtinModules;
|
|
33
|
+
var repl_default = {
|
|
34
|
+
writer,
|
|
35
|
+
start,
|
|
36
|
+
Recoverable,
|
|
37
|
+
REPLServer,
|
|
38
|
+
builtinModules,
|
|
39
|
+
_builtinLibs,
|
|
40
|
+
REPL_MODE_SLOPPY,
|
|
41
|
+
REPL_MODE_STRICT
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { REPLServer, REPL_MODE_SLOPPY, REPL_MODE_STRICT, Recoverable, _builtinLibs, builtinModules, repl_default as default, start, writer };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/_internal/utils.mjs
|
|
2
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3
|
+
function notImplementedClass(name) {
|
|
4
|
+
return class {
|
|
5
|
+
__unenv__ = true;
|
|
6
|
+
constructor() {
|
|
7
|
+
throw new Error(`[unenv] ${name} is not implemented yet!`);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/sqlite.mjs
|
|
13
|
+
const DatabaseSync = /* @__PURE__ */ notImplementedClass("sqlite.DatabaseSync");
|
|
14
|
+
const StatementSync = /* @__PURE__ */ notImplementedClass("sqlite.StatementSync");
|
|
15
|
+
const constants = {};
|
|
16
|
+
var sqlite_default = {
|
|
17
|
+
DatabaseSync,
|
|
18
|
+
StatementSync,
|
|
19
|
+
constants
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { DatabaseSync, StatementSync, constants, sqlite_default as default };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Buffer } from "@kasperpeulen/vitest-plugin-nextjs/node/buffer";
|
|
2
|
+
//#region src/node/stream/consumers.ts
|
|
3
|
+
const Buffer$1 = Buffer;
|
|
4
|
+
async function* chunksOf(source) {
|
|
5
|
+
const stream = source;
|
|
6
|
+
if (typeof source !== "object" || source === null || Symbol.asyncIterator in source || typeof stream.getReader !== "function") {
|
|
7
|
+
yield* source;
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const reader = stream.getReader();
|
|
11
|
+
let next = await reader.read();
|
|
12
|
+
while (!next.done) {
|
|
13
|
+
yield next.value;
|
|
14
|
+
next = await reader.read();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const notBytes = () => Object.assign(/* @__PURE__ */ new TypeError("The \"chunk\" argument must be of type string or an instance of Buffer, TypedArray, or DataView"), { code: "ERR_INVALID_ARG_TYPE" });
|
|
18
|
+
async function partsOf(source) {
|
|
19
|
+
const parts = [];
|
|
20
|
+
for await (const chunk of chunksOf(source)) if (ArrayBuffer.isView(chunk)) parts.push(Uint8Array.from(new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength)));
|
|
21
|
+
else if (chunk instanceof ArrayBuffer) parts.push(chunk.slice(0));
|
|
22
|
+
else parts.push(chunk);
|
|
23
|
+
return parts;
|
|
24
|
+
}
|
|
25
|
+
const blob = async (source) => new Blob(await partsOf(source));
|
|
26
|
+
const arrayBuffer = async (source) => (await blob(source)).arrayBuffer();
|
|
27
|
+
const buffer = async (source) => Buffer$1.from(await arrayBuffer(source));
|
|
28
|
+
const bytes = async (source) => new Uint8Array(await arrayBuffer(source));
|
|
29
|
+
async function text(source) {
|
|
30
|
+
const decoder = new TextDecoder();
|
|
31
|
+
let result = "";
|
|
32
|
+
for await (const chunk of chunksOf(source)) if (typeof chunk === "string") result += chunk;
|
|
33
|
+
else if (ArrayBuffer.isView(chunk) || chunk instanceof ArrayBuffer) result += decoder.decode(chunk, { stream: true });
|
|
34
|
+
else throw notBytes();
|
|
35
|
+
return result + decoder.decode();
|
|
36
|
+
}
|
|
37
|
+
const json = async (source) => JSON.parse(await text(source));
|
|
38
|
+
var consumers_default = {
|
|
39
|
+
arrayBuffer,
|
|
40
|
+
blob,
|
|
41
|
+
buffer,
|
|
42
|
+
bytes,
|
|
43
|
+
json,
|
|
44
|
+
text
|
|
45
|
+
};
|
|
46
|
+
//#endregion
|
|
47
|
+
export { arrayBuffer, blob, buffer, bytes, consumers_default as default, json, text };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/_internal/utils.mjs
|
|
2
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3
|
+
function createNotImplementedError(name) {
|
|
4
|
+
return /* @__PURE__ */ new Error(`[unenv] ${name} is not implemented yet!`);
|
|
5
|
+
}
|
|
6
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
7
|
+
function notImplemented(name) {
|
|
8
|
+
const fn = () => {
|
|
9
|
+
throw /* @__PURE__ */ createNotImplementedError(name);
|
|
10
|
+
};
|
|
11
|
+
return Object.assign(fn, { __unenv__: true });
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/stream/web.mjs
|
|
15
|
+
const ReadableStream = globalThis.ReadableStream || /* @__PURE__ */ notImplemented("stream.web.ReadableStream");
|
|
16
|
+
const ReadableStreamDefaultReader = globalThis.ReadableStreamDefaultReader || /* @__PURE__ */ notImplemented("stream.web.ReadableStreamDefaultReader");
|
|
17
|
+
const ReadableStreamBYOBReader = globalThis.ReadableStreamBYOBReader || /* @__PURE__ */ notImplemented("stream.web.ReadableStreamBYOBReader");
|
|
18
|
+
const ReadableStreamBYOBRequest = globalThis.ReadableStreamBYOBRequest || /* @__PURE__ */ notImplemented("stream.web.ReadableStreamBYOBRequest");
|
|
19
|
+
const ReadableByteStreamController = globalThis.ReadableByteStreamController || /* @__PURE__ */ notImplemented("stream.web.ReadableByteStreamController");
|
|
20
|
+
const ReadableStreamDefaultController = globalThis.ReadableStreamDefaultController || /* @__PURE__ */ notImplemented("stream.web.ReadableStreamDefaultController");
|
|
21
|
+
const TransformStream = globalThis.TransformStream || /* @__PURE__ */ notImplemented("stream.web.TransformStream");
|
|
22
|
+
const TransformStreamDefaultController = globalThis.TransformStreamDefaultController || /* @__PURE__ */ notImplemented("stream.web.TransformStreamDefaultController");
|
|
23
|
+
const WritableStream = globalThis.WritableStream || /* @__PURE__ */ notImplemented("stream.web.WritableStream");
|
|
24
|
+
const WritableStreamDefaultWriter = globalThis.WritableStreamDefaultWriter || /* @__PURE__ */ notImplemented("stream.web.WritableStreamDefaultWriter");
|
|
25
|
+
const WritableStreamDefaultController = globalThis.WritableStreamDefaultController || /* @__PURE__ */ notImplemented("stream.web.WritableStreamDefaultController");
|
|
26
|
+
const ByteLengthQueuingStrategy = globalThis.ByteLengthQueuingStrategy || /* @__PURE__ */ notImplemented("stream.web.ByteLengthQueuingStrategy");
|
|
27
|
+
const CountQueuingStrategy = globalThis.CountQueuingStrategy || /* @__PURE__ */ notImplemented("stream.web.CountQueuingStrategy");
|
|
28
|
+
const TextEncoderStream = globalThis.TextEncoderStream || /* @__PURE__ */ notImplemented("stream.web.TextEncoderStream");
|
|
29
|
+
const TextDecoderStream = globalThis.TextDecoderStream || /* @__PURE__ */ notImplemented("stream.web.TextDecoderStream");
|
|
30
|
+
const DecompressionStream = globalThis.DecompressionStream || /* @__PURE__ */ notImplemented("stream.web.DecompressionStream");
|
|
31
|
+
const CompressionStream = globalThis.DecompressionStream || /* @__PURE__ */ notImplemented("stream.web.CompressionStream");
|
|
32
|
+
var web_default = {
|
|
33
|
+
ReadableStream,
|
|
34
|
+
ReadableStreamDefaultReader,
|
|
35
|
+
ReadableStreamBYOBReader,
|
|
36
|
+
ReadableStreamBYOBRequest,
|
|
37
|
+
ReadableByteStreamController,
|
|
38
|
+
ReadableStreamDefaultController,
|
|
39
|
+
TransformStream,
|
|
40
|
+
TransformStreamDefaultController,
|
|
41
|
+
WritableStream,
|
|
42
|
+
WritableStreamDefaultWriter,
|
|
43
|
+
WritableStreamDefaultController,
|
|
44
|
+
ByteLengthQueuingStrategy,
|
|
45
|
+
CountQueuingStrategy,
|
|
46
|
+
TextEncoderStream,
|
|
47
|
+
TextDecoderStream,
|
|
48
|
+
DecompressionStream,
|
|
49
|
+
CompressionStream
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
export { ByteLengthQueuingStrategy, CompressionStream, CountQueuingStrategy, DecompressionStream, ReadableByteStreamController, ReadableStream, ReadableStreamBYOBReader, ReadableStreamBYOBRequest, ReadableStreamDefaultController, ReadableStreamDefaultReader, TextDecoderStream, TextEncoderStream, TransformStream, TransformStreamDefaultController, WritableStream, WritableStreamDefaultController, WritableStreamDefaultWriter, web_default as default };
|