initial commit
This commit is contained in:
21
node_modules/unenv/LICENSE
generated
vendored
Normal file
21
node_modules/unenv/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Pooya Parsa <pooya@pi0.io>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
138
node_modules/unenv/README.md
generated
vendored
Normal file
138
node_modules/unenv/README.md
generated
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
# unenv
|
||||
|
||||
Unenv is a framework agnostic system that allows converting JavaScript code to be platform agnostic and working in any environment including Browsers, Workers, Node.js or pure JavaScript runtime.
|
||||
|
||||
## Install
|
||||
|
||||
|
||||
```bash
|
||||
# Using npm
|
||||
npm i -D unenv
|
||||
|
||||
# Using yarn
|
||||
yarn add --dev unenv
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Using `env` utility and builtin presets ( and [nodeless](./src/presets/nodeless.ts)), unenv will provide an abstract config that can be used in building pipelines ([rollup.js](https://rollupjs.org), [webpack](https://webpack.js.org), etc)
|
||||
|
||||
```js
|
||||
import { env, node, nodeless } from 'unenv'
|
||||
|
||||
const { alias, inject, polyfill, external } = env(...presets)
|
||||
```
|
||||
|
||||
## Presets
|
||||
|
||||
### `node`
|
||||
|
||||
Suitable to convert universal libraries working in Node.js. ([preset]([node](./src/presets/node.ts)))
|
||||
|
||||
- Add support for global [`fetch` API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)
|
||||
- Set Node.js built-ins as externals
|
||||
|
||||
### `nodeless`
|
||||
|
||||
Using this preset, we can convert a code that is depending on Node.js to work anywhere else.
|
||||
|
||||
### Built-in Node.js modules
|
||||
|
||||
Unenv provides a replacement for all Node.js built-ins for cross-platform compatiblity.
|
||||
|
||||
Module | Status | Source
|
||||
-------|--------|---------------
|
||||
[node:assert](https://nodejs.org/api/assert.html) | Mocked | -
|
||||
[node:async_hooks](https://nodejs.org/api/async_hooks.html) | Mocked | -
|
||||
[node:buffer](https://nodejs.org/api/buffer.html) | Polyfilled | [unenv/node/buffer](./src/runtime/node/buffer)
|
||||
[node:child_process](https://nodejs.org/api/child_process.html) | Mocked | -
|
||||
[node:cluster](https://nodejs.org/api/cluster.html) | Mocked | -
|
||||
[node:console](https://nodejs.org/api/console.html) | Mocked | -
|
||||
[node:constants](https://nodejs.org/api/constants.html) | Mocked | -
|
||||
[node:crypto](https://nodejs.org/api/crypto.html) | Mocked | -
|
||||
[node:dgram](https://nodejs.org/api/dgram.html) | Mocked | -
|
||||
[node:diagnostics_channel](https://nodejs.org/api/diagnostics_channel.html) | Mocked | -
|
||||
[node:dns](https://nodejs.org/api/dns.html) | Mocked | -
|
||||
[node:domain](https://nodejs.org/api/domain.html) | Mocked | -
|
||||
[node:events](https://nodejs.org/api/events.html) | Polyfilled | [unenv/node/events](./src/runtime/node/events)
|
||||
[node:fs](https://nodejs.org/api/fs.html) | Polyfilled | [unenv/node/fs](./src/runtime/node/fs)
|
||||
[node:fs/promises](https://nodejs.org/api/fs/promises.html) | Polyfilled | [unenv/node/fs/promises](./src/runtime/node/fs/promises)
|
||||
[node:http2](https://nodejs.org/api/http2.html) | Mocked | -
|
||||
[node:http](https://nodejs.org/api/http.html) | Polyfilled | [unenv/node/http](./src/runtime/node/http)
|
||||
[node:https](https://nodejs.org/api/https.html) | Mocked | -
|
||||
[node:inspector](https://nodejs.org/api/inspector.html) | Mocked | -
|
||||
[node:module](https://nodejs.org/api/module.html) | Mocked | -
|
||||
[node:net](https://nodejs.org/api/net.html) | Polyfilled | [unenv/node/net](./src/runtime/node/net)
|
||||
[node:os](https://nodejs.org/api/os.html) | Mocked | -
|
||||
[node:path](https://nodejs.org/api/path.html) | Polyfilled | [unenv/node/path](./src/runtime/node/path)
|
||||
[node:perf_hooks](https://nodejs.org/api/perf_hooks.html) | Mocked | -
|
||||
[node:process](https://nodejs.org/api/process.html) | Polyfilled | [unenv/node/process](./src/runtime/node/process)
|
||||
[node:punycode](https://nodejs.org/api/punycode.html) | Mocked | -
|
||||
[node:querystring](https://nodejs.org/api/querystring.html) | Mocked | -
|
||||
[node:readline](https://nodejs.org/api/readline.html) | Mocked | -
|
||||
[node:repl](https://nodejs.org/api/repl.html) | Mocked | -
|
||||
[node:stream](https://nodejs.org/api/stream.html) | Polyfilled | [unenv/node/stream](./src/runtime/node/stream)
|
||||
[node:stream/consumers](https://nodejs.org/api/stream.html) | Mocked | [unenv/node/stream/consumers](./src/runtime/node/stream/consumers)
|
||||
[node:stream/promises](https://nodejs.org/api/stream.html) | Mocked | [unenv/node/stream/promises](./src/runtime/node/stream/promises)
|
||||
[node:stream/web](https://nodejs.org/api/stream.html) | Native | [unenv/node/stream/web](./src/runtime/node/stream/web)
|
||||
[node:string_decoder](https://nodejs.org/api/string_decoder.html) | Mocked | -
|
||||
[node:sys](https://nodejs.org/api/sys.html) | Mocked | -
|
||||
[node:timers](https://nodejs.org/api/timers.html) | Mocked | -
|
||||
[node:timers/promises](https://nodejs.org/api/timers.html) | Mocked | -
|
||||
[node:tls](https://nodejs.org/api/tls.html) | Mocked | -
|
||||
[node:trace_events](https://nodejs.org/api/trace_events.html) | Mocked | -
|
||||
[node:tty](https://nodejs.org/api/tty.html) | Mocked | -
|
||||
[node:url](https://nodejs.org/api/url.html) | Polyfilled | [unenv/node/url](./src/runtime/node/url)
|
||||
[node:util](https://nodejs.org/api/util.html) | Polyfilled | [unenv/node/util](./src/runtime/node/util)
|
||||
[node:util/types](https://nodejs.org/api/util.html) | Polyfilled | [unenv/node/util/types](./src/runtime/node/util/types)
|
||||
[node:v8](https://nodejs.org/api/v8.html) | Mocked | -
|
||||
[node:vm](https://nodejs.org/api/vm.html) | Mocked | -
|
||||
[node:wasi](https://nodejs.org/api/wasi.html) | Mocked | -
|
||||
[node:worker_threads](https://nodejs.org/api/worker_threads.html) | Mocked | -
|
||||
[node:zlib](https://nodejs.org/api/zlib.html) | Mocked | -
|
||||
|
||||
## npm packages
|
||||
|
||||
Unenv provides a replacement for common npm packages for cross platform compatibility.
|
||||
|
||||
Package | Status | Source
|
||||
-------|--------|---------------
|
||||
[npm/consola](https://www.npmjs.com/package/consola) | Use native `console` | [unenv/runtime/npm/consola](./src/runtime/npm/consola.ts)
|
||||
[npm/cross-fetch](https://www.npmjs.com/package/node-fetch) | Use native `fetch` | [unenv/runtime/npm/cross-fetch](./src/runtime/npm/cross-fetch.ts)
|
||||
[npm/debug](https://www.npmjs.com/package/debug) | Mocked with `console.debug` | [unenv/runtime/npm/debug](./src/runtime/npm/debug.ts)
|
||||
[npm/fsevents](https://www.npmjs.com/package/fsevents) | Mocked | [unenv/runtime/npm/fsevents](./src/runtime/npm/fsevents.ts)
|
||||
[npm/inherits](https://www.npmjs.com/package/inherits) | Inlined | [unenv/runtime/npm/inherits](./src/runtime/npm/inherits.ts)
|
||||
[npm/mime-db](https://www.npmjs.com/package/mime-db) | Minimized | [unenv/runtime/npm/mime-db](./src/runtime/npm/mime-db.ts)
|
||||
[npm/mime](https://www.npmjs.com/package/mime) | Minimized | [unenv/runtime/npm/mime](./src/runtime/npm/mime.ts)
|
||||
[npm/node-fetch](https://www.npmjs.com/package/node-fetch) | Use native `fetch` | [unenv/runtime/npm/node-fetch](./src/runtime/npm/node-fetch.ts)
|
||||
[npm/whatwg-url](https://www.npmjs.com/package/whatwg-url) | Use native `URL` | [unenv/runtime/npm/whatwg-url](./src/runtime/npm/whatwg-url.ts)
|
||||
|
||||
## Auto-mocking proxy
|
||||
|
||||
```js
|
||||
import MockProxy from 'unenv/runtime/mock/proxy'
|
||||
|
||||
console.log(MockProxy().foo.bar()[0])
|
||||
```
|
||||
|
||||
|
||||
|
||||
Above package doesn't works outside of Node.js and neither we need any platform specific logic! When aliasing `os` to `mock/proxy-cjs`, it will be auto mocked using a [Proxy Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) which can be recursively traversed like an `Object`, called like a `Function`, Iterated like an `Array`, or instantiated like a `Class`.
|
||||
|
||||
We use this proxy for auto mocking unimplemented internals. Imagine a packages does this:
|
||||
|
||||
```js
|
||||
const os = require('os')
|
||||
if (os.platform() === 'windows') { /* do some fix */ }
|
||||
module.exports = () => 'Hello world'
|
||||
```
|
||||
|
||||
By aliasing `os` to `unenv/runtime/mock/proxy-cjs`, code will be compatible in other platforms.
|
||||
|
||||
## Other polyfilles
|
||||
|
||||
Please check [./src/rutime](./src/runtime) to discover other polyfilles.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
121
node_modules/unenv/dist/index.cjs
generated
vendored
Normal file
121
node_modules/unenv/dist/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
'use strict';
|
||||
|
||||
const node_module = require('node:module');
|
||||
|
||||
const NodeBuiltinModules = [].concat(node_module.Module.builtinModules, [
|
||||
"assert/strict",
|
||||
"fs/promises",
|
||||
"path/posix",
|
||||
"path/win32",
|
||||
"stream/consumers",
|
||||
"stream/promises",
|
||||
"stream/web",
|
||||
"timers/promises",
|
||||
"util/types"
|
||||
]);
|
||||
function mapArrToVal(val, arr) {
|
||||
return Object.fromEntries(arr.map((c) => [c, val]));
|
||||
}
|
||||
|
||||
const node = {
|
||||
alias: {
|
||||
"node-fetch": "unenv/runtime/npm/node-fetch",
|
||||
"cross-fetch": "unenv/runtime/npm/cross-fetch",
|
||||
"cross-fetch/polyfill": "unenv/runtime/mock/empty",
|
||||
"isomorphic-fetch": "unenv/runtime/mock/empty"
|
||||
},
|
||||
polyfill: [
|
||||
"node-fetch-native/polyfill"
|
||||
],
|
||||
external: [
|
||||
...NodeBuiltinModules
|
||||
]
|
||||
};
|
||||
|
||||
const nodeless = {
|
||||
alias: {
|
||||
...mapArrToVal("unenv/runtime/mock/proxy-cjs", NodeBuiltinModules),
|
||||
...Object.fromEntries([
|
||||
"buffer",
|
||||
"events",
|
||||
"fs",
|
||||
"fs/promises",
|
||||
"http",
|
||||
"net",
|
||||
"path",
|
||||
"process",
|
||||
"stream",
|
||||
"stream/promises",
|
||||
"stream/consumers",
|
||||
"stream/web",
|
||||
"url",
|
||||
"util",
|
||||
"util/types"
|
||||
].map((m) => [m, `unenv/runtime/node/${m}/index`])),
|
||||
etag: "unenv/runtime/mock/noop",
|
||||
"mime-db": "unenv/runtime/npm/mime-db",
|
||||
mime: "unenv/runtime/npm/mime",
|
||||
"mime/lite": "unenv/runtime/npm/mime",
|
||||
_mime: "mime/lite.js",
|
||||
fsevents: "unenv/runtime/npm/fsevents",
|
||||
"node-fetch": "unenv/runtime/npm/node-fetch",
|
||||
"node-fetch-native": "unenv/runtime/npm/node-fetch",
|
||||
"node-fetch-native/polyfill": "unenv/runtime/mock/empty",
|
||||
"cross-fetch": "unenv/runtime/npm/cross-fetch",
|
||||
"cross-fetch/polyfill": "unenv/runtime/mock/empty",
|
||||
"isomorphic-fetch": "unenv/runtime/mock/empty",
|
||||
inherits: "unenv/runtime/npm/inherits"
|
||||
},
|
||||
inject: {
|
||||
process: "unenv/runtime/polyfill/process",
|
||||
Buffer: ["buffer", "Buffer"]
|
||||
},
|
||||
polyfill: [
|
||||
"unenv/runtime/polyfill/process"
|
||||
]
|
||||
};
|
||||
for (const m of NodeBuiltinModules) {
|
||||
nodeless.alias[`node:${m}`] = nodeless.alias[m];
|
||||
}
|
||||
|
||||
function env(...presets) {
|
||||
const _env = {
|
||||
alias: {},
|
||||
inject: {},
|
||||
polyfill: [],
|
||||
external: []
|
||||
};
|
||||
for (const preset of presets) {
|
||||
if (preset.alias) {
|
||||
const aliases = Object.keys(preset.alias).sort(
|
||||
(a, b) => b.split("/").length - a.split("/").length || b.length - a.length
|
||||
);
|
||||
for (const from of aliases) {
|
||||
_env.alias[from] = preset.alias[from];
|
||||
}
|
||||
}
|
||||
if (preset.inject) {
|
||||
for (const global in preset.inject) {
|
||||
if (Array.isArray(preset.inject[global])) {
|
||||
const [id, ...path] = preset.inject[global];
|
||||
_env.inject[global] = [id, ...path];
|
||||
} else {
|
||||
_env.inject[global] = preset.inject[global];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (preset.polyfill) {
|
||||
_env.polyfill.push(...preset.polyfill.filter(Boolean));
|
||||
}
|
||||
if (preset.external) {
|
||||
_env.external.push(...preset.external);
|
||||
}
|
||||
}
|
||||
return _env;
|
||||
}
|
||||
|
||||
exports.NodeBuiltinModules = NodeBuiltinModules;
|
||||
exports.env = env;
|
||||
exports.mapArrToVal = mapArrToVal;
|
||||
exports.node = node;
|
||||
exports.nodeless = nodeless;
|
||||
23
node_modules/unenv/dist/index.d.ts
generated
vendored
Normal file
23
node_modules/unenv/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
declare const NodeBuiltinModules: string[];
|
||||
declare function mapArrToVal(val: any, arr: any[]): any;
|
||||
|
||||
interface Environment {
|
||||
alias: {
|
||||
[key: string]: string;
|
||||
};
|
||||
inject: {
|
||||
[key: string]: string | string[];
|
||||
};
|
||||
polyfill: string[];
|
||||
external: string[];
|
||||
}
|
||||
interface Preset extends Partial<Environment> {
|
||||
}
|
||||
|
||||
declare const _default: Preset;
|
||||
|
||||
declare const nodeless: Preset;
|
||||
|
||||
declare function env(...presets: Preset[]): Environment;
|
||||
|
||||
export { Environment, NodeBuiltinModules, Preset, env, mapArrToVal, _default as node, nodeless };
|
||||
115
node_modules/unenv/dist/index.mjs
generated
vendored
Normal file
115
node_modules/unenv/dist/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
import { Module } from 'node:module';
|
||||
|
||||
const NodeBuiltinModules = [].concat(Module.builtinModules, [
|
||||
"assert/strict",
|
||||
"fs/promises",
|
||||
"path/posix",
|
||||
"path/win32",
|
||||
"stream/consumers",
|
||||
"stream/promises",
|
||||
"stream/web",
|
||||
"timers/promises",
|
||||
"util/types"
|
||||
]);
|
||||
function mapArrToVal(val, arr) {
|
||||
return Object.fromEntries(arr.map((c) => [c, val]));
|
||||
}
|
||||
|
||||
const node = {
|
||||
alias: {
|
||||
"node-fetch": "unenv/runtime/npm/node-fetch",
|
||||
"cross-fetch": "unenv/runtime/npm/cross-fetch",
|
||||
"cross-fetch/polyfill": "unenv/runtime/mock/empty",
|
||||
"isomorphic-fetch": "unenv/runtime/mock/empty"
|
||||
},
|
||||
polyfill: [
|
||||
"node-fetch-native/polyfill"
|
||||
],
|
||||
external: [
|
||||
...NodeBuiltinModules
|
||||
]
|
||||
};
|
||||
|
||||
const nodeless = {
|
||||
alias: {
|
||||
...mapArrToVal("unenv/runtime/mock/proxy-cjs", NodeBuiltinModules),
|
||||
...Object.fromEntries([
|
||||
"buffer",
|
||||
"events",
|
||||
"fs",
|
||||
"fs/promises",
|
||||
"http",
|
||||
"net",
|
||||
"path",
|
||||
"process",
|
||||
"stream",
|
||||
"stream/promises",
|
||||
"stream/consumers",
|
||||
"stream/web",
|
||||
"url",
|
||||
"util",
|
||||
"util/types"
|
||||
].map((m) => [m, `unenv/runtime/node/${m}/index`])),
|
||||
etag: "unenv/runtime/mock/noop",
|
||||
"mime-db": "unenv/runtime/npm/mime-db",
|
||||
mime: "unenv/runtime/npm/mime",
|
||||
"mime/lite": "unenv/runtime/npm/mime",
|
||||
_mime: "mime/lite.js",
|
||||
fsevents: "unenv/runtime/npm/fsevents",
|
||||
"node-fetch": "unenv/runtime/npm/node-fetch",
|
||||
"node-fetch-native": "unenv/runtime/npm/node-fetch",
|
||||
"node-fetch-native/polyfill": "unenv/runtime/mock/empty",
|
||||
"cross-fetch": "unenv/runtime/npm/cross-fetch",
|
||||
"cross-fetch/polyfill": "unenv/runtime/mock/empty",
|
||||
"isomorphic-fetch": "unenv/runtime/mock/empty",
|
||||
inherits: "unenv/runtime/npm/inherits"
|
||||
},
|
||||
inject: {
|
||||
process: "unenv/runtime/polyfill/process",
|
||||
Buffer: ["buffer", "Buffer"]
|
||||
},
|
||||
polyfill: [
|
||||
"unenv/runtime/polyfill/process"
|
||||
]
|
||||
};
|
||||
for (const m of NodeBuiltinModules) {
|
||||
nodeless.alias[`node:${m}`] = nodeless.alias[m];
|
||||
}
|
||||
|
||||
function env(...presets) {
|
||||
const _env = {
|
||||
alias: {},
|
||||
inject: {},
|
||||
polyfill: [],
|
||||
external: []
|
||||
};
|
||||
for (const preset of presets) {
|
||||
if (preset.alias) {
|
||||
const aliases = Object.keys(preset.alias).sort(
|
||||
(a, b) => b.split("/").length - a.split("/").length || b.length - a.length
|
||||
);
|
||||
for (const from of aliases) {
|
||||
_env.alias[from] = preset.alias[from];
|
||||
}
|
||||
}
|
||||
if (preset.inject) {
|
||||
for (const global in preset.inject) {
|
||||
if (Array.isArray(preset.inject[global])) {
|
||||
const [id, ...path] = preset.inject[global];
|
||||
_env.inject[global] = [id, ...path];
|
||||
} else {
|
||||
_env.inject[global] = preset.inject[global];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (preset.polyfill) {
|
||||
_env.polyfill.push(...preset.polyfill.filter(Boolean));
|
||||
}
|
||||
if (preset.external) {
|
||||
_env.external.push(...preset.external);
|
||||
}
|
||||
}
|
||||
return _env;
|
||||
}
|
||||
|
||||
export { NodeBuiltinModules, env, mapArrToVal, node, nodeless };
|
||||
49
node_modules/unenv/package.json
generated
vendored
Normal file
49
node_modules/unenv/package.json
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"name": "unenv",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"repository": "unjs/unenv",
|
||||
"license": "MIT",
|
||||
"exports": {
|
||||
".": {
|
||||
"require": "./dist/index.cjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs"
|
||||
},
|
||||
"./runtime/mock/proxy-cjs": "./runtime/mock/proxy.cjs",
|
||||
"./runtime/mock/proxy-cjs/*": "./runtime/mock/proxy.cjs",
|
||||
"./runtime/*": {
|
||||
"require": "./runtime/*.cjs",
|
||||
"types": "./runtime/*.d.ts",
|
||||
"import": "./runtime/*.mjs"
|
||||
}
|
||||
},
|
||||
"main": "./dist/index.cjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"files": [
|
||||
"dist",
|
||||
"runtime"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"lint": "eslint --ext .ts .",
|
||||
"prepack": "unbuild",
|
||||
"release": "standard-version && pnpm publish && git push --follow-tags"
|
||||
},
|
||||
"dependencies": {
|
||||
"defu": "^6.1.1",
|
||||
"mime": "^3.0.0",
|
||||
"node-fetch-native": "^1.0.1",
|
||||
"pathe": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.11.9",
|
||||
"consola": "^2.15.3",
|
||||
"eslint": "^8.27.0",
|
||||
"eslint-config-unjs": "^0.0.2",
|
||||
"standard-version": "^9.5.0",
|
||||
"typescript": "^4.8.4",
|
||||
"unbuild": "^0.9.4"
|
||||
},
|
||||
"packageManager": "pnpm@7.16.0"
|
||||
}
|
||||
1
node_modules/unenv/runtime/_internal/types.cjs
generated
vendored
Normal file
1
node_modules/unenv/runtime/_internal/types.cjs
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";
|
||||
5
node_modules/unenv/runtime/_internal/types.d.ts
generated
vendored
Normal file
5
node_modules/unenv/runtime/_internal/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export declare type Callback<E = Error | null | undefined> = (error?: E) => void;
|
||||
export declare type HeadersObject = {
|
||||
[key: string]: string | string[] | undefined;
|
||||
};
|
||||
export declare type BufferEncoding = any;
|
||||
0
node_modules/unenv/runtime/_internal/types.mjs
generated
vendored
Normal file
0
node_modules/unenv/runtime/_internal/types.mjs
generated
vendored
Normal file
38
node_modules/unenv/runtime/_internal/utils.cjs
generated
vendored
Normal file
38
node_modules/unenv/runtime/_internal/utils.cjs
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.mergeFns = mergeFns;
|
||||
exports.notImplemented = notImplemented;
|
||||
exports.rawHeaders = rawHeaders;
|
||||
|
||||
function rawHeaders(headers) {
|
||||
const rawHeaders2 = [];
|
||||
|
||||
for (const key in headers) {
|
||||
if (Array.isArray(headers[key])) {
|
||||
for (const h of headers[key]) {
|
||||
rawHeaders2.push(key, h);
|
||||
}
|
||||
} else {
|
||||
rawHeaders2.push(key, headers[key]);
|
||||
}
|
||||
}
|
||||
|
||||
return rawHeaders2;
|
||||
}
|
||||
|
||||
function mergeFns(...functions) {
|
||||
return function (...args) {
|
||||
for (const fn of functions) {
|
||||
fn(...args);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function notImplemented(name) {
|
||||
return () => {
|
||||
throw new Error(`[unenv] ${name} is not implemented yet!`);
|
||||
};
|
||||
}
|
||||
4
node_modules/unenv/runtime/_internal/utils.d.ts
generated
vendored
Normal file
4
node_modules/unenv/runtime/_internal/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type { HeadersObject } from "./types";
|
||||
export declare function rawHeaders(headers: HeadersObject): any[];
|
||||
export declare function mergeFns(...functions: Function[]): (...args: any[]) => void;
|
||||
export declare function notImplemented(name: string): () => any;
|
||||
25
node_modules/unenv/runtime/_internal/utils.mjs
generated
vendored
Normal file
25
node_modules/unenv/runtime/_internal/utils.mjs
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
export function rawHeaders(headers) {
|
||||
const rawHeaders2 = [];
|
||||
for (const key in headers) {
|
||||
if (Array.isArray(headers[key])) {
|
||||
for (const h of headers[key]) {
|
||||
rawHeaders2.push(key, h);
|
||||
}
|
||||
} else {
|
||||
rawHeaders2.push(key, headers[key]);
|
||||
}
|
||||
}
|
||||
return rawHeaders2;
|
||||
}
|
||||
export function mergeFns(...functions) {
|
||||
return function(...args) {
|
||||
for (const fn of functions) {
|
||||
fn(...args);
|
||||
}
|
||||
};
|
||||
}
|
||||
export function notImplemented(name) {
|
||||
return () => {
|
||||
throw new Error(`[unenv] ${name} is not implemented yet!`);
|
||||
};
|
||||
}
|
||||
47
node_modules/unenv/runtime/fetch/call.cjs
generated
vendored
Normal file
47
node_modules/unenv/runtime/fetch/call.cjs
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.createCall = createCall;
|
||||
|
||||
var _request = require("../node/http/_request.cjs");
|
||||
|
||||
var _response = require("../node/http/_response.cjs");
|
||||
|
||||
function createCall(handle) {
|
||||
return function callHandle(context) {
|
||||
const req = new _request.IncomingMessage();
|
||||
const res = new _response.ServerResponse(req);
|
||||
req.url = context.url || "/";
|
||||
req.method = context.method || "GET";
|
||||
req.headers = {};
|
||||
|
||||
if (context.headers) {
|
||||
const headerEntries = typeof context.headers.entries === "function" ? context.headers.entries() : Object.entries(context.headers);
|
||||
|
||||
for (const [name, value] of headerEntries) {
|
||||
if (!value) {
|
||||
continue;
|
||||
}
|
||||
|
||||
req.headers[name.toLowerCase()] = value;
|
||||
}
|
||||
}
|
||||
|
||||
req.headers.host = req.headers.host || context.host || "localhost";
|
||||
req.connection.encrypted = req.connection.encrypted || context.protocol === "https";
|
||||
req.body = context.body || null;
|
||||
return handle(req, res).then(() => {
|
||||
const r = {
|
||||
body: res._data || "",
|
||||
headers: res._headers,
|
||||
status: res.statusCode,
|
||||
statusText: res.statusMessage
|
||||
};
|
||||
req.destroy();
|
||||
res.destroy();
|
||||
return r;
|
||||
});
|
||||
};
|
||||
}
|
||||
20
node_modules/unenv/runtime/fetch/call.d.ts
generated
vendored
Normal file
20
node_modules/unenv/runtime/fetch/call.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import { IncomingMessage } from "../node/http/_request";
|
||||
import { ServerResponse } from "../node/http/_response";
|
||||
export declare type Handle = (req: IncomingMessage, res: ServerResponse) => Promise<any>;
|
||||
export declare type CallHandle = ReturnType<typeof createCall>;
|
||||
export interface CallContext {
|
||||
[key: string]: any;
|
||||
url?: string;
|
||||
method?: string;
|
||||
headers?: Headers | {
|
||||
[key: string]: string | string[];
|
||||
};
|
||||
protocol?: string;
|
||||
body?: any;
|
||||
}
|
||||
export declare function createCall(handle: Handle): (context: CallContext) => Promise<{
|
||||
body: BodyInit;
|
||||
headers: import("../_internal/types").HeadersObject;
|
||||
status: number;
|
||||
statusText: string;
|
||||
}>;
|
||||
34
node_modules/unenv/runtime/fetch/call.mjs
generated
vendored
Normal file
34
node_modules/unenv/runtime/fetch/call.mjs
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
import { IncomingMessage } from "../node/http/_request.mjs";
|
||||
import { ServerResponse } from "../node/http/_response.mjs";
|
||||
export function createCall(handle) {
|
||||
return function callHandle(context) {
|
||||
const req = new IncomingMessage();
|
||||
const res = new ServerResponse(req);
|
||||
req.url = context.url || "/";
|
||||
req.method = context.method || "GET";
|
||||
req.headers = {};
|
||||
if (context.headers) {
|
||||
const headerEntries = typeof context.headers.entries === "function" ? context.headers.entries() : Object.entries(context.headers);
|
||||
for (const [name, value] of headerEntries) {
|
||||
if (!value) {
|
||||
continue;
|
||||
}
|
||||
req.headers[name.toLowerCase()] = value;
|
||||
}
|
||||
}
|
||||
req.headers.host = req.headers.host || context.host || "localhost";
|
||||
req.connection.encrypted = req.connection.encrypted || context.protocol === "https";
|
||||
req.body = context.body || null;
|
||||
return handle(req, res).then(() => {
|
||||
const r = {
|
||||
body: res._data || "",
|
||||
headers: res._headers,
|
||||
status: res.statusCode,
|
||||
statusText: res.statusMessage
|
||||
};
|
||||
req.destroy();
|
||||
res.destroy();
|
||||
return r;
|
||||
});
|
||||
};
|
||||
}
|
||||
50
node_modules/unenv/runtime/fetch/index.cjs
generated
vendored
Normal file
50
node_modules/unenv/runtime/fetch/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var _exportNames = {
|
||||
createFetch: true
|
||||
};
|
||||
exports.createFetch = createFetch;
|
||||
|
||||
var _call = require("./call.cjs");
|
||||
|
||||
Object.keys(_call).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === _call[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _call[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function createFetch(call, _fetch = global.fetch) {
|
||||
return async function ufetch(input, init) {
|
||||
const url = input.toString();
|
||||
|
||||
if (!url.startsWith("/")) {
|
||||
return _fetch(url, init);
|
||||
}
|
||||
|
||||
try {
|
||||
const r = await call({
|
||||
url,
|
||||
...init
|
||||
});
|
||||
return new Response(r.body, {
|
||||
status: r.status,
|
||||
statusText: r.statusText,
|
||||
headers: Object.fromEntries(Object.entries(r.headers).map(([name, value]) => [name, Array.isArray(value) ? value.join(",") : value || ""]))
|
||||
});
|
||||
} catch (error) {
|
||||
return new Response(error.toString(), {
|
||||
status: Number.parseInt(error.statusCode || error.code) || 500,
|
||||
statusText: error.statusText
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
4
node_modules/unenv/runtime/fetch/index.d.ts
generated
vendored
Normal file
4
node_modules/unenv/runtime/fetch/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import { CallContext, CallHandle } from "./call";
|
||||
export * from "./call";
|
||||
export declare type FetchOptions = globalThis.RequestInit & CallContext;
|
||||
export declare function createFetch(call: CallHandle, _fetch?: typeof fetch): (input: string | Request, init: FetchOptions) => Promise<Response>;
|
||||
26
node_modules/unenv/runtime/fetch/index.mjs
generated
vendored
Normal file
26
node_modules/unenv/runtime/fetch/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
export * from "./call.mjs";
|
||||
export function createFetch(call, _fetch = global.fetch) {
|
||||
return async function ufetch(input, init) {
|
||||
const url = input.toString();
|
||||
if (!url.startsWith("/")) {
|
||||
return _fetch(url, init);
|
||||
}
|
||||
try {
|
||||
const r = await call({ url, ...init });
|
||||
return new Response(r.body, {
|
||||
status: r.status,
|
||||
statusText: r.statusText,
|
||||
headers: Object.fromEntries(
|
||||
Object.entries(r.headers).map(
|
||||
([name, value]) => [name, Array.isArray(value) ? value.join(",") : value || ""]
|
||||
)
|
||||
)
|
||||
});
|
||||
} catch (error) {
|
||||
return new Response(error.toString(), {
|
||||
status: Number.parseInt(error.statusCode || error.code) || 500,
|
||||
statusText: error.statusText
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
8
node_modules/unenv/runtime/mock/empty.cjs
generated
vendored
Normal file
8
node_modules/unenv/runtime/mock/empty.cjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
module.exports = void 0;
|
||||
var _default = {};
|
||||
module.exports = _default;
|
||||
2
node_modules/unenv/runtime/mock/empty.d.ts
generated
vendored
Normal file
2
node_modules/unenv/runtime/mock/empty.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
declare const _default: {};
|
||||
export default _default;
|
||||
1
node_modules/unenv/runtime/mock/empty.mjs
generated
vendored
Normal file
1
node_modules/unenv/runtime/mock/empty.mjs
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export default {};
|
||||
10
node_modules/unenv/runtime/mock/noop.cjs
generated
vendored
Normal file
10
node_modules/unenv/runtime/mock/noop.cjs
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
module.exports = void 0;
|
||||
|
||||
var _default = () => {};
|
||||
|
||||
module.exports = _default;
|
||||
2
node_modules/unenv/runtime/mock/noop.d.ts
generated
vendored
Normal file
2
node_modules/unenv/runtime/mock/noop.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
declare const _default: () => void;
|
||||
export default _default;
|
||||
2
node_modules/unenv/runtime/mock/noop.mjs
generated
vendored
Normal file
2
node_modules/unenv/runtime/mock/noop.mjs
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export default () => {
|
||||
};
|
||||
47
node_modules/unenv/runtime/mock/proxy.cjs
generated
vendored
Normal file
47
node_modules/unenv/runtime/mock/proxy.cjs
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
module.exports = void 0;
|
||||
|
||||
const fn = function () {};
|
||||
|
||||
function createMock(name, overrides = {}) {
|
||||
fn.prototype.name = name;
|
||||
const props = {};
|
||||
return new Proxy(fn, {
|
||||
get(_target, prop) {
|
||||
if (prop === "caller") {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (prop === "__createMock__") {
|
||||
return createMock;
|
||||
}
|
||||
|
||||
if (prop in overrides) {
|
||||
return overrides[prop];
|
||||
}
|
||||
|
||||
return props[prop] = props[prop] || createMock(`${name}.${prop.toString()}`);
|
||||
},
|
||||
|
||||
apply(_target, _this, _args) {
|
||||
return createMock(`${name}()`);
|
||||
},
|
||||
|
||||
construct(_target, _args, _newT) {
|
||||
return createMock(`[${name}]`);
|
||||
},
|
||||
|
||||
enumerate(_target) {
|
||||
return [];
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
var _default = createMock("mock");
|
||||
|
||||
module.exports = _default;
|
||||
2
node_modules/unenv/runtime/mock/proxy.d.ts
generated
vendored
Normal file
2
node_modules/unenv/runtime/mock/proxy.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
declare const _default: any;
|
||||
export default _default;
|
||||
30
node_modules/unenv/runtime/mock/proxy.mjs
generated
vendored
Normal file
30
node_modules/unenv/runtime/mock/proxy.mjs
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
const fn = function() {
|
||||
};
|
||||
function createMock(name, overrides = {}) {
|
||||
fn.prototype.name = name;
|
||||
const props = {};
|
||||
return new Proxy(fn, {
|
||||
get(_target, prop) {
|
||||
if (prop === "caller") {
|
||||
return null;
|
||||
}
|
||||
if (prop === "__createMock__") {
|
||||
return createMock;
|
||||
}
|
||||
if (prop in overrides) {
|
||||
return overrides[prop];
|
||||
}
|
||||
return props[prop] = props[prop] || createMock(`${name}.${prop.toString()}`);
|
||||
},
|
||||
apply(_target, _this, _args) {
|
||||
return createMock(`${name}()`);
|
||||
},
|
||||
construct(_target, _args, _newT) {
|
||||
return createMock(`[${name}]`);
|
||||
},
|
||||
enumerate(_target) {
|
||||
return [];
|
||||
}
|
||||
});
|
||||
}
|
||||
export default createMock("mock");
|
||||
117
node_modules/unenv/runtime/node/buffer/_base64.cjs
generated
vendored
Normal file
117
node_modules/unenv/runtime/node/buffer/_base64.cjs
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.byteLength = byteLength;
|
||||
exports.fromByteArray = fromByteArray;
|
||||
exports.toByteArray = toByteArray;
|
||||
const lookup = [];
|
||||
const revLookup = [];
|
||||
const Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
|
||||
const code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
for (let i = 0, len = code.length; i < len; ++i) {
|
||||
lookup[i] = code[i];
|
||||
revLookup[code.charCodeAt(i)] = i;
|
||||
}
|
||||
|
||||
revLookup["-".charCodeAt(0)] = 62;
|
||||
revLookup["_".charCodeAt(0)] = 63;
|
||||
|
||||
function getLens(b64) {
|
||||
const len = b64.length;
|
||||
|
||||
if (len % 4 > 0) {
|
||||
throw new Error("Invalid string. Length must be a multiple of 4");
|
||||
}
|
||||
|
||||
let validLen = b64.indexOf("=");
|
||||
|
||||
if (validLen === -1) {
|
||||
validLen = len;
|
||||
}
|
||||
|
||||
const placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4;
|
||||
return [validLen, placeHoldersLen];
|
||||
}
|
||||
|
||||
function byteLength(b64) {
|
||||
const lens = getLens(b64);
|
||||
const validLen = lens[0];
|
||||
const placeHoldersLen = lens[1];
|
||||
return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
|
||||
}
|
||||
|
||||
function _byteLength(b64, validLen, placeHoldersLen) {
|
||||
return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
|
||||
}
|
||||
|
||||
function toByteArray(b64) {
|
||||
let tmp;
|
||||
const lens = getLens(b64);
|
||||
const validLen = lens[0];
|
||||
const placeHoldersLen = lens[1];
|
||||
const arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
|
||||
let curByte = 0;
|
||||
const len = placeHoldersLen > 0 ? validLen - 4 : validLen;
|
||||
let i;
|
||||
|
||||
for (i = 0; i < len; i += 4) {
|
||||
tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
|
||||
arr[curByte++] = tmp >> 16 & 255;
|
||||
arr[curByte++] = tmp >> 8 & 255;
|
||||
arr[curByte++] = tmp & 255;
|
||||
}
|
||||
|
||||
if (placeHoldersLen === 2) {
|
||||
tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
|
||||
arr[curByte++] = tmp & 255;
|
||||
}
|
||||
|
||||
if (placeHoldersLen === 1) {
|
||||
tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
|
||||
arr[curByte++] = tmp >> 8 & 255;
|
||||
arr[curByte++] = tmp & 255;
|
||||
}
|
||||
|
||||
return arr;
|
||||
}
|
||||
|
||||
function tripletToBase64(num) {
|
||||
return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];
|
||||
}
|
||||
|
||||
function encodeChunk(uint8, start, end) {
|
||||
let tmp;
|
||||
const output = [];
|
||||
|
||||
for (let i = start; i < end; i += 3) {
|
||||
tmp = (uint8[i] << 16 & 16711680) + (uint8[i + 1] << 8 & 65280) + (uint8[i + 2] & 255);
|
||||
output.push(tripletToBase64(tmp));
|
||||
}
|
||||
|
||||
return output.join("");
|
||||
}
|
||||
|
||||
function fromByteArray(uint8) {
|
||||
let tmp;
|
||||
const len = uint8.length;
|
||||
const extraBytes = len % 3;
|
||||
const parts = [];
|
||||
const maxChunkLength = 16383;
|
||||
|
||||
for (let i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
|
||||
parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
|
||||
}
|
||||
|
||||
if (extraBytes === 1) {
|
||||
tmp = uint8[len - 1];
|
||||
parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "==");
|
||||
} else if (extraBytes === 2) {
|
||||
tmp = (uint8[len - 2] << 8) + uint8[len - 1];
|
||||
parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "=");
|
||||
}
|
||||
|
||||
return parts.join("");
|
||||
}
|
||||
3
node_modules/unenv/runtime/node/buffer/_base64.d.ts
generated
vendored
Normal file
3
node_modules/unenv/runtime/node/buffer/_base64.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export declare function byteLength(b64: any): number;
|
||||
export declare function toByteArray(b64: any): any[] | Uint8Array;
|
||||
export declare function fromByteArray(uint8: any): string;
|
||||
91
node_modules/unenv/runtime/node/buffer/_base64.mjs
generated
vendored
Normal file
91
node_modules/unenv/runtime/node/buffer/_base64.mjs
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
const lookup = [];
|
||||
const revLookup = [];
|
||||
const Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
|
||||
const code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
for (let i = 0, len = code.length; i < len; ++i) {
|
||||
lookup[i] = code[i];
|
||||
revLookup[code.charCodeAt(i)] = i;
|
||||
}
|
||||
revLookup["-".charCodeAt(0)] = 62;
|
||||
revLookup["_".charCodeAt(0)] = 63;
|
||||
function getLens(b64) {
|
||||
const len = b64.length;
|
||||
if (len % 4 > 0) {
|
||||
throw new Error("Invalid string. Length must be a multiple of 4");
|
||||
}
|
||||
let validLen = b64.indexOf("=");
|
||||
if (validLen === -1) {
|
||||
validLen = len;
|
||||
}
|
||||
const placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4;
|
||||
return [validLen, placeHoldersLen];
|
||||
}
|
||||
export function byteLength(b64) {
|
||||
const lens = getLens(b64);
|
||||
const validLen = lens[0];
|
||||
const placeHoldersLen = lens[1];
|
||||
return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
|
||||
}
|
||||
function _byteLength(b64, validLen, placeHoldersLen) {
|
||||
return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
|
||||
}
|
||||
export function toByteArray(b64) {
|
||||
let tmp;
|
||||
const lens = getLens(b64);
|
||||
const validLen = lens[0];
|
||||
const placeHoldersLen = lens[1];
|
||||
const arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
|
||||
let curByte = 0;
|
||||
const len = placeHoldersLen > 0 ? validLen - 4 : validLen;
|
||||
let i;
|
||||
for (i = 0; i < len; i += 4) {
|
||||
tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
|
||||
arr[curByte++] = tmp >> 16 & 255;
|
||||
arr[curByte++] = tmp >> 8 & 255;
|
||||
arr[curByte++] = tmp & 255;
|
||||
}
|
||||
if (placeHoldersLen === 2) {
|
||||
tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
|
||||
arr[curByte++] = tmp & 255;
|
||||
}
|
||||
if (placeHoldersLen === 1) {
|
||||
tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
|
||||
arr[curByte++] = tmp >> 8 & 255;
|
||||
arr[curByte++] = tmp & 255;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
function tripletToBase64(num) {
|
||||
return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];
|
||||
}
|
||||
function encodeChunk(uint8, start, end) {
|
||||
let tmp;
|
||||
const output = [];
|
||||
for (let i = start; i < end; i += 3) {
|
||||
tmp = (uint8[i] << 16 & 16711680) + (uint8[i + 1] << 8 & 65280) + (uint8[i + 2] & 255);
|
||||
output.push(tripletToBase64(tmp));
|
||||
}
|
||||
return output.join("");
|
||||
}
|
||||
export function fromByteArray(uint8) {
|
||||
let tmp;
|
||||
const len = uint8.length;
|
||||
const extraBytes = len % 3;
|
||||
const parts = [];
|
||||
const maxChunkLength = 16383;
|
||||
for (let i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
|
||||
parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
|
||||
}
|
||||
if (extraBytes === 1) {
|
||||
tmp = uint8[len - 1];
|
||||
parts.push(
|
||||
lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="
|
||||
);
|
||||
} else if (extraBytes === 2) {
|
||||
tmp = (uint8[len - 2] << 8) + uint8[len - 1];
|
||||
parts.push(
|
||||
lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="
|
||||
);
|
||||
}
|
||||
return parts.join("");
|
||||
}
|
||||
2249
node_modules/unenv/runtime/node/buffer/_buffer.cjs
generated
vendored
Normal file
2249
node_modules/unenv/runtime/node/buffer/_buffer.cjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
26
node_modules/unenv/runtime/node/buffer/_buffer.d.ts
generated
vendored
Normal file
26
node_modules/unenv/runtime/node/buffer/_buffer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
export declare const INSPECT_MAX_BYTES = 50;
|
||||
export declare const kMaxLength = 2147483647;
|
||||
/**
|
||||
* The Buffer constructor returns instances of `Uint8Array` that have their
|
||||
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
|
||||
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
|
||||
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
|
||||
* returns a single octet.
|
||||
*
|
||||
* The `Uint8Array` prototype remains unmodified.
|
||||
*/
|
||||
export declare function Buffer(arg: any, encodingOrOffset: any, length: any): any;
|
||||
export declare namespace Buffer {
|
||||
var TYPED_ARRAY_SUPPORT: boolean;
|
||||
var poolSize: number;
|
||||
var from: (value: any, encodingOrOffset: any, length: any) => any;
|
||||
var alloc: (size: any, fill: any, encoding: any) => Uint8Array;
|
||||
var allocUnsafe: (size: any) => Uint8Array;
|
||||
var allocUnsafeSlow: (size: any) => Uint8Array;
|
||||
var isBuffer: (b: any) => boolean;
|
||||
var compare: (a: any, b: any) => 0 | 1 | -1;
|
||||
var isEncoding: (encoding: any) => boolean;
|
||||
var concat: (list: any, length: any) => Uint8Array;
|
||||
var byteLength: (string: any, encoding: any) => any;
|
||||
}
|
||||
export declare function SlowBuffer(length: any): Uint8Array;
|
||||
1773
node_modules/unenv/runtime/node/buffer/_buffer.mjs
generated
vendored
Normal file
1773
node_modules/unenv/runtime/node/buffer/_buffer.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
111
node_modules/unenv/runtime/node/buffer/_ieee754.cjs
generated
vendored
Normal file
111
node_modules/unenv/runtime/node/buffer/_ieee754.cjs
generated
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.read = read;
|
||||
exports.write = write;
|
||||
|
||||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
function read(buffer, offset, isLE, mLen, nBytes) {
|
||||
let e, m;
|
||||
const eLen = nBytes * 8 - mLen - 1;
|
||||
const eMax = (1 << eLen) - 1;
|
||||
const eBias = eMax >> 1;
|
||||
let nBits = -7;
|
||||
let i = isLE ? nBytes - 1 : 0;
|
||||
const d = isLE ? -1 : 1;
|
||||
let s = buffer[offset + i];
|
||||
i += d;
|
||||
e = s & (1 << -nBits) - 1;
|
||||
s >>= -nBits;
|
||||
nBits += eLen;
|
||||
|
||||
while (nBits > 0) {
|
||||
e = e * 256 + buffer[offset + i];
|
||||
i += d;
|
||||
nBits -= 8;
|
||||
}
|
||||
|
||||
m = e & (1 << -nBits) - 1;
|
||||
e >>= -nBits;
|
||||
nBits += mLen;
|
||||
|
||||
while (nBits > 0) {
|
||||
m = m * 256 + buffer[offset + i];
|
||||
i += d;
|
||||
nBits -= 8;
|
||||
}
|
||||
|
||||
if (e === 0) {
|
||||
e = 1 - eBias;
|
||||
} else if (e === eMax) {
|
||||
return m ? Number.NaN : (s ? -1 : 1) * Number.POSITIVE_INFINITY;
|
||||
} else {
|
||||
m = m + Math.pow(2, mLen);
|
||||
e = e - eBias;
|
||||
}
|
||||
|
||||
return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
|
||||
}
|
||||
|
||||
function write(buffer, value, offset, isLE, mLen, nBytes) {
|
||||
let e, m, c;
|
||||
let eLen = nBytes * 8 - mLen - 1;
|
||||
const eMax = (1 << eLen) - 1;
|
||||
const eBias = eMax >> 1;
|
||||
const rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
|
||||
let i = isLE ? 0 : nBytes - 1;
|
||||
const d = isLE ? 1 : -1;
|
||||
const s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
|
||||
value = Math.abs(value);
|
||||
|
||||
if (Number.isNaN(value) || value === Number.POSITIVE_INFINITY) {
|
||||
m = Number.isNaN(value) ? 1 : 0;
|
||||
e = eMax;
|
||||
} else {
|
||||
e = Math.floor(Math.log2(value));
|
||||
|
||||
if (value * (c = Math.pow(2, -e)) < 1) {
|
||||
e--;
|
||||
c *= 2;
|
||||
}
|
||||
|
||||
value += e + eBias >= 1 ? rt / c : rt * Math.pow(2, 1 - eBias);
|
||||
|
||||
if (value * c >= 2) {
|
||||
e++;
|
||||
c /= 2;
|
||||
}
|
||||
|
||||
if (e + eBias >= eMax) {
|
||||
m = 0;
|
||||
e = eMax;
|
||||
} else if (e + eBias >= 1) {
|
||||
m = (value * c - 1) * Math.pow(2, mLen);
|
||||
e = e + eBias;
|
||||
} else {
|
||||
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
|
||||
e = 0;
|
||||
}
|
||||
}
|
||||
|
||||
while (mLen >= 8) {
|
||||
buffer[offset + i] = m & 255;
|
||||
i += d;
|
||||
m /= 256;
|
||||
mLen -= 8;
|
||||
}
|
||||
|
||||
e = e << mLen | m;
|
||||
eLen += mLen;
|
||||
|
||||
while (eLen > 0) {
|
||||
buffer[offset + i] = e & 255;
|
||||
i += d;
|
||||
e /= 256;
|
||||
eLen -= 8;
|
||||
}
|
||||
|
||||
buffer[offset + i - d] |= s * 128;
|
||||
}
|
||||
3
node_modules/unenv/runtime/node/buffer/_ieee754.d.ts
generated
vendored
Normal file
3
node_modules/unenv/runtime/node/buffer/_ieee754.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
export declare function read(buffer: Uint8Array, offset: number, isLE: boolean, mLen: number, nBytes: number): number;
|
||||
export declare function write(buffer: Uint8Array, value: number, offset: number, isLE: boolean, mLen: number, nBytes: number): void;
|
||||
88
node_modules/unenv/runtime/node/buffer/_ieee754.mjs
generated
vendored
Normal file
88
node_modules/unenv/runtime/node/buffer/_ieee754.mjs
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
export function read(buffer, offset, isLE, mLen, nBytes) {
|
||||
let e, m;
|
||||
const eLen = nBytes * 8 - mLen - 1;
|
||||
const eMax = (1 << eLen) - 1;
|
||||
const eBias = eMax >> 1;
|
||||
let nBits = -7;
|
||||
let i = isLE ? nBytes - 1 : 0;
|
||||
const d = isLE ? -1 : 1;
|
||||
let s = buffer[offset + i];
|
||||
i += d;
|
||||
e = s & (1 << -nBits) - 1;
|
||||
s >>= -nBits;
|
||||
nBits += eLen;
|
||||
while (nBits > 0) {
|
||||
e = e * 256 + buffer[offset + i];
|
||||
i += d;
|
||||
nBits -= 8;
|
||||
}
|
||||
m = e & (1 << -nBits) - 1;
|
||||
e >>= -nBits;
|
||||
nBits += mLen;
|
||||
while (nBits > 0) {
|
||||
m = m * 256 + buffer[offset + i];
|
||||
i += d;
|
||||
nBits -= 8;
|
||||
}
|
||||
if (e === 0) {
|
||||
e = 1 - eBias;
|
||||
} else if (e === eMax) {
|
||||
return m ? Number.NaN : (s ? -1 : 1) * Number.POSITIVE_INFINITY;
|
||||
} else {
|
||||
m = m + Math.pow(2, mLen);
|
||||
e = e - eBias;
|
||||
}
|
||||
return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
|
||||
}
|
||||
export function write(buffer, value, offset, isLE, mLen, nBytes) {
|
||||
let e, m, c;
|
||||
let eLen = nBytes * 8 - mLen - 1;
|
||||
const eMax = (1 << eLen) - 1;
|
||||
const eBias = eMax >> 1;
|
||||
const rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
|
||||
let i = isLE ? 0 : nBytes - 1;
|
||||
const d = isLE ? 1 : -1;
|
||||
const s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
|
||||
value = Math.abs(value);
|
||||
if (Number.isNaN(value) || value === Number.POSITIVE_INFINITY) {
|
||||
m = Number.isNaN(value) ? 1 : 0;
|
||||
e = eMax;
|
||||
} else {
|
||||
e = Math.floor(Math.log2(value));
|
||||
if (value * (c = Math.pow(2, -e)) < 1) {
|
||||
e--;
|
||||
c *= 2;
|
||||
}
|
||||
value += e + eBias >= 1 ? rt / c : rt * Math.pow(2, 1 - eBias);
|
||||
if (value * c >= 2) {
|
||||
e++;
|
||||
c /= 2;
|
||||
}
|
||||
if (e + eBias >= eMax) {
|
||||
m = 0;
|
||||
e = eMax;
|
||||
} else if (e + eBias >= 1) {
|
||||
m = (value * c - 1) * Math.pow(2, mLen);
|
||||
e = e + eBias;
|
||||
} else {
|
||||
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
|
||||
e = 0;
|
||||
}
|
||||
}
|
||||
while (mLen >= 8) {
|
||||
buffer[offset + i] = m & 255;
|
||||
i += d;
|
||||
m /= 256;
|
||||
mLen -= 8;
|
||||
}
|
||||
e = e << mLen | m;
|
||||
eLen += mLen;
|
||||
while (eLen > 0) {
|
||||
buffer[offset + i] = e & 255;
|
||||
i += d;
|
||||
e /= 256;
|
||||
eLen -= 8;
|
||||
}
|
||||
buffer[offset + i - d] |= s * 128;
|
||||
}
|
||||
68
node_modules/unenv/runtime/node/buffer/index.cjs
generated
vendored
Normal file
68
node_modules/unenv/runtime/node/buffer/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.Blob = void 0;
|
||||
Object.defineProperty(exports, "Buffer", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _buffer.Buffer;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "INSPECT_MAX_BYTES", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _buffer.INSPECT_MAX_BYTES;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "SlowBuffer", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _buffer.SlowBuffer;
|
||||
}
|
||||
});
|
||||
module.exports = exports.constants = exports.btoa = exports.atob = void 0;
|
||||
Object.defineProperty(exports, "kMaxLength", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _buffer.kMaxLength;
|
||||
}
|
||||
});
|
||||
exports.transcode = exports.resolveObjectURL = exports.kStringMaxLength = void 0;
|
||||
|
||||
var _utils = require("../../_internal/utils.cjs");
|
||||
|
||||
var _buffer = require("./_buffer.cjs");
|
||||
|
||||
const Blob = globalThis.Blob;
|
||||
exports.Blob = Blob;
|
||||
const resolveObjectURL = (0, _utils.notImplemented)("buffer.resolveObjectURL");
|
||||
exports.resolveObjectURL = resolveObjectURL;
|
||||
const transcode = (0, _utils.notImplemented)("buffer.transcode");
|
||||
exports.transcode = transcode;
|
||||
const btoa = global.btoa;
|
||||
exports.btoa = btoa;
|
||||
const atob = globalThis.atob;
|
||||
exports.atob = atob;
|
||||
const kStringMaxLength = 0;
|
||||
exports.kStringMaxLength = kStringMaxLength;
|
||||
const constants = {
|
||||
MAX_LENGTH: _buffer.kMaxLength,
|
||||
MAX_STRING_LENGTH: kStringMaxLength
|
||||
};
|
||||
exports.constants = constants;
|
||||
var _default = {
|
||||
Buffer: _buffer.Buffer,
|
||||
SlowBuffer: _buffer.SlowBuffer,
|
||||
kMaxLength: _buffer.kMaxLength,
|
||||
INSPECT_MAX_BYTES: _buffer.INSPECT_MAX_BYTES,
|
||||
Blob,
|
||||
resolveObjectURL,
|
||||
transcode,
|
||||
btoa,
|
||||
atob,
|
||||
kStringMaxLength,
|
||||
constants
|
||||
};
|
||||
module.exports = _default;
|
||||
16
node_modules/unenv/runtime/node/buffer/index.d.ts
generated
vendored
Normal file
16
node_modules/unenv/runtime/node/buffer/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
export { Buffer, kMaxLength, INSPECT_MAX_BYTES, SlowBuffer } from "./_buffer";
|
||||
export declare const Blob: {
|
||||
new (blobParts?: BlobPart[], options?: BlobPropertyBag): Blob;
|
||||
prototype: Blob;
|
||||
};
|
||||
export declare const resolveObjectURL: () => any;
|
||||
export declare const transcode: () => any;
|
||||
export declare const btoa: typeof globalThis.btoa;
|
||||
export declare const atob: typeof globalThis.atob;
|
||||
export declare const kStringMaxLength = 0;
|
||||
export declare const constants: {
|
||||
MAX_LENGTH: number;
|
||||
MAX_STRING_LENGTH: number;
|
||||
};
|
||||
declare const _default: any;
|
||||
export default _default;
|
||||
23
node_modules/unenv/runtime/node/buffer/index.mjs
generated
vendored
Normal file
23
node_modules/unenv/runtime/node/buffer/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import { notImplemented } from "../../_internal/utils.mjs";
|
||||
import { Buffer, kMaxLength, INSPECT_MAX_BYTES, SlowBuffer } from "./_buffer.mjs";
|
||||
export { Buffer, kMaxLength, INSPECT_MAX_BYTES, SlowBuffer } from "./_buffer.mjs";
|
||||
export const Blob = globalThis.Blob;
|
||||
export const resolveObjectURL = notImplemented("buffer.resolveObjectURL");
|
||||
export const transcode = notImplemented("buffer.transcode");
|
||||
export const btoa = global.btoa;
|
||||
export const atob = globalThis.atob;
|
||||
export const kStringMaxLength = 0;
|
||||
export const constants = { MAX_LENGTH: kMaxLength, MAX_STRING_LENGTH: kStringMaxLength };
|
||||
export default {
|
||||
Buffer,
|
||||
SlowBuffer,
|
||||
kMaxLength,
|
||||
INSPECT_MAX_BYTES,
|
||||
Blob,
|
||||
resolveObjectURL,
|
||||
transcode,
|
||||
btoa,
|
||||
atob,
|
||||
kStringMaxLength,
|
||||
constants
|
||||
};
|
||||
496
node_modules/unenv/runtime/node/events/_events.cjs
generated
vendored
Normal file
496
node_modules/unenv/runtime/node/events/_events.cjs
generated
vendored
Normal file
@@ -0,0 +1,496 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.EventEmitter = EventEmitter;
|
||||
exports.once = once;
|
||||
const R = typeof Reflect === "object" ? Reflect : null;
|
||||
const ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply2(target, receiver, args) {
|
||||
return Function.prototype.apply.call(target, receiver, args);
|
||||
};
|
||||
let ReflectOwnKeys;
|
||||
|
||||
if (R && typeof R.ownKeys === "function") {
|
||||
ReflectOwnKeys = R.ownKeys;
|
||||
} else if (Object.getOwnPropertySymbols) {
|
||||
ReflectOwnKeys = function ReflectOwnKeys2(target) {
|
||||
return [...Object.getOwnPropertyNames(target), ...Object.getOwnPropertySymbols(target)];
|
||||
};
|
||||
} else {
|
||||
ReflectOwnKeys = function ReflectOwnKeys2(target) {
|
||||
return Object.getOwnPropertyNames(target);
|
||||
};
|
||||
}
|
||||
|
||||
function ProcessEmitWarning(warning) {
|
||||
if (console && console.warn) {
|
||||
console.warn(warning);
|
||||
}
|
||||
}
|
||||
|
||||
const NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) {
|
||||
return value !== value;
|
||||
};
|
||||
|
||||
function EventEmitter() {
|
||||
EventEmitter.init.call(this);
|
||||
}
|
||||
|
||||
EventEmitter.EventEmitter = EventEmitter;
|
||||
EventEmitter.prototype._events = void 0;
|
||||
EventEmitter.prototype._eventsCount = 0;
|
||||
EventEmitter.prototype._maxListeners = void 0;
|
||||
let defaultMaxListeners = 10;
|
||||
|
||||
function checkListener(listener) {
|
||||
if (typeof listener !== "function") {
|
||||
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
|
||||
}
|
||||
}
|
||||
|
||||
Object.defineProperty(EventEmitter, "defaultMaxListeners", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return defaultMaxListeners;
|
||||
},
|
||||
set: function (arg) {
|
||||
if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) {
|
||||
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + ".");
|
||||
}
|
||||
|
||||
defaultMaxListeners = arg;
|
||||
}
|
||||
});
|
||||
|
||||
EventEmitter.init = function () {
|
||||
if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
|
||||
this._events = /* @__PURE__ */Object.create(null);
|
||||
this._eventsCount = 0;
|
||||
}
|
||||
|
||||
this._maxListeners = this._maxListeners || void 0;
|
||||
};
|
||||
|
||||
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
|
||||
if (typeof n !== "number" || n < 0 || NumberIsNaN(n)) {
|
||||
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + ".");
|
||||
}
|
||||
|
||||
this._maxListeners = n;
|
||||
return this;
|
||||
};
|
||||
|
||||
function _getMaxListeners(that) {
|
||||
if (that._maxListeners === void 0) {
|
||||
return EventEmitter.defaultMaxListeners;
|
||||
}
|
||||
|
||||
return that._maxListeners;
|
||||
}
|
||||
|
||||
EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
|
||||
return _getMaxListeners(this);
|
||||
};
|
||||
|
||||
EventEmitter.prototype.emit = function emit(type) {
|
||||
const args = [];
|
||||
|
||||
for (let i = 1; i < arguments.length; i++) {
|
||||
args.push(arguments[i]);
|
||||
}
|
||||
|
||||
let doError = type === "error";
|
||||
const events = this._events;
|
||||
|
||||
if (events !== void 0) {
|
||||
doError = doError && events.error === void 0;
|
||||
} else if (!doError) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (doError) {
|
||||
let er;
|
||||
|
||||
if (args.length > 0) {
|
||||
er = args[0];
|
||||
}
|
||||
|
||||
if (er instanceof Error) {
|
||||
throw er;
|
||||
}
|
||||
|
||||
const err = new Error("Unhandled error." + (er ? " (" + er.message + ")" : ""));
|
||||
err.context = er;
|
||||
throw err;
|
||||
}
|
||||
|
||||
const handler = events[type];
|
||||
|
||||
if (handler === void 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typeof handler === "function") {
|
||||
ReflectApply(handler, this, args);
|
||||
} else {
|
||||
const len = handler.length;
|
||||
const listeners2 = arrayClone(handler, len);
|
||||
|
||||
for (let i = 0; i < len; ++i) {
|
||||
ReflectApply(listeners2[i], this, args);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
function _addListener(target, type, listener, prepend) {
|
||||
let m;
|
||||
let events;
|
||||
let existing;
|
||||
checkListener(listener);
|
||||
events = target._events;
|
||||
|
||||
if (events === void 0) {
|
||||
events = target._events = /* @__PURE__ */Object.create(null);
|
||||
target._eventsCount = 0;
|
||||
} else {
|
||||
if (events.newListener !== void 0) {
|
||||
target.emit("newListener", type, listener.listener ? listener.listener : listener);
|
||||
events = target._events;
|
||||
}
|
||||
|
||||
existing = events[type];
|
||||
}
|
||||
|
||||
if (existing === void 0) {
|
||||
existing = events[type] = listener;
|
||||
++target._eventsCount;
|
||||
} else {
|
||||
if (typeof existing === "function") {
|
||||
existing = events[type] = prepend ? [listener, existing] : [existing, listener];
|
||||
} else if (prepend) {
|
||||
existing.unshift(listener);
|
||||
} else {
|
||||
existing.push(listener);
|
||||
}
|
||||
|
||||
m = _getMaxListeners(target);
|
||||
|
||||
if (m > 0 && existing.length > m && !existing.warned) {
|
||||
existing.warned = true;
|
||||
const w = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
||||
w.name = "MaxListenersExceededWarning";
|
||||
w.emitter = target;
|
||||
w.type = type;
|
||||
w.count = existing.length;
|
||||
ProcessEmitWarning(w);
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
EventEmitter.prototype.addListener = function addListener(type, listener) {
|
||||
return _addListener(this, type, listener, false);
|
||||
};
|
||||
|
||||
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
|
||||
|
||||
EventEmitter.prototype.prependListener = function prependListener(type, listener) {
|
||||
return _addListener(this, type, listener, true);
|
||||
};
|
||||
|
||||
function onceWrapper() {
|
||||
if (!this.fired) {
|
||||
this.target.removeListener(this.type, this.wrapFn);
|
||||
this.fired = true;
|
||||
|
||||
if (arguments.length === 0) {
|
||||
return this.listener.call(this.target);
|
||||
}
|
||||
|
||||
return this.listener.apply(this.target, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
function _onceWrap(target, type, listener) {
|
||||
const state = {
|
||||
fired: false,
|
||||
wrapFn: void 0,
|
||||
target,
|
||||
type,
|
||||
listener
|
||||
};
|
||||
const wrapped = onceWrapper.bind(state);
|
||||
wrapped.listener = listener;
|
||||
state.wrapFn = wrapped;
|
||||
return wrapped;
|
||||
}
|
||||
|
||||
EventEmitter.prototype.once = function once2(type, listener) {
|
||||
checkListener(listener);
|
||||
this.on(type, _onceWrap(this, type, listener));
|
||||
return this;
|
||||
};
|
||||
|
||||
EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) {
|
||||
checkListener(listener);
|
||||
this.prependListener(type, _onceWrap(this, type, listener));
|
||||
return this;
|
||||
};
|
||||
|
||||
EventEmitter.prototype.removeListener = function removeListener(type, listener) {
|
||||
let position, i, originalListener;
|
||||
checkListener(listener);
|
||||
const events = this._events;
|
||||
|
||||
if (events === void 0) {
|
||||
return this;
|
||||
}
|
||||
|
||||
const list = events[type];
|
||||
|
||||
if (list === void 0) {
|
||||
return this;
|
||||
}
|
||||
|
||||
if (list === listener || list.listener === listener) {
|
||||
if (--this._eventsCount === 0) {
|
||||
this._events = /* @__PURE__ */Object.create(null);
|
||||
} else {
|
||||
delete events[type];
|
||||
|
||||
if (events.removeListener) {
|
||||
this.emit("removeListener", type, list.listener || listener);
|
||||
}
|
||||
}
|
||||
} else if (typeof list !== "function") {
|
||||
position = -1;
|
||||
|
||||
for (i = list.length - 1; i >= 0; i--) {
|
||||
if (list[i] === listener || list[i].listener === listener) {
|
||||
originalListener = list[i].listener;
|
||||
position = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (position < 0) {
|
||||
return this;
|
||||
}
|
||||
|
||||
if (position === 0) {
|
||||
list.shift();
|
||||
} else {
|
||||
spliceOne(list, position);
|
||||
}
|
||||
|
||||
if (list.length === 1) {
|
||||
events[type] = list[0];
|
||||
}
|
||||
|
||||
if (events.removeListener !== void 0) {
|
||||
this.emit("removeListener", type, originalListener || listener);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
|
||||
|
||||
EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) {
|
||||
let i;
|
||||
const events = this._events;
|
||||
|
||||
if (events === void 0) {
|
||||
return this;
|
||||
}
|
||||
|
||||
if (events.removeListener === void 0) {
|
||||
if (arguments.length === 0) {
|
||||
this._events = /* @__PURE__ */Object.create(null);
|
||||
this._eventsCount = 0;
|
||||
} else if (events[type] !== void 0) {
|
||||
if (--this._eventsCount === 0) {
|
||||
this._events = /* @__PURE__ */Object.create(null);
|
||||
} else {
|
||||
delete events[type];
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
if (arguments.length === 0) {
|
||||
const keys = Object.keys(events);
|
||||
let key;
|
||||
|
||||
for (i = 0; i < keys.length; ++i) {
|
||||
key = keys[i];
|
||||
|
||||
if (key === "removeListener") {
|
||||
continue;
|
||||
}
|
||||
|
||||
this.removeAllListeners(key);
|
||||
}
|
||||
|
||||
this.removeAllListeners("removeListener");
|
||||
this._events = /* @__PURE__ */Object.create(null);
|
||||
this._eventsCount = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
const listeners2 = events[type];
|
||||
|
||||
if (typeof listeners2 === "function") {
|
||||
this.removeListener(type, listeners2);
|
||||
} else if (listeners2 !== void 0) {
|
||||
for (i = listeners2.length - 1; i >= 0; i--) {
|
||||
this.removeListener(type, listeners2[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
function _listeners(target, type, unwrap) {
|
||||
const events = target._events;
|
||||
|
||||
if (events === void 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const evlistener = events[type];
|
||||
|
||||
if (evlistener === void 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (typeof evlistener === "function") {
|
||||
return unwrap ? [evlistener.listener || evlistener] : [evlistener];
|
||||
}
|
||||
|
||||
return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
|
||||
}
|
||||
|
||||
EventEmitter.prototype.listeners = function listeners(type) {
|
||||
return _listeners(this, type, true);
|
||||
};
|
||||
|
||||
EventEmitter.prototype.rawListeners = function rawListeners(type) {
|
||||
return _listeners(this, type, false);
|
||||
};
|
||||
|
||||
EventEmitter.listenerCount = function (emitter, type) {
|
||||
return typeof emitter.listenerCount === "function" ? emitter.listenerCount(type) : listenerCount.call(emitter, type);
|
||||
};
|
||||
|
||||
EventEmitter.prototype.listenerCount = listenerCount;
|
||||
|
||||
function listenerCount(type) {
|
||||
const events = this._events;
|
||||
|
||||
if (events !== void 0) {
|
||||
const evlistener = events[type];
|
||||
|
||||
if (typeof evlistener === "function") {
|
||||
return 1;
|
||||
} else if (evlistener !== void 0) {
|
||||
return evlistener.length;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
EventEmitter.prototype.eventNames = function eventNames() {
|
||||
return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
|
||||
};
|
||||
|
||||
function arrayClone(arr, n) {
|
||||
const copy = new Array(n);
|
||||
|
||||
for (let i = 0; i < n; ++i) {
|
||||
copy[i] = arr[i];
|
||||
}
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
function spliceOne(list, index) {
|
||||
for (; index + 1 < list.length; index++) {
|
||||
list[index] = list[index + 1];
|
||||
}
|
||||
|
||||
list.pop();
|
||||
}
|
||||
|
||||
function unwrapListeners(arr) {
|
||||
const ret = Array.from({
|
||||
length: arr.length
|
||||
});
|
||||
|
||||
for (let i = 0; i < ret.length; ++i) {
|
||||
ret[i] = arr[i].listener || arr[i];
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
function once(emitter, name) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
function errorListener(err) {
|
||||
emitter.removeListener(name, resolver);
|
||||
reject(err);
|
||||
}
|
||||
|
||||
function resolver() {
|
||||
if (typeof emitter.removeListener === "function") {
|
||||
emitter.removeListener("error", errorListener);
|
||||
}
|
||||
|
||||
resolve(Array.prototype.slice.call(arguments));
|
||||
}
|
||||
|
||||
;
|
||||
eventTargetAgnosticAddListener(emitter, name, resolver, {
|
||||
once: true
|
||||
});
|
||||
|
||||
if (name !== "error") {
|
||||
addErrorHandlerIfEventEmitter(emitter, errorListener, {
|
||||
once: true
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
|
||||
if (typeof emitter.on === "function") {
|
||||
eventTargetAgnosticAddListener(emitter, "error", handler, flags);
|
||||
}
|
||||
}
|
||||
|
||||
function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
|
||||
if (typeof emitter.on === "function") {
|
||||
if (flags.once) {
|
||||
emitter.once(name, listener);
|
||||
} else {
|
||||
emitter.on(name, listener);
|
||||
}
|
||||
} else if (typeof emitter.addEventListener === "function") {
|
||||
emitter.addEventListener(name, function wrapListener(arg) {
|
||||
if (flags.once) {
|
||||
emitter.removeEventListener(name, wrapListener);
|
||||
}
|
||||
|
||||
listener(arg);
|
||||
});
|
||||
} else {
|
||||
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
|
||||
}
|
||||
}
|
||||
7
node_modules/unenv/runtime/node/events/_events.d.ts
generated
vendored
Normal file
7
node_modules/unenv/runtime/node/events/_events.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export declare function EventEmitter(): void;
|
||||
export declare namespace EventEmitter {
|
||||
var EventEmitter: typeof import("./_events").EventEmitter;
|
||||
var init: () => void;
|
||||
var listenerCount: (emitter: any, type: any) => any;
|
||||
}
|
||||
export declare function once(emitter: any, name: any): Promise<unknown>;
|
||||
380
node_modules/unenv/runtime/node/events/_events.mjs
generated
vendored
Normal file
380
node_modules/unenv/runtime/node/events/_events.mjs
generated
vendored
Normal file
@@ -0,0 +1,380 @@
|
||||
const R = typeof Reflect === "object" ? Reflect : null;
|
||||
const ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply2(target, receiver, args) {
|
||||
return Function.prototype.apply.call(target, receiver, args);
|
||||
};
|
||||
let ReflectOwnKeys;
|
||||
if (R && typeof R.ownKeys === "function") {
|
||||
ReflectOwnKeys = R.ownKeys;
|
||||
} else if (Object.getOwnPropertySymbols) {
|
||||
ReflectOwnKeys = function ReflectOwnKeys2(target) {
|
||||
return [
|
||||
...Object.getOwnPropertyNames(target),
|
||||
...Object.getOwnPropertySymbols(target)
|
||||
];
|
||||
};
|
||||
} else {
|
||||
ReflectOwnKeys = function ReflectOwnKeys2(target) {
|
||||
return Object.getOwnPropertyNames(target);
|
||||
};
|
||||
}
|
||||
function ProcessEmitWarning(warning) {
|
||||
if (console && console.warn) {
|
||||
console.warn(warning);
|
||||
}
|
||||
}
|
||||
const NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) {
|
||||
return value !== value;
|
||||
};
|
||||
export function EventEmitter() {
|
||||
EventEmitter.init.call(this);
|
||||
}
|
||||
EventEmitter.EventEmitter = EventEmitter;
|
||||
EventEmitter.prototype._events = void 0;
|
||||
EventEmitter.prototype._eventsCount = 0;
|
||||
EventEmitter.prototype._maxListeners = void 0;
|
||||
let defaultMaxListeners = 10;
|
||||
function checkListener(listener) {
|
||||
if (typeof listener !== "function") {
|
||||
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
|
||||
}
|
||||
}
|
||||
Object.defineProperty(EventEmitter, "defaultMaxListeners", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return defaultMaxListeners;
|
||||
},
|
||||
set: function(arg) {
|
||||
if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) {
|
||||
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + ".");
|
||||
}
|
||||
defaultMaxListeners = arg;
|
||||
}
|
||||
});
|
||||
EventEmitter.init = function() {
|
||||
if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
|
||||
this._events = /* @__PURE__ */ Object.create(null);
|
||||
this._eventsCount = 0;
|
||||
}
|
||||
this._maxListeners = this._maxListeners || void 0;
|
||||
};
|
||||
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
|
||||
if (typeof n !== "number" || n < 0 || NumberIsNaN(n)) {
|
||||
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + ".");
|
||||
}
|
||||
this._maxListeners = n;
|
||||
return this;
|
||||
};
|
||||
function _getMaxListeners(that) {
|
||||
if (that._maxListeners === void 0) {
|
||||
return EventEmitter.defaultMaxListeners;
|
||||
}
|
||||
return that._maxListeners;
|
||||
}
|
||||
EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
|
||||
return _getMaxListeners(this);
|
||||
};
|
||||
EventEmitter.prototype.emit = function emit(type) {
|
||||
const args = [];
|
||||
for (let i = 1; i < arguments.length; i++) {
|
||||
args.push(arguments[i]);
|
||||
}
|
||||
let doError = type === "error";
|
||||
const events = this._events;
|
||||
if (events !== void 0) {
|
||||
doError = doError && events.error === void 0;
|
||||
} else if (!doError) {
|
||||
return false;
|
||||
}
|
||||
if (doError) {
|
||||
let er;
|
||||
if (args.length > 0) {
|
||||
er = args[0];
|
||||
}
|
||||
if (er instanceof Error) {
|
||||
throw er;
|
||||
}
|
||||
const err = new Error("Unhandled error." + (er ? " (" + er.message + ")" : ""));
|
||||
err.context = er;
|
||||
throw err;
|
||||
}
|
||||
const handler = events[type];
|
||||
if (handler === void 0) {
|
||||
return false;
|
||||
}
|
||||
if (typeof handler === "function") {
|
||||
ReflectApply(handler, this, args);
|
||||
} else {
|
||||
const len = handler.length;
|
||||
const listeners2 = arrayClone(handler, len);
|
||||
for (let i = 0; i < len; ++i) {
|
||||
ReflectApply(listeners2[i], this, args);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
function _addListener(target, type, listener, prepend) {
|
||||
let m;
|
||||
let events;
|
||||
let existing;
|
||||
checkListener(listener);
|
||||
events = target._events;
|
||||
if (events === void 0) {
|
||||
events = target._events = /* @__PURE__ */ Object.create(null);
|
||||
target._eventsCount = 0;
|
||||
} else {
|
||||
if (events.newListener !== void 0) {
|
||||
target.emit("newListener", type, listener.listener ? listener.listener : listener);
|
||||
events = target._events;
|
||||
}
|
||||
existing = events[type];
|
||||
}
|
||||
if (existing === void 0) {
|
||||
existing = events[type] = listener;
|
||||
++target._eventsCount;
|
||||
} else {
|
||||
if (typeof existing === "function") {
|
||||
existing = events[type] = prepend ? [listener, existing] : [existing, listener];
|
||||
} else if (prepend) {
|
||||
existing.unshift(listener);
|
||||
} else {
|
||||
existing.push(listener);
|
||||
}
|
||||
m = _getMaxListeners(target);
|
||||
if (m > 0 && existing.length > m && !existing.warned) {
|
||||
existing.warned = true;
|
||||
const w = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
||||
w.name = "MaxListenersExceededWarning";
|
||||
w.emitter = target;
|
||||
w.type = type;
|
||||
w.count = existing.length;
|
||||
ProcessEmitWarning(w);
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
EventEmitter.prototype.addListener = function addListener(type, listener) {
|
||||
return _addListener(this, type, listener, false);
|
||||
};
|
||||
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
|
||||
EventEmitter.prototype.prependListener = function prependListener(type, listener) {
|
||||
return _addListener(this, type, listener, true);
|
||||
};
|
||||
function onceWrapper() {
|
||||
if (!this.fired) {
|
||||
this.target.removeListener(this.type, this.wrapFn);
|
||||
this.fired = true;
|
||||
if (arguments.length === 0) {
|
||||
return this.listener.call(this.target);
|
||||
}
|
||||
return this.listener.apply(this.target, arguments);
|
||||
}
|
||||
}
|
||||
function _onceWrap(target, type, listener) {
|
||||
const state = { fired: false, wrapFn: void 0, target, type, listener };
|
||||
const wrapped = onceWrapper.bind(state);
|
||||
wrapped.listener = listener;
|
||||
state.wrapFn = wrapped;
|
||||
return wrapped;
|
||||
}
|
||||
EventEmitter.prototype.once = function once2(type, listener) {
|
||||
checkListener(listener);
|
||||
this.on(type, _onceWrap(this, type, listener));
|
||||
return this;
|
||||
};
|
||||
EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) {
|
||||
checkListener(listener);
|
||||
this.prependListener(type, _onceWrap(this, type, listener));
|
||||
return this;
|
||||
};
|
||||
EventEmitter.prototype.removeListener = function removeListener(type, listener) {
|
||||
let position, i, originalListener;
|
||||
checkListener(listener);
|
||||
const events = this._events;
|
||||
if (events === void 0) {
|
||||
return this;
|
||||
}
|
||||
const list = events[type];
|
||||
if (list === void 0) {
|
||||
return this;
|
||||
}
|
||||
if (list === listener || list.listener === listener) {
|
||||
if (--this._eventsCount === 0) {
|
||||
this._events = /* @__PURE__ */ Object.create(null);
|
||||
} else {
|
||||
delete events[type];
|
||||
if (events.removeListener) {
|
||||
this.emit("removeListener", type, list.listener || listener);
|
||||
}
|
||||
}
|
||||
} else if (typeof list !== "function") {
|
||||
position = -1;
|
||||
for (i = list.length - 1; i >= 0; i--) {
|
||||
if (list[i] === listener || list[i].listener === listener) {
|
||||
originalListener = list[i].listener;
|
||||
position = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (position < 0) {
|
||||
return this;
|
||||
}
|
||||
if (position === 0) {
|
||||
list.shift();
|
||||
} else {
|
||||
spliceOne(list, position);
|
||||
}
|
||||
if (list.length === 1) {
|
||||
events[type] = list[0];
|
||||
}
|
||||
if (events.removeListener !== void 0) {
|
||||
this.emit("removeListener", type, originalListener || listener);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
|
||||
EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) {
|
||||
let i;
|
||||
const events = this._events;
|
||||
if (events === void 0) {
|
||||
return this;
|
||||
}
|
||||
if (events.removeListener === void 0) {
|
||||
if (arguments.length === 0) {
|
||||
this._events = /* @__PURE__ */ Object.create(null);
|
||||
this._eventsCount = 0;
|
||||
} else if (events[type] !== void 0) {
|
||||
if (--this._eventsCount === 0) {
|
||||
this._events = /* @__PURE__ */ Object.create(null);
|
||||
} else {
|
||||
delete events[type];
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
if (arguments.length === 0) {
|
||||
const keys = Object.keys(events);
|
||||
let key;
|
||||
for (i = 0; i < keys.length; ++i) {
|
||||
key = keys[i];
|
||||
if (key === "removeListener") {
|
||||
continue;
|
||||
}
|
||||
this.removeAllListeners(key);
|
||||
}
|
||||
this.removeAllListeners("removeListener");
|
||||
this._events = /* @__PURE__ */ Object.create(null);
|
||||
this._eventsCount = 0;
|
||||
return this;
|
||||
}
|
||||
const listeners2 = events[type];
|
||||
if (typeof listeners2 === "function") {
|
||||
this.removeListener(type, listeners2);
|
||||
} else if (listeners2 !== void 0) {
|
||||
for (i = listeners2.length - 1; i >= 0; i--) {
|
||||
this.removeListener(type, listeners2[i]);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
function _listeners(target, type, unwrap) {
|
||||
const events = target._events;
|
||||
if (events === void 0) {
|
||||
return [];
|
||||
}
|
||||
const evlistener = events[type];
|
||||
if (evlistener === void 0) {
|
||||
return [];
|
||||
}
|
||||
if (typeof evlistener === "function") {
|
||||
return unwrap ? [evlistener.listener || evlistener] : [evlistener];
|
||||
}
|
||||
return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
|
||||
}
|
||||
EventEmitter.prototype.listeners = function listeners(type) {
|
||||
return _listeners(this, type, true);
|
||||
};
|
||||
EventEmitter.prototype.rawListeners = function rawListeners(type) {
|
||||
return _listeners(this, type, false);
|
||||
};
|
||||
EventEmitter.listenerCount = function(emitter, type) {
|
||||
return typeof emitter.listenerCount === "function" ? emitter.listenerCount(type) : listenerCount.call(emitter, type);
|
||||
};
|
||||
EventEmitter.prototype.listenerCount = listenerCount;
|
||||
function listenerCount(type) {
|
||||
const events = this._events;
|
||||
if (events !== void 0) {
|
||||
const evlistener = events[type];
|
||||
if (typeof evlistener === "function") {
|
||||
return 1;
|
||||
} else if (evlistener !== void 0) {
|
||||
return evlistener.length;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
EventEmitter.prototype.eventNames = function eventNames() {
|
||||
return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
|
||||
};
|
||||
function arrayClone(arr, n) {
|
||||
const copy = new Array(n);
|
||||
for (let i = 0; i < n; ++i) {
|
||||
copy[i] = arr[i];
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
function spliceOne(list, index) {
|
||||
for (; index + 1 < list.length; index++) {
|
||||
list[index] = list[index + 1];
|
||||
}
|
||||
list.pop();
|
||||
}
|
||||
function unwrapListeners(arr) {
|
||||
const ret = Array.from({ length: arr.length });
|
||||
for (let i = 0; i < ret.length; ++i) {
|
||||
ret[i] = arr[i].listener || arr[i];
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
export function once(emitter, name) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
function errorListener(err) {
|
||||
emitter.removeListener(name, resolver);
|
||||
reject(err);
|
||||
}
|
||||
function resolver() {
|
||||
if (typeof emitter.removeListener === "function") {
|
||||
emitter.removeListener("error", errorListener);
|
||||
}
|
||||
resolve(Array.prototype.slice.call(arguments));
|
||||
}
|
||||
;
|
||||
eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
|
||||
if (name !== "error") {
|
||||
addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
|
||||
}
|
||||
});
|
||||
}
|
||||
function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
|
||||
if (typeof emitter.on === "function") {
|
||||
eventTargetAgnosticAddListener(emitter, "error", handler, flags);
|
||||
}
|
||||
}
|
||||
function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
|
||||
if (typeof emitter.on === "function") {
|
||||
if (flags.once) {
|
||||
emitter.once(name, listener);
|
||||
} else {
|
||||
emitter.on(name, listener);
|
||||
}
|
||||
} else if (typeof emitter.addEventListener === "function") {
|
||||
emitter.addEventListener(name, function wrapListener(arg) {
|
||||
if (flags.once) {
|
||||
emitter.removeEventListener(name, wrapListener);
|
||||
}
|
||||
listener(arg);
|
||||
});
|
||||
} else {
|
||||
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
|
||||
}
|
||||
}
|
||||
15
node_modules/unenv/runtime/node/events/index.cjs
generated
vendored
Normal file
15
node_modules/unenv/runtime/node/events/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
module.exports = exports.EventEmitter = void 0;
|
||||
|
||||
var _events = require("./_events.cjs");
|
||||
|
||||
const EventEmitter = _events.EventEmitter;
|
||||
exports.EventEmitter = EventEmitter;
|
||||
var _default = {
|
||||
EventEmitter
|
||||
};
|
||||
module.exports = _default;
|
||||
3
node_modules/unenv/runtime/node/events/index.d.ts
generated
vendored
Normal file
3
node_modules/unenv/runtime/node/events/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export declare const EventEmitter: any;
|
||||
declare const _default: any;
|
||||
export default _default;
|
||||
5
node_modules/unenv/runtime/node/events/index.mjs
generated
vendored
Normal file
5
node_modules/unenv/runtime/node/events/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { EventEmitter as _EventEmitter } from "./_events.mjs";
|
||||
export const EventEmitter = _EventEmitter;
|
||||
export default {
|
||||
EventEmitter
|
||||
};
|
||||
38
node_modules/unenv/runtime/node/fs/_classes.cjs
generated
vendored
Normal file
38
node_modules/unenv/runtime/node/fs/_classes.cjs
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.WriteStream = exports.Stats = exports.ReadStream = exports.FileWriteStream = exports.FileReadStream = exports.Dirent = exports.Dir = void 0;
|
||||
|
||||
var _proxy = _interopRequireDefault(require("../../mock/proxy.cjs"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const Dir = _proxy.default.__createMock__("fs.Dir");
|
||||
|
||||
exports.Dir = Dir;
|
||||
|
||||
const Dirent = _proxy.default.__createMock__("fs.Dirent");
|
||||
|
||||
exports.Dirent = Dirent;
|
||||
|
||||
const Stats = _proxy.default.__createMock__("fs.Stats");
|
||||
|
||||
exports.Stats = Stats;
|
||||
|
||||
const ReadStream = _proxy.default.__createMock__("fs.ReadStream");
|
||||
|
||||
exports.ReadStream = ReadStream;
|
||||
|
||||
const WriteStream = _proxy.default.__createMock__("fs.WriteStream");
|
||||
|
||||
exports.WriteStream = WriteStream;
|
||||
|
||||
const FileReadStream = _proxy.default.__createMock__("fs.FileReadStream");
|
||||
|
||||
exports.FileReadStream = FileReadStream;
|
||||
|
||||
const FileWriteStream = _proxy.default.__createMock__("fs.FileWriteStream");
|
||||
|
||||
exports.FileWriteStream = FileWriteStream;
|
||||
8
node_modules/unenv/runtime/node/fs/_classes.d.ts
generated
vendored
Normal file
8
node_modules/unenv/runtime/node/fs/_classes.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import type fs from "node:fs";
|
||||
export declare const Dir: typeof fs.Dir;
|
||||
export declare const Dirent: typeof fs.Dirent;
|
||||
export declare const Stats: typeof fs.Stats;
|
||||
export declare const ReadStream: typeof fs.ReadStream;
|
||||
export declare const WriteStream: typeof fs.WriteStream;
|
||||
export declare const FileReadStream: any;
|
||||
export declare const FileWriteStream: any;
|
||||
8
node_modules/unenv/runtime/node/fs/_classes.mjs
generated
vendored
Normal file
8
node_modules/unenv/runtime/node/fs/_classes.mjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import mock from "../../mock/proxy.mjs";
|
||||
export const Dir = mock.__createMock__("fs.Dir");
|
||||
export const Dirent = mock.__createMock__("fs.Dirent");
|
||||
export const Stats = mock.__createMock__("fs.Stats");
|
||||
export const ReadStream = mock.__createMock__("fs.ReadStream");
|
||||
export const WriteStream = mock.__createMock__("fs.WriteStream");
|
||||
export const FileReadStream = mock.__createMock__("fs.FileReadStream");
|
||||
export const FileWriteStream = mock.__createMock__("fs.FileWriteStream");
|
||||
73
node_modules/unenv/runtime/node/fs/_constants.cjs
generated
vendored
Normal file
73
node_modules/unenv/runtime/node/fs/_constants.cjs
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.constants = exports.X_OK = exports.W_OK = exports.R_OK = exports.F_OK = void 0;
|
||||
const F_OK = 0;
|
||||
exports.F_OK = F_OK;
|
||||
const R_OK = 4;
|
||||
exports.R_OK = R_OK;
|
||||
const W_OK = 2;
|
||||
exports.W_OK = W_OK;
|
||||
const X_OK = 1;
|
||||
exports.X_OK = X_OK;
|
||||
const constants = /* @__PURE__ */Object.create({
|
||||
UV_FS_SYMLINK_DIR: 1,
|
||||
UV_FS_SYMLINK_JUNCTION: 2,
|
||||
O_RDONLY: 0,
|
||||
O_WRONLY: 1,
|
||||
O_RDWR: 2,
|
||||
UV_DIRENT_UNKNOWN: 0,
|
||||
UV_DIRENT_FILE: 1,
|
||||
UV_DIRENT_DIR: 2,
|
||||
UV_DIRENT_LINK: 3,
|
||||
UV_DIRENT_FIFO: 4,
|
||||
UV_DIRENT_SOCKET: 5,
|
||||
UV_DIRENT_CHAR: 6,
|
||||
UV_DIRENT_BLOCK: 7,
|
||||
S_IFMT: 61440,
|
||||
S_IFREG: 32768,
|
||||
S_IFDIR: 16384,
|
||||
S_IFCHR: 8192,
|
||||
S_IFBLK: 24576,
|
||||
S_IFIFO: 4096,
|
||||
S_IFLNK: 40960,
|
||||
S_IFSOCK: 49152,
|
||||
O_CREAT: 64,
|
||||
O_EXCL: 128,
|
||||
UV_FS_O_FILEMAP: 0,
|
||||
O_NOCTTY: 256,
|
||||
O_TRUNC: 512,
|
||||
O_APPEND: 1024,
|
||||
O_DIRECTORY: 65536,
|
||||
O_NOATIME: 262144,
|
||||
O_NOFOLLOW: 131072,
|
||||
O_SYNC: 1052672,
|
||||
O_DSYNC: 4096,
|
||||
O_DIRECT: 16384,
|
||||
O_NONBLOCK: 2048,
|
||||
S_IRWXU: 448,
|
||||
S_IRUSR: 256,
|
||||
S_IWUSR: 128,
|
||||
S_IXUSR: 64,
|
||||
S_IRWXG: 56,
|
||||
S_IRGRP: 32,
|
||||
S_IWGRP: 16,
|
||||
S_IXGRP: 8,
|
||||
S_IRWXO: 7,
|
||||
S_IROTH: 4,
|
||||
S_IWOTH: 2,
|
||||
S_IXOTH: 1,
|
||||
F_OK: 0,
|
||||
R_OK: 4,
|
||||
W_OK: 2,
|
||||
X_OK: 1,
|
||||
UV_FS_COPYFILE_EXCL: 1,
|
||||
COPYFILE_EXCL: 1,
|
||||
UV_FS_COPYFILE_FICLONE: 2,
|
||||
COPYFILE_FICLONE: 2,
|
||||
UV_FS_COPYFILE_FICLONE_FORCE: 4,
|
||||
COPYFILE_FICLONE_FORCE: 4
|
||||
});
|
||||
exports.constants = constants;
|
||||
6
node_modules/unenv/runtime/node/fs/_constants.d.ts
generated
vendored
Normal file
6
node_modules/unenv/runtime/node/fs/_constants.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import type fs from "node:fs";
|
||||
export declare const F_OK = 0;
|
||||
export declare const R_OK = 4;
|
||||
export declare const W_OK = 2;
|
||||
export declare const X_OK = 1;
|
||||
export declare const constants: typeof fs.constants;
|
||||
62
node_modules/unenv/runtime/node/fs/_constants.mjs
generated
vendored
Normal file
62
node_modules/unenv/runtime/node/fs/_constants.mjs
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
export const F_OK = 0;
|
||||
export const R_OK = 4;
|
||||
export const W_OK = 2;
|
||||
export const X_OK = 1;
|
||||
export const constants = /* @__PURE__ */ Object.create({
|
||||
UV_FS_SYMLINK_DIR: 1,
|
||||
UV_FS_SYMLINK_JUNCTION: 2,
|
||||
O_RDONLY: 0,
|
||||
O_WRONLY: 1,
|
||||
O_RDWR: 2,
|
||||
UV_DIRENT_UNKNOWN: 0,
|
||||
UV_DIRENT_FILE: 1,
|
||||
UV_DIRENT_DIR: 2,
|
||||
UV_DIRENT_LINK: 3,
|
||||
UV_DIRENT_FIFO: 4,
|
||||
UV_DIRENT_SOCKET: 5,
|
||||
UV_DIRENT_CHAR: 6,
|
||||
UV_DIRENT_BLOCK: 7,
|
||||
S_IFMT: 61440,
|
||||
S_IFREG: 32768,
|
||||
S_IFDIR: 16384,
|
||||
S_IFCHR: 8192,
|
||||
S_IFBLK: 24576,
|
||||
S_IFIFO: 4096,
|
||||
S_IFLNK: 40960,
|
||||
S_IFSOCK: 49152,
|
||||
O_CREAT: 64,
|
||||
O_EXCL: 128,
|
||||
UV_FS_O_FILEMAP: 0,
|
||||
O_NOCTTY: 256,
|
||||
O_TRUNC: 512,
|
||||
O_APPEND: 1024,
|
||||
O_DIRECTORY: 65536,
|
||||
O_NOATIME: 262144,
|
||||
O_NOFOLLOW: 131072,
|
||||
O_SYNC: 1052672,
|
||||
O_DSYNC: 4096,
|
||||
O_DIRECT: 16384,
|
||||
O_NONBLOCK: 2048,
|
||||
S_IRWXU: 448,
|
||||
S_IRUSR: 256,
|
||||
S_IWUSR: 128,
|
||||
S_IXUSR: 64,
|
||||
S_IRWXG: 56,
|
||||
S_IRGRP: 32,
|
||||
S_IWGRP: 16,
|
||||
S_IXGRP: 8,
|
||||
S_IRWXO: 7,
|
||||
S_IROTH: 4,
|
||||
S_IWOTH: 2,
|
||||
S_IXOTH: 1,
|
||||
F_OK: 0,
|
||||
R_OK: 4,
|
||||
W_OK: 2,
|
||||
X_OK: 1,
|
||||
UV_FS_COPYFILE_EXCL: 1,
|
||||
COPYFILE_EXCL: 1,
|
||||
UV_FS_COPYFILE_FICLONE: 2,
|
||||
COPYFILE_FICLONE: 2,
|
||||
UV_FS_COPYFILE_FICLONE_FORCE: 4,
|
||||
COPYFILE_FICLONE_FORCE: 4
|
||||
});
|
||||
215
node_modules/unenv/runtime/node/fs/_fs.cjs
generated
vendored
Normal file
215
node_modules/unenv/runtime/node/fs/_fs.cjs
generated
vendored
Normal file
@@ -0,0 +1,215 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.writevSync = exports.writev = exports.writeSync = exports.writeFileSync = exports.writeFile = exports.write = exports.watchFile = exports.watch = exports.utimesSync = exports.utimes = exports.unwatchFile = exports.unlinkSync = exports.unlink = exports.truncateSync = exports.truncate = exports.symlinkSync = exports.symlink = exports.statSync = exports.stat = exports.rmdirSync = exports.rmdir = exports.rmSync = exports.rm = exports.renameSync = exports.rename = exports.realpathSync = exports.realpath = exports.readvSync = exports.readv = exports.readlinkSync = exports.readlink = exports.readdirSync = exports.readdir = exports.readSync = exports.readFileSync = exports.readFile = exports.read = exports.opendirSync = exports.opendir = exports.openSync = exports.open = exports.mkdtempSync = exports.mkdtemp = exports.mkdirSync = exports.mkdir = exports.lutimesSync = exports.lutimes = exports.lstatSync = exports.lstat = exports.linkSync = exports.link = exports.lchownSync = exports.lchown = exports.lchmodSync = exports.lchmod = exports.futimesSync = exports.futimes = exports.ftruncateSync = exports.ftruncate = exports.fsyncSync = exports.fsync = exports.fstatSync = exports.fstat = exports.fdatasyncSync = exports.fdatasync = exports.fchownSync = exports.fchown = exports.fchmodSync = exports.fchmod = exports.existsSync = exports.exists = exports.createWriteStream = exports.createReadStream = exports.cpSync = exports.cp = exports.copyFileSync = exports.copyFile = exports.closeSync = exports.close = exports.chownSync = exports.chown = exports.chmodSync = exports.chmod = exports.appendFileSync = exports.appendFile = exports.accessSync = exports.access = exports._toUnixTimestamp = void 0;
|
||||
|
||||
var _utils = require("../../_internal/utils.cjs");
|
||||
|
||||
var fsp = _interopRequireWildcard(require("./promises/index.cjs"));
|
||||
|
||||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
||||
|
||||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function notImplementedAsync(name) {
|
||||
const fn = (0, _utils.notImplemented)(name);
|
||||
|
||||
fn.__promisify__ = () => (0, _utils.notImplemented)(name + ".__promisify__");
|
||||
|
||||
fn.native = fn;
|
||||
return fn;
|
||||
}
|
||||
|
||||
function callbackify(fn) {
|
||||
const fnc = function (...args) {
|
||||
const cb = args.pop();
|
||||
fn().catch(error => cb(error)).then(val => cb(void 0, val));
|
||||
};
|
||||
|
||||
fnc.__promisify__ = fn;
|
||||
fnc.native = fnc;
|
||||
return fnc;
|
||||
}
|
||||
|
||||
const access = callbackify(fsp.access);
|
||||
exports.access = access;
|
||||
const appendFile = callbackify(fsp.appendFile);
|
||||
exports.appendFile = appendFile;
|
||||
const chown = callbackify(fsp.chown);
|
||||
exports.chown = chown;
|
||||
const chmod = callbackify(fsp.chmod);
|
||||
exports.chmod = chmod;
|
||||
const copyFile = callbackify(fsp.copyFile);
|
||||
exports.copyFile = copyFile;
|
||||
const cp = callbackify(fsp.cp);
|
||||
exports.cp = cp;
|
||||
const lchown = callbackify(fsp.lchown);
|
||||
exports.lchown = lchown;
|
||||
const lchmod = callbackify(fsp.lchmod);
|
||||
exports.lchmod = lchmod;
|
||||
const link = callbackify(fsp.link);
|
||||
exports.link = link;
|
||||
const lstat = callbackify(fsp.lstat);
|
||||
exports.lstat = lstat;
|
||||
const lutimes = callbackify(fsp.lutimes);
|
||||
exports.lutimes = lutimes;
|
||||
const mkdir = callbackify(fsp.mkdir);
|
||||
exports.mkdir = mkdir;
|
||||
const mkdtemp = callbackify(fsp.mkdtemp);
|
||||
exports.mkdtemp = mkdtemp;
|
||||
const realpath = callbackify(fsp.realpath);
|
||||
exports.realpath = realpath;
|
||||
const open = callbackify(fsp.open);
|
||||
exports.open = open;
|
||||
const opendir = callbackify(fsp.opendir);
|
||||
exports.opendir = opendir;
|
||||
const readdir = callbackify(fsp.readdir);
|
||||
exports.readdir = readdir;
|
||||
const readFile = callbackify(fsp.readFile);
|
||||
exports.readFile = readFile;
|
||||
const readlink = callbackify(fsp.readlink);
|
||||
exports.readlink = readlink;
|
||||
const rename = callbackify(fsp.rename);
|
||||
exports.rename = rename;
|
||||
const rm = callbackify(fsp.rm);
|
||||
exports.rm = rm;
|
||||
const rmdir = callbackify(fsp.rmdir);
|
||||
exports.rmdir = rmdir;
|
||||
const stat = callbackify(fsp.stat);
|
||||
exports.stat = stat;
|
||||
const symlink = callbackify(fsp.symlink);
|
||||
exports.symlink = symlink;
|
||||
const truncate = callbackify(fsp.truncate);
|
||||
exports.truncate = truncate;
|
||||
const unlink = callbackify(fsp.unlink);
|
||||
exports.unlink = unlink;
|
||||
const utimes = callbackify(fsp.utimes);
|
||||
exports.utimes = utimes;
|
||||
const writeFile = callbackify(fsp.writeFile);
|
||||
exports.writeFile = writeFile;
|
||||
const close = notImplementedAsync("fs.close");
|
||||
exports.close = close;
|
||||
const createReadStream = notImplementedAsync("fs.createReadStream");
|
||||
exports.createReadStream = createReadStream;
|
||||
const createWriteStream = notImplementedAsync("fs.createWriteStream");
|
||||
exports.createWriteStream = createWriteStream;
|
||||
const exists = notImplementedAsync("fs.exists");
|
||||
exports.exists = exists;
|
||||
const fchown = notImplementedAsync("fs.fchown");
|
||||
exports.fchown = fchown;
|
||||
const fchmod = notImplementedAsync("fs.fchmod");
|
||||
exports.fchmod = fchmod;
|
||||
const fdatasync = notImplementedAsync("fs.fdatasync");
|
||||
exports.fdatasync = fdatasync;
|
||||
const fstat = notImplementedAsync("fs.fstat");
|
||||
exports.fstat = fstat;
|
||||
const fsync = notImplementedAsync("fs.fsync");
|
||||
exports.fsync = fsync;
|
||||
const ftruncate = notImplementedAsync("fs.ftruncate");
|
||||
exports.ftruncate = ftruncate;
|
||||
const futimes = notImplementedAsync("fs.futimes");
|
||||
exports.futimes = futimes;
|
||||
const lstatSync = notImplementedAsync("fs.lstatSync");
|
||||
exports.lstatSync = lstatSync;
|
||||
const read = notImplementedAsync("fs.read");
|
||||
exports.read = read;
|
||||
const readv = notImplementedAsync("fs.readv");
|
||||
exports.readv = readv;
|
||||
const realpathSync = notImplementedAsync("fs.realpathSync");
|
||||
exports.realpathSync = realpathSync;
|
||||
const statSync = notImplementedAsync("fs.statSync");
|
||||
exports.statSync = statSync;
|
||||
const unwatchFile = notImplementedAsync("fs.unwatchFile");
|
||||
exports.unwatchFile = unwatchFile;
|
||||
const watch = notImplementedAsync("fs.watch");
|
||||
exports.watch = watch;
|
||||
const watchFile = notImplementedAsync("fs.watchFile");
|
||||
exports.watchFile = watchFile;
|
||||
const write = notImplementedAsync("fs.write");
|
||||
exports.write = write;
|
||||
const writev = notImplementedAsync("fs.writev");
|
||||
exports.writev = writev;
|
||||
|
||||
const _toUnixTimestamp = notImplementedAsync("fs._toUnixTimestamp");
|
||||
|
||||
exports._toUnixTimestamp = _toUnixTimestamp;
|
||||
const appendFileSync = (0, _utils.notImplemented)("fs.appendFileSync");
|
||||
exports.appendFileSync = appendFileSync;
|
||||
const accessSync = (0, _utils.notImplemented)("fs.accessSync");
|
||||
exports.accessSync = accessSync;
|
||||
const chownSync = (0, _utils.notImplemented)("fs.chownSync");
|
||||
exports.chownSync = chownSync;
|
||||
const chmodSync = (0, _utils.notImplemented)("fs.chmodSync");
|
||||
exports.chmodSync = chmodSync;
|
||||
const closeSync = (0, _utils.notImplemented)("fs.closeSync");
|
||||
exports.closeSync = closeSync;
|
||||
const copyFileSync = (0, _utils.notImplemented)("fs.copyFileSync");
|
||||
exports.copyFileSync = copyFileSync;
|
||||
const cpSync = (0, _utils.notImplemented)("fs.cpSync");
|
||||
exports.cpSync = cpSync;
|
||||
|
||||
const existsSync = () => false;
|
||||
|
||||
exports.existsSync = existsSync;
|
||||
const fchownSync = (0, _utils.notImplemented)("fs.fchownSync");
|
||||
exports.fchownSync = fchownSync;
|
||||
const fchmodSync = (0, _utils.notImplemented)("fs.fchmodSync");
|
||||
exports.fchmodSync = fchmodSync;
|
||||
const fdatasyncSync = (0, _utils.notImplemented)("fs.fdatasyncSync");
|
||||
exports.fdatasyncSync = fdatasyncSync;
|
||||
const fstatSync = (0, _utils.notImplemented)("fs.fstatSync");
|
||||
exports.fstatSync = fstatSync;
|
||||
const fsyncSync = (0, _utils.notImplemented)("fs.fsyncSync");
|
||||
exports.fsyncSync = fsyncSync;
|
||||
const ftruncateSync = (0, _utils.notImplemented)("fs.ftruncateSync");
|
||||
exports.ftruncateSync = ftruncateSync;
|
||||
const futimesSync = (0, _utils.notImplemented)("fs.futimesSync");
|
||||
exports.futimesSync = futimesSync;
|
||||
const lchownSync = (0, _utils.notImplemented)("fs.lchownSync");
|
||||
exports.lchownSync = lchownSync;
|
||||
const lchmodSync = (0, _utils.notImplemented)("fs.lchmodSync");
|
||||
exports.lchmodSync = lchmodSync;
|
||||
const linkSync = (0, _utils.notImplemented)("fs.linkSync");
|
||||
exports.linkSync = linkSync;
|
||||
const lutimesSync = (0, _utils.notImplemented)("fs.lutimesSync");
|
||||
exports.lutimesSync = lutimesSync;
|
||||
const mkdirSync = (0, _utils.notImplemented)("fs.mkdirSync");
|
||||
exports.mkdirSync = mkdirSync;
|
||||
const mkdtempSync = (0, _utils.notImplemented)("fs.mkdtempSync");
|
||||
exports.mkdtempSync = mkdtempSync;
|
||||
const openSync = (0, _utils.notImplemented)("fs.openSync");
|
||||
exports.openSync = openSync;
|
||||
const opendirSync = (0, _utils.notImplemented)("fs.opendirSync");
|
||||
exports.opendirSync = opendirSync;
|
||||
const readdirSync = (0, _utils.notImplemented)("fs.readdirSync");
|
||||
exports.readdirSync = readdirSync;
|
||||
const readSync = (0, _utils.notImplemented)("fs.readSync");
|
||||
exports.readSync = readSync;
|
||||
const readvSync = (0, _utils.notImplemented)("fs.readvSync");
|
||||
exports.readvSync = readvSync;
|
||||
const readFileSync = (0, _utils.notImplemented)("fs.readFileSync");
|
||||
exports.readFileSync = readFileSync;
|
||||
const readlinkSync = (0, _utils.notImplemented)("fs.readlinkSync");
|
||||
exports.readlinkSync = readlinkSync;
|
||||
const renameSync = (0, _utils.notImplemented)("fs.renameSync");
|
||||
exports.renameSync = renameSync;
|
||||
const rmSync = (0, _utils.notImplemented)("fs.rmSync");
|
||||
exports.rmSync = rmSync;
|
||||
const rmdirSync = (0, _utils.notImplemented)("fs.rmdirSync");
|
||||
exports.rmdirSync = rmdirSync;
|
||||
const symlinkSync = (0, _utils.notImplemented)("fs.symlinkSync");
|
||||
exports.symlinkSync = symlinkSync;
|
||||
const truncateSync = (0, _utils.notImplemented)("fs.truncateSync");
|
||||
exports.truncateSync = truncateSync;
|
||||
const unlinkSync = (0, _utils.notImplemented)("fs.unlinkSync");
|
||||
exports.unlinkSync = unlinkSync;
|
||||
const utimesSync = (0, _utils.notImplemented)("fs.utimesSync");
|
||||
exports.utimesSync = utimesSync;
|
||||
const writeFileSync = (0, _utils.notImplemented)("fs.writeFileSync");
|
||||
exports.writeFileSync = writeFileSync;
|
||||
const writeSync = (0, _utils.notImplemented)("fs.writeSync");
|
||||
exports.writeSync = writeSync;
|
||||
const writevSync = (0, _utils.notImplemented)("fs.writevSync");
|
||||
exports.writevSync = writevSync;
|
||||
95
node_modules/unenv/runtime/node/fs/_fs.d.ts
generated
vendored
Normal file
95
node_modules/unenv/runtime/node/fs/_fs.d.ts
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
import type fs from "node:fs";
|
||||
interface Promisifiable {
|
||||
(): any;
|
||||
native: Promisifiable;
|
||||
__promisify__: () => Promise<any>;
|
||||
}
|
||||
export declare const access: typeof fs.access;
|
||||
export declare const appendFile: typeof fs.appendFile;
|
||||
export declare const chown: typeof fs.chown;
|
||||
export declare const chmod: typeof fs.chmod;
|
||||
export declare const copyFile: typeof fs.copyFile;
|
||||
export declare const cp: typeof fs.cp;
|
||||
export declare const lchown: typeof fs.lchown;
|
||||
export declare const lchmod: typeof fs.lchmod;
|
||||
export declare const link: typeof fs.link;
|
||||
export declare const lstat: typeof fs.lstat;
|
||||
export declare const lutimes: typeof fs.lutimes;
|
||||
export declare const mkdir: typeof fs.mkdir;
|
||||
export declare const mkdtemp: typeof fs.mkdtemp;
|
||||
export declare const realpath: typeof fs.realpath;
|
||||
export declare const open: typeof fs.open;
|
||||
export declare const opendir: typeof fs.opendir;
|
||||
export declare const readdir: typeof fs.readdir;
|
||||
export declare const readFile: typeof fs.readFile;
|
||||
export declare const readlink: typeof fs.readlink;
|
||||
export declare const rename: typeof fs.rename;
|
||||
export declare const rm: typeof fs.rm;
|
||||
export declare const rmdir: typeof fs.rmdir;
|
||||
export declare const stat: typeof fs.stat;
|
||||
export declare const symlink: typeof fs.symlink;
|
||||
export declare const truncate: typeof fs.truncate;
|
||||
export declare const unlink: typeof fs.unlink;
|
||||
export declare const utimes: typeof fs.utimes;
|
||||
export declare const writeFile: typeof fs.writeFile;
|
||||
export declare const close: typeof fs.close;
|
||||
export declare const createReadStream: typeof fs.createReadStream;
|
||||
export declare const createWriteStream: typeof fs.createWriteStream;
|
||||
export declare const exists: typeof fs.exists;
|
||||
export declare const fchown: typeof fs.fchown;
|
||||
export declare const fchmod: typeof fs.fchmod;
|
||||
export declare const fdatasync: typeof fs.fdatasync;
|
||||
export declare const fstat: typeof fs.fstat;
|
||||
export declare const fsync: typeof fs.fsync;
|
||||
export declare const ftruncate: typeof fs.ftruncate;
|
||||
export declare const futimes: typeof fs.futimes;
|
||||
export declare const lstatSync: typeof fs.lstatSync;
|
||||
export declare const read: typeof fs.read;
|
||||
export declare const readv: typeof fs.readv;
|
||||
export declare const realpathSync: typeof fs.realpathSync;
|
||||
export declare const statSync: typeof fs.statSync;
|
||||
export declare const unwatchFile: typeof fs.unwatchFile;
|
||||
export declare const watch: typeof fs.watch;
|
||||
export declare const watchFile: typeof fs.watchFile;
|
||||
export declare const write: typeof fs.write;
|
||||
export declare const writev: typeof fs.writev;
|
||||
export declare const _toUnixTimestamp: Promisifiable;
|
||||
export declare const appendFileSync: typeof fs.appendFileSync;
|
||||
export declare const accessSync: typeof fs.accessSync;
|
||||
export declare const chownSync: typeof fs.chownSync;
|
||||
export declare const chmodSync: typeof fs.chmodSync;
|
||||
export declare const closeSync: typeof fs.closeSync;
|
||||
export declare const copyFileSync: typeof fs.copyFileSync;
|
||||
export declare const cpSync: typeof fs.cpSync;
|
||||
export declare const existsSync: typeof fs.existsSync;
|
||||
export declare const fchownSync: typeof fs.fchownSync;
|
||||
export declare const fchmodSync: typeof fs.fchmodSync;
|
||||
export declare const fdatasyncSync: typeof fs.fdatasyncSync;
|
||||
export declare const fstatSync: typeof fs.fstatSync;
|
||||
export declare const fsyncSync: typeof fs.fsyncSync;
|
||||
export declare const ftruncateSync: typeof fs.ftruncateSync;
|
||||
export declare const futimesSync: typeof fs.futimesSync;
|
||||
export declare const lchownSync: typeof fs.lchownSync;
|
||||
export declare const lchmodSync: typeof fs.lchmodSync;
|
||||
export declare const linkSync: typeof fs.linkSync;
|
||||
export declare const lutimesSync: typeof fs.lutimesSync;
|
||||
export declare const mkdirSync: typeof fs.mkdirSync;
|
||||
export declare const mkdtempSync: typeof fs.mkdtempSync;
|
||||
export declare const openSync: typeof fs.openSync;
|
||||
export declare const opendirSync: typeof fs.opendirSync;
|
||||
export declare const readdirSync: typeof fs.readdirSync;
|
||||
export declare const readSync: typeof fs.readSync;
|
||||
export declare const readvSync: typeof fs.readvSync;
|
||||
export declare const readFileSync: typeof fs.readFileSync;
|
||||
export declare const readlinkSync: typeof fs.readlinkSync;
|
||||
export declare const renameSync: typeof fs.renameSync;
|
||||
export declare const rmSync: typeof fs.rmSync;
|
||||
export declare const rmdirSync: typeof fs.rmdirSync;
|
||||
export declare const symlinkSync: typeof fs.symlinkSync;
|
||||
export declare const truncateSync: typeof fs.truncateSync;
|
||||
export declare const unlinkSync: typeof fs.unlinkSync;
|
||||
export declare const utimesSync: typeof fs.utimesSync;
|
||||
export declare const writeFileSync: typeof fs.writeFileSync;
|
||||
export declare const writeSync: typeof fs.writeSync;
|
||||
export declare const writevSync: typeof fs.writevSync;
|
||||
export {};
|
||||
105
node_modules/unenv/runtime/node/fs/_fs.mjs
generated
vendored
Normal file
105
node_modules/unenv/runtime/node/fs/_fs.mjs
generated
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
import { notImplemented } from "../../_internal/utils.mjs";
|
||||
import * as fsp from "./promises/index.mjs";
|
||||
function notImplementedAsync(name) {
|
||||
const fn = notImplemented(name);
|
||||
fn.__promisify__ = () => notImplemented(name + ".__promisify__");
|
||||
fn.native = fn;
|
||||
return fn;
|
||||
}
|
||||
function callbackify(fn) {
|
||||
const fnc = function(...args) {
|
||||
const cb = args.pop();
|
||||
fn().catch((error) => cb(error)).then((val) => cb(void 0, val));
|
||||
};
|
||||
fnc.__promisify__ = fn;
|
||||
fnc.native = fnc;
|
||||
return fnc;
|
||||
}
|
||||
export const access = callbackify(fsp.access);
|
||||
export const appendFile = callbackify(fsp.appendFile);
|
||||
export const chown = callbackify(fsp.chown);
|
||||
export const chmod = callbackify(fsp.chmod);
|
||||
export const copyFile = callbackify(fsp.copyFile);
|
||||
export const cp = callbackify(fsp.cp);
|
||||
export const lchown = callbackify(fsp.lchown);
|
||||
export const lchmod = callbackify(fsp.lchmod);
|
||||
export const link = callbackify(fsp.link);
|
||||
export const lstat = callbackify(fsp.lstat);
|
||||
export const lutimes = callbackify(fsp.lutimes);
|
||||
export const mkdir = callbackify(fsp.mkdir);
|
||||
export const mkdtemp = callbackify(fsp.mkdtemp);
|
||||
export const realpath = callbackify(fsp.realpath);
|
||||
export const open = callbackify(fsp.open);
|
||||
export const opendir = callbackify(fsp.opendir);
|
||||
export const readdir = callbackify(fsp.readdir);
|
||||
export const readFile = callbackify(fsp.readFile);
|
||||
export const readlink = callbackify(fsp.readlink);
|
||||
export const rename = callbackify(fsp.rename);
|
||||
export const rm = callbackify(fsp.rm);
|
||||
export const rmdir = callbackify(fsp.rmdir);
|
||||
export const stat = callbackify(fsp.stat);
|
||||
export const symlink = callbackify(fsp.symlink);
|
||||
export const truncate = callbackify(fsp.truncate);
|
||||
export const unlink = callbackify(fsp.unlink);
|
||||
export const utimes = callbackify(fsp.utimes);
|
||||
export const writeFile = callbackify(fsp.writeFile);
|
||||
export const close = notImplementedAsync("fs.close");
|
||||
export const createReadStream = notImplementedAsync("fs.createReadStream");
|
||||
export const createWriteStream = notImplementedAsync("fs.createWriteStream");
|
||||
export const exists = notImplementedAsync("fs.exists");
|
||||
export const fchown = notImplementedAsync("fs.fchown");
|
||||
export const fchmod = notImplementedAsync("fs.fchmod");
|
||||
export const fdatasync = notImplementedAsync("fs.fdatasync");
|
||||
export const fstat = notImplementedAsync("fs.fstat");
|
||||
export const fsync = notImplementedAsync("fs.fsync");
|
||||
export const ftruncate = notImplementedAsync("fs.ftruncate");
|
||||
export const futimes = notImplementedAsync("fs.futimes");
|
||||
export const lstatSync = notImplementedAsync("fs.lstatSync");
|
||||
export const read = notImplementedAsync("fs.read");
|
||||
export const readv = notImplementedAsync("fs.readv");
|
||||
export const realpathSync = notImplementedAsync("fs.realpathSync");
|
||||
export const statSync = notImplementedAsync("fs.statSync");
|
||||
export const unwatchFile = notImplementedAsync("fs.unwatchFile");
|
||||
export const watch = notImplementedAsync("fs.watch");
|
||||
export const watchFile = notImplementedAsync("fs.watchFile");
|
||||
export const write = notImplementedAsync("fs.write");
|
||||
export const writev = notImplementedAsync("fs.writev");
|
||||
export const _toUnixTimestamp = notImplementedAsync("fs._toUnixTimestamp");
|
||||
export const appendFileSync = notImplemented("fs.appendFileSync");
|
||||
export const accessSync = notImplemented("fs.accessSync");
|
||||
export const chownSync = notImplemented("fs.chownSync");
|
||||
export const chmodSync = notImplemented("fs.chmodSync");
|
||||
export const closeSync = notImplemented("fs.closeSync");
|
||||
export const copyFileSync = notImplemented("fs.copyFileSync");
|
||||
export const cpSync = notImplemented("fs.cpSync");
|
||||
export const existsSync = () => false;
|
||||
export const fchownSync = notImplemented("fs.fchownSync");
|
||||
export const fchmodSync = notImplemented("fs.fchmodSync");
|
||||
export const fdatasyncSync = notImplemented("fs.fdatasyncSync");
|
||||
export const fstatSync = notImplemented("fs.fstatSync");
|
||||
export const fsyncSync = notImplemented("fs.fsyncSync");
|
||||
export const ftruncateSync = notImplemented("fs.ftruncateSync");
|
||||
export const futimesSync = notImplemented("fs.futimesSync");
|
||||
export const lchownSync = notImplemented("fs.lchownSync");
|
||||
export const lchmodSync = notImplemented("fs.lchmodSync");
|
||||
export const linkSync = notImplemented("fs.linkSync");
|
||||
export const lutimesSync = notImplemented("fs.lutimesSync");
|
||||
export const mkdirSync = notImplemented("fs.mkdirSync");
|
||||
export const mkdtempSync = notImplemented("fs.mkdtempSync");
|
||||
export const openSync = notImplemented("fs.openSync");
|
||||
export const opendirSync = notImplemented("fs.opendirSync");
|
||||
export const readdirSync = notImplemented("fs.readdirSync");
|
||||
export const readSync = notImplemented("fs.readSync");
|
||||
export const readvSync = notImplemented("fs.readvSync");
|
||||
export const readFileSync = notImplemented("fs.readFileSync");
|
||||
export const readlinkSync = notImplemented("fs.readlinkSync");
|
||||
export const renameSync = notImplemented("fs.renameSync");
|
||||
export const rmSync = notImplemented("fs.rmSync");
|
||||
export const rmdirSync = notImplemented("fs.rmdirSync");
|
||||
export const symlinkSync = notImplemented("fs.symlinkSync");
|
||||
export const truncateSync = notImplemented("fs.truncateSync");
|
||||
export const unlinkSync = notImplemented("fs.unlinkSync");
|
||||
export const utimesSync = notImplemented("fs.utimesSync");
|
||||
export const writeFileSync = notImplemented("fs.writeFileSync");
|
||||
export const writeSync = notImplemented("fs.writeSync");
|
||||
export const writevSync = notImplemented("fs.writevSync");
|
||||
66
node_modules/unenv/runtime/node/fs/index.cjs
generated
vendored
Normal file
66
node_modules/unenv/runtime/node/fs/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var _exportNames = {
|
||||
promises: true
|
||||
};
|
||||
exports.promises = exports.default = void 0;
|
||||
|
||||
var _classes = _interopRequireWildcard(require("./_classes.cjs"));
|
||||
|
||||
Object.keys(_classes).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === _classes[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _classes[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var _constants = _interopRequireWildcard(require("./_constants.cjs"));
|
||||
|
||||
Object.keys(_constants).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === _constants[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _constants[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var _fs = _interopRequireWildcard(require("./_fs.cjs"));
|
||||
|
||||
Object.keys(_fs).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === _fs[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _fs[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var _promises = _interopRequireWildcard(require("./promises/index.cjs"));
|
||||
|
||||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
||||
|
||||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
const promises = _promises;
|
||||
exports.promises = promises;
|
||||
var _default = { ..._classes,
|
||||
..._constants,
|
||||
..._fs,
|
||||
promises
|
||||
};
|
||||
module.exports = _default;
|
||||
7
node_modules/unenv/runtime/node/fs/index.d.ts
generated
vendored
Normal file
7
node_modules/unenv/runtime/node/fs/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import * as _promises from "./promises/index";
|
||||
export * from "./_classes";
|
||||
export * from "./_constants";
|
||||
export * from "./_fs";
|
||||
export declare const promises: typeof _promises;
|
||||
declare const _default: any;
|
||||
export default _default;
|
||||
14
node_modules/unenv/runtime/node/fs/index.mjs
generated
vendored
Normal file
14
node_modules/unenv/runtime/node/fs/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import * as _classes from "./_classes.mjs";
|
||||
import * as _constants from "./_constants.mjs";
|
||||
import * as _fs from "./_fs.mjs";
|
||||
import * as _promises from "./promises/index.mjs";
|
||||
export * from "./_classes.mjs";
|
||||
export * from "./_constants.mjs";
|
||||
export * from "./_fs.mjs";
|
||||
export const promises = _promises;
|
||||
export default {
|
||||
..._classes,
|
||||
..._constants,
|
||||
..._fs,
|
||||
promises
|
||||
};
|
||||
67
node_modules/unenv/runtime/node/fs/promises/index.cjs
generated
vendored
Normal file
67
node_modules/unenv/runtime/node/fs/promises/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.writeFile = exports.watch = exports.utimes = exports.unlink = exports.truncate = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.realpath = exports.readlink = exports.readdir = exports.readFile = exports.opendir = exports.open = exports.mkdtemp = exports.mkdir = exports.lutimes = exports.lstat = exports.link = exports.lchown = exports.lchmod = exports.cp = exports.copyFile = exports.chown = exports.chmod = exports.appendFile = exports.access = void 0;
|
||||
|
||||
var _utils = require("../../../_internal/utils.cjs");
|
||||
|
||||
const access = (0, _utils.notImplemented)("fs.access");
|
||||
exports.access = access;
|
||||
const copyFile = (0, _utils.notImplemented)("fs.copyFile");
|
||||
exports.copyFile = copyFile;
|
||||
const cp = (0, _utils.notImplemented)("fs.cp");
|
||||
exports.cp = cp;
|
||||
const open = (0, _utils.notImplemented)("fs.open");
|
||||
exports.open = open;
|
||||
const opendir = (0, _utils.notImplemented)("fs.opendir");
|
||||
exports.opendir = opendir;
|
||||
const rename = (0, _utils.notImplemented)("fs.rename");
|
||||
exports.rename = rename;
|
||||
const truncate = (0, _utils.notImplemented)("fs.truncate");
|
||||
exports.truncate = truncate;
|
||||
const rm = (0, _utils.notImplemented)("fs.rm");
|
||||
exports.rm = rm;
|
||||
const rmdir = (0, _utils.notImplemented)("fs.rmdir");
|
||||
exports.rmdir = rmdir;
|
||||
const mkdir = (0, _utils.notImplemented)("fs.mkdir");
|
||||
exports.mkdir = mkdir;
|
||||
const readdir = (0, _utils.notImplemented)("fs.readdir");
|
||||
exports.readdir = readdir;
|
||||
const readlink = (0, _utils.notImplemented)("fs.readlink");
|
||||
exports.readlink = readlink;
|
||||
const symlink = (0, _utils.notImplemented)("fs.symlink");
|
||||
exports.symlink = symlink;
|
||||
const lstat = (0, _utils.notImplemented)("fs.lstat");
|
||||
exports.lstat = lstat;
|
||||
const stat = (0, _utils.notImplemented)("fs.stat");
|
||||
exports.stat = stat;
|
||||
const link = (0, _utils.notImplemented)("fs.link");
|
||||
exports.link = link;
|
||||
const unlink = (0, _utils.notImplemented)("fs.unlink");
|
||||
exports.unlink = unlink;
|
||||
const chmod = (0, _utils.notImplemented)("fs.chmod");
|
||||
exports.chmod = chmod;
|
||||
const lchmod = (0, _utils.notImplemented)("fs.lchmod");
|
||||
exports.lchmod = lchmod;
|
||||
const lchown = (0, _utils.notImplemented)("fs.lchown");
|
||||
exports.lchown = lchown;
|
||||
const chown = (0, _utils.notImplemented)("fs.chown");
|
||||
exports.chown = chown;
|
||||
const utimes = (0, _utils.notImplemented)("fs.utimes");
|
||||
exports.utimes = utimes;
|
||||
const lutimes = (0, _utils.notImplemented)("fs.lutimes");
|
||||
exports.lutimes = lutimes;
|
||||
const realpath = (0, _utils.notImplemented)("fs.realpath");
|
||||
exports.realpath = realpath;
|
||||
const mkdtemp = (0, _utils.notImplemented)("fs.mkdtemp");
|
||||
exports.mkdtemp = mkdtemp;
|
||||
const writeFile = (0, _utils.notImplemented)("fs.writeFile");
|
||||
exports.writeFile = writeFile;
|
||||
const appendFile = (0, _utils.notImplemented)("fs.appendFile");
|
||||
exports.appendFile = appendFile;
|
||||
const readFile = (0, _utils.notImplemented)("fs.readFile");
|
||||
exports.readFile = readFile;
|
||||
const watch = (0, _utils.notImplemented)("fs.watch");
|
||||
exports.watch = watch;
|
||||
30
node_modules/unenv/runtime/node/fs/promises/index.d.ts
generated
vendored
Normal file
30
node_modules/unenv/runtime/node/fs/promises/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import type fsp from "node:fs/promises";
|
||||
export declare const access: typeof fsp.access;
|
||||
export declare const copyFile: typeof fsp.copyFile;
|
||||
export declare const cp: typeof fsp.cp;
|
||||
export declare const open: typeof fsp.open;
|
||||
export declare const opendir: typeof fsp.opendir;
|
||||
export declare const rename: typeof fsp.rename;
|
||||
export declare const truncate: typeof fsp.truncate;
|
||||
export declare const rm: typeof fsp.rm;
|
||||
export declare const rmdir: typeof fsp.rmdir;
|
||||
export declare const mkdir: typeof fsp.mkdir;
|
||||
export declare const readdir: typeof fsp.readdir;
|
||||
export declare const readlink: typeof fsp.readlink;
|
||||
export declare const symlink: typeof fsp.symlink;
|
||||
export declare const lstat: typeof fsp.lstat;
|
||||
export declare const stat: typeof fsp.stat;
|
||||
export declare const link: typeof fsp.link;
|
||||
export declare const unlink: typeof fsp.unlink;
|
||||
export declare const chmod: typeof fsp.chmod;
|
||||
export declare const lchmod: typeof fsp.lchmod;
|
||||
export declare const lchown: typeof fsp.lchown;
|
||||
export declare const chown: typeof fsp.chown;
|
||||
export declare const utimes: typeof fsp.utimes;
|
||||
export declare const lutimes: typeof fsp.lutimes;
|
||||
export declare const realpath: typeof fsp.realpath;
|
||||
export declare const mkdtemp: typeof fsp.mkdtemp;
|
||||
export declare const writeFile: typeof fsp.writeFile;
|
||||
export declare const appendFile: typeof fsp.appendFile;
|
||||
export declare const readFile: typeof fsp.readFile;
|
||||
export declare const watch: typeof fsp.watch;
|
||||
30
node_modules/unenv/runtime/node/fs/promises/index.mjs
generated
vendored
Normal file
30
node_modules/unenv/runtime/node/fs/promises/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import { notImplemented } from "../../../_internal/utils.mjs";
|
||||
export const access = notImplemented("fs.access");
|
||||
export const copyFile = notImplemented("fs.copyFile");
|
||||
export const cp = notImplemented("fs.cp");
|
||||
export const open = notImplemented("fs.open");
|
||||
export const opendir = notImplemented("fs.opendir");
|
||||
export const rename = notImplemented("fs.rename");
|
||||
export const truncate = notImplemented("fs.truncate");
|
||||
export const rm = notImplemented("fs.rm");
|
||||
export const rmdir = notImplemented("fs.rmdir");
|
||||
export const mkdir = notImplemented("fs.mkdir");
|
||||
export const readdir = notImplemented("fs.readdir");
|
||||
export const readlink = notImplemented("fs.readlink");
|
||||
export const symlink = notImplemented("fs.symlink");
|
||||
export const lstat = notImplemented("fs.lstat");
|
||||
export const stat = notImplemented("fs.stat");
|
||||
export const link = notImplemented("fs.link");
|
||||
export const unlink = notImplemented("fs.unlink");
|
||||
export const chmod = notImplemented("fs.chmod");
|
||||
export const lchmod = notImplemented("fs.lchmod");
|
||||
export const lchown = notImplemented("fs.lchown");
|
||||
export const chown = notImplemented("fs.chown");
|
||||
export const utimes = notImplemented("fs.utimes");
|
||||
export const lutimes = notImplemented("fs.lutimes");
|
||||
export const realpath = notImplemented("fs.realpath");
|
||||
export const mkdtemp = notImplemented("fs.mkdtemp");
|
||||
export const writeFile = notImplemented("fs.writeFile");
|
||||
export const appendFile = notImplemented("fs.appendFile");
|
||||
export const readFile = notImplemented("fs.readFile");
|
||||
export const watch = notImplemented("fs.watch");
|
||||
76
node_modules/unenv/runtime/node/http/_consts.cjs
generated
vendored
Normal file
76
node_modules/unenv/runtime/node/http/_consts.cjs
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.maxHeaderSize = exports.STATUS_CODES = exports.METHODS = void 0;
|
||||
const METHODS = ["ACL", "BIND", "CHECKOUT", "CONNECT", "COPY", "DELETE", "GET", "HEAD", "LINK", "LOCK", "M-SEARCH", "MERGE", "MKACTIVITY", "MKCALENDAR", "MKCOL", "MOVE", "NOTIFY", "OPTIONS", "PATCH", "POST", "PRI", "PROPFIND", "PROPPATCH", "PURGE", "PUT", "REBIND", "REPORT", "SEARCH", "SOURCE", "SUBSCRIBE", "TRACE", "UNBIND", "UNLINK", "UNLOCK", "UNSUBSCRIBE"];
|
||||
exports.METHODS = METHODS;
|
||||
const STATUS_CODES = {
|
||||
100: "Continue",
|
||||
101: "Switching Protocols",
|
||||
102: "Processing",
|
||||
103: "Early Hints",
|
||||
200: "OK",
|
||||
201: "Created",
|
||||
202: "Accepted",
|
||||
203: "Non-Authoritative Information",
|
||||
204: "No Content",
|
||||
205: "Reset Content",
|
||||
206: "Partial Content",
|
||||
207: "Multi-Status",
|
||||
208: "Already Reported",
|
||||
226: "IM Used",
|
||||
300: "Multiple Choices",
|
||||
301: "Moved Permanently",
|
||||
302: "Found",
|
||||
303: "See Other",
|
||||
304: "Not Modified",
|
||||
305: "Use Proxy",
|
||||
307: "Temporary Redirect",
|
||||
308: "Permanent Redirect",
|
||||
400: "Bad Request",
|
||||
401: "Unauthorized",
|
||||
402: "Payment Required",
|
||||
403: "Forbidden",
|
||||
404: "Not Found",
|
||||
405: "Method Not Allowed",
|
||||
406: "Not Acceptable",
|
||||
407: "Proxy Authentication Required",
|
||||
408: "Request Timeout",
|
||||
409: "Conflict",
|
||||
410: "Gone",
|
||||
411: "Length Required",
|
||||
412: "Precondition Failed",
|
||||
413: "Payload Too Large",
|
||||
414: "URI Too Long",
|
||||
415: "Unsupported Media Type",
|
||||
416: "Range Not Satisfiable",
|
||||
417: "Expectation Failed",
|
||||
418: "I'm a Teapot",
|
||||
421: "Misdirected Request",
|
||||
422: "Unprocessable Entity",
|
||||
423: "Locked",
|
||||
424: "Failed Dependency",
|
||||
425: "Too Early",
|
||||
426: "Upgrade Required",
|
||||
428: "Precondition Required",
|
||||
429: "Too Many Requests",
|
||||
431: "Request Header Fields Too Large",
|
||||
451: "Unavailable For Legal Reasons",
|
||||
500: "Internal Server Error",
|
||||
501: "Not Implemented",
|
||||
502: "Bad Gateway",
|
||||
503: "Service Unavailable",
|
||||
504: "Gateway Timeout",
|
||||
505: "HTTP Version Not Supported",
|
||||
506: "Variant Also Negotiates",
|
||||
507: "Insufficient Storage",
|
||||
508: "Loop Detected",
|
||||
509: "Bandwidth Limit Exceeded",
|
||||
510: "Not Extended",
|
||||
511: "Network Authentication Required"
|
||||
};
|
||||
exports.STATUS_CODES = STATUS_CODES;
|
||||
const maxHeaderSize = 16384;
|
||||
exports.maxHeaderSize = maxHeaderSize;
|
||||
67
node_modules/unenv/runtime/node/http/_consts.d.ts
generated
vendored
Normal file
67
node_modules/unenv/runtime/node/http/_consts.d.ts
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
export declare const METHODS: string[];
|
||||
export declare const STATUS_CODES: {
|
||||
100: string;
|
||||
101: string;
|
||||
102: string;
|
||||
103: string;
|
||||
200: string;
|
||||
201: string;
|
||||
202: string;
|
||||
203: string;
|
||||
204: string;
|
||||
205: string;
|
||||
206: string;
|
||||
207: string;
|
||||
208: string;
|
||||
226: string;
|
||||
300: string;
|
||||
301: string;
|
||||
302: string;
|
||||
303: string;
|
||||
304: string;
|
||||
305: string;
|
||||
307: string;
|
||||
308: string;
|
||||
400: string;
|
||||
401: string;
|
||||
402: string;
|
||||
403: string;
|
||||
404: string;
|
||||
405: string;
|
||||
406: string;
|
||||
407: string;
|
||||
408: string;
|
||||
409: string;
|
||||
410: string;
|
||||
411: string;
|
||||
412: string;
|
||||
413: string;
|
||||
414: string;
|
||||
415: string;
|
||||
416: string;
|
||||
417: string;
|
||||
418: string;
|
||||
421: string;
|
||||
422: string;
|
||||
423: string;
|
||||
424: string;
|
||||
425: string;
|
||||
426: string;
|
||||
428: string;
|
||||
429: string;
|
||||
431: string;
|
||||
451: string;
|
||||
500: string;
|
||||
501: string;
|
||||
502: string;
|
||||
503: string;
|
||||
504: string;
|
||||
505: string;
|
||||
506: string;
|
||||
507: string;
|
||||
508: string;
|
||||
509: string;
|
||||
510: string;
|
||||
511: string;
|
||||
};
|
||||
export declare const maxHeaderSize = 16384;
|
||||
103
node_modules/unenv/runtime/node/http/_consts.mjs
generated
vendored
Normal file
103
node_modules/unenv/runtime/node/http/_consts.mjs
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
export const METHODS = [
|
||||
"ACL",
|
||||
"BIND",
|
||||
"CHECKOUT",
|
||||
"CONNECT",
|
||||
"COPY",
|
||||
"DELETE",
|
||||
"GET",
|
||||
"HEAD",
|
||||
"LINK",
|
||||
"LOCK",
|
||||
"M-SEARCH",
|
||||
"MERGE",
|
||||
"MKACTIVITY",
|
||||
"MKCALENDAR",
|
||||
"MKCOL",
|
||||
"MOVE",
|
||||
"NOTIFY",
|
||||
"OPTIONS",
|
||||
"PATCH",
|
||||
"POST",
|
||||
"PRI",
|
||||
"PROPFIND",
|
||||
"PROPPATCH",
|
||||
"PURGE",
|
||||
"PUT",
|
||||
"REBIND",
|
||||
"REPORT",
|
||||
"SEARCH",
|
||||
"SOURCE",
|
||||
"SUBSCRIBE",
|
||||
"TRACE",
|
||||
"UNBIND",
|
||||
"UNLINK",
|
||||
"UNLOCK",
|
||||
"UNSUBSCRIBE"
|
||||
];
|
||||
export const STATUS_CODES = {
|
||||
100: "Continue",
|
||||
101: "Switching Protocols",
|
||||
102: "Processing",
|
||||
103: "Early Hints",
|
||||
200: "OK",
|
||||
201: "Created",
|
||||
202: "Accepted",
|
||||
203: "Non-Authoritative Information",
|
||||
204: "No Content",
|
||||
205: "Reset Content",
|
||||
206: "Partial Content",
|
||||
207: "Multi-Status",
|
||||
208: "Already Reported",
|
||||
226: "IM Used",
|
||||
300: "Multiple Choices",
|
||||
301: "Moved Permanently",
|
||||
302: "Found",
|
||||
303: "See Other",
|
||||
304: "Not Modified",
|
||||
305: "Use Proxy",
|
||||
307: "Temporary Redirect",
|
||||
308: "Permanent Redirect",
|
||||
400: "Bad Request",
|
||||
401: "Unauthorized",
|
||||
402: "Payment Required",
|
||||
403: "Forbidden",
|
||||
404: "Not Found",
|
||||
405: "Method Not Allowed",
|
||||
406: "Not Acceptable",
|
||||
407: "Proxy Authentication Required",
|
||||
408: "Request Timeout",
|
||||
409: "Conflict",
|
||||
410: "Gone",
|
||||
411: "Length Required",
|
||||
412: "Precondition Failed",
|
||||
413: "Payload Too Large",
|
||||
414: "URI Too Long",
|
||||
415: "Unsupported Media Type",
|
||||
416: "Range Not Satisfiable",
|
||||
417: "Expectation Failed",
|
||||
418: "I'm a Teapot",
|
||||
421: "Misdirected Request",
|
||||
422: "Unprocessable Entity",
|
||||
423: "Locked",
|
||||
424: "Failed Dependency",
|
||||
425: "Too Early",
|
||||
426: "Upgrade Required",
|
||||
428: "Precondition Required",
|
||||
429: "Too Many Requests",
|
||||
431: "Request Header Fields Too Large",
|
||||
451: "Unavailable For Legal Reasons",
|
||||
500: "Internal Server Error",
|
||||
501: "Not Implemented",
|
||||
502: "Bad Gateway",
|
||||
503: "Service Unavailable",
|
||||
504: "Gateway Timeout",
|
||||
505: "HTTP Version Not Supported",
|
||||
506: "Variant Also Negotiates",
|
||||
507: "Insufficient Storage",
|
||||
508: "Loop Detected",
|
||||
509: "Bandwidth Limit Exceeded",
|
||||
510: "Not Extended",
|
||||
511: "Network Authentication Required"
|
||||
};
|
||||
export const maxHeaderSize = 16384;
|
||||
46
node_modules/unenv/runtime/node/http/_request.cjs
generated
vendored
Normal file
46
node_modules/unenv/runtime/node/http/_request.cjs
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.IncomingMessage = void 0;
|
||||
|
||||
var _socket = require("../net/socket.cjs");
|
||||
|
||||
var _readable = require("../stream/readable.cjs");
|
||||
|
||||
var _utils = require("../../_internal/utils.cjs");
|
||||
|
||||
class IncomingMessage extends _readable.Readable {
|
||||
constructor(socket) {
|
||||
super();
|
||||
this.aborted = false;
|
||||
this.httpVersion = "1.1";
|
||||
this.httpVersionMajor = 1;
|
||||
this.httpVersionMinor = 1;
|
||||
this.complete = true;
|
||||
this.headers = {};
|
||||
this.trailers = {};
|
||||
this.method = "GET";
|
||||
this.url = "/";
|
||||
this.statusCode = 200;
|
||||
this.statusMessage = "";
|
||||
this.readable = false;
|
||||
this.socket = this.connection = socket || new _socket.Socket();
|
||||
}
|
||||
|
||||
get rawHeaders() {
|
||||
return (0, _utils.rawHeaders)(this.headers);
|
||||
}
|
||||
|
||||
get rawTrailers() {
|
||||
return [];
|
||||
}
|
||||
|
||||
setTimeout(_msecs, _callback) {
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.IncomingMessage = IncomingMessage;
|
||||
23
node_modules/unenv/runtime/node/http/_request.d.ts
generated
vendored
Normal file
23
node_modules/unenv/runtime/node/http/_request.d.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import type http from "node:http";
|
||||
import { Socket } from "../net/socket";
|
||||
import { Readable } from "../stream/readable";
|
||||
export declare class IncomingMessage extends Readable implements http.IncomingMessage {
|
||||
aborted: boolean;
|
||||
httpVersion: string;
|
||||
httpVersionMajor: number;
|
||||
httpVersionMinor: number;
|
||||
complete: boolean;
|
||||
connection: Socket;
|
||||
socket: Socket;
|
||||
headers: http.IncomingHttpHeaders;
|
||||
trailers: {};
|
||||
method: string;
|
||||
url: string;
|
||||
statusCode: number;
|
||||
statusMessage: string;
|
||||
readable: boolean;
|
||||
constructor(socket?: Socket);
|
||||
get rawHeaders(): any[];
|
||||
get rawTrailers(): any[];
|
||||
setTimeout(_msecs: number, _callback?: () => void): this;
|
||||
}
|
||||
30
node_modules/unenv/runtime/node/http/_request.mjs
generated
vendored
Normal file
30
node_modules/unenv/runtime/node/http/_request.mjs
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import { Socket } from "../net/socket.mjs";
|
||||
import { Readable } from "../stream/readable.mjs";
|
||||
import { rawHeaders } from "../../_internal/utils.mjs";
|
||||
export class IncomingMessage extends Readable {
|
||||
constructor(socket) {
|
||||
super();
|
||||
this.aborted = false;
|
||||
this.httpVersion = "1.1";
|
||||
this.httpVersionMajor = 1;
|
||||
this.httpVersionMinor = 1;
|
||||
this.complete = true;
|
||||
this.headers = {};
|
||||
this.trailers = {};
|
||||
this.method = "GET";
|
||||
this.url = "/";
|
||||
this.statusCode = 200;
|
||||
this.statusMessage = "";
|
||||
this.readable = false;
|
||||
this.socket = this.connection = socket || new Socket();
|
||||
}
|
||||
get rawHeaders() {
|
||||
return rawHeaders(this.headers);
|
||||
}
|
||||
get rawTrailers() {
|
||||
return [];
|
||||
}
|
||||
setTimeout(_msecs, _callback) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
106
node_modules/unenv/runtime/node/http/_response.cjs
generated
vendored
Normal file
106
node_modules/unenv/runtime/node/http/_response.cjs
generated
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ServerResponse = void 0;
|
||||
|
||||
var _writable = require("../stream/writable.cjs");
|
||||
|
||||
class ServerResponse extends _writable.Writable {
|
||||
constructor(req) {
|
||||
super();
|
||||
this.statusCode = 200;
|
||||
this.statusMessage = "";
|
||||
this.upgrading = false;
|
||||
this.chunkedEncoding = false;
|
||||
this.shouldKeepAlive = false;
|
||||
this.useChunkedEncodingByDefault = false;
|
||||
this.sendDate = false;
|
||||
this.finished = false;
|
||||
this.headersSent = false;
|
||||
this.connection = null;
|
||||
this.socket = null;
|
||||
this._headers = {};
|
||||
this.req = req;
|
||||
}
|
||||
|
||||
assignSocket(socket) {
|
||||
socket._httpMessage = this;
|
||||
this.socket = socket;
|
||||
this.connection = socket;
|
||||
this.emit("socket", socket);
|
||||
|
||||
this._flush();
|
||||
}
|
||||
|
||||
_flush() {
|
||||
this.flushHeaders();
|
||||
}
|
||||
|
||||
detachSocket(_socket) {}
|
||||
|
||||
writeContinue(_callback) {}
|
||||
|
||||
writeHead(statusCode, arg1, arg2) {
|
||||
if (statusCode) {
|
||||
this.statusCode = statusCode;
|
||||
}
|
||||
|
||||
if (typeof arg1 === "string") {
|
||||
this.statusMessage = arg1;
|
||||
arg1 = void 0;
|
||||
}
|
||||
|
||||
const headers = arg2 || arg1;
|
||||
|
||||
if (headers) {
|
||||
if (Array.isArray(headers)) {} else {
|
||||
for (const key in headers) {
|
||||
this.setHeader(key, headers[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.headersSent = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
writeProcessing() {}
|
||||
|
||||
setTimeout(_msecs, _callback) {
|
||||
return this;
|
||||
}
|
||||
|
||||
setHeader(name, value) {
|
||||
this._headers[name.toLowerCase()] = value + "";
|
||||
return this;
|
||||
}
|
||||
|
||||
getHeader(name) {
|
||||
return this._headers[name.toLowerCase()];
|
||||
}
|
||||
|
||||
getHeaders() {
|
||||
return this._headers;
|
||||
}
|
||||
|
||||
getHeaderNames() {
|
||||
return Object.keys(this._headers);
|
||||
}
|
||||
|
||||
hasHeader(name) {
|
||||
return name.toLowerCase() in this._headers;
|
||||
}
|
||||
|
||||
removeHeader(name) {
|
||||
delete this._headers[name.toLowerCase()];
|
||||
}
|
||||
|
||||
addTrailers(_headers) {}
|
||||
|
||||
flushHeaders() {}
|
||||
|
||||
}
|
||||
|
||||
exports.ServerResponse = ServerResponse;
|
||||
36
node_modules/unenv/runtime/node/http/_response.d.ts
generated
vendored
Normal file
36
node_modules/unenv/runtime/node/http/_response.d.ts
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/// <reference types="node" />
|
||||
import type http from "node:http";
|
||||
import type { Socket } from "node:net";
|
||||
import { Callback, HeadersObject } from "../../_internal/types";
|
||||
import { Writable } from "../stream/writable";
|
||||
export declare class ServerResponse extends Writable implements http.ServerResponse {
|
||||
statusCode: number;
|
||||
statusMessage: string;
|
||||
upgrading: boolean;
|
||||
chunkedEncoding: boolean;
|
||||
shouldKeepAlive: boolean;
|
||||
useChunkedEncodingByDefault: boolean;
|
||||
sendDate: boolean;
|
||||
finished: boolean;
|
||||
headersSent: boolean;
|
||||
connection: Socket | null;
|
||||
socket: Socket | null;
|
||||
req: http.IncomingMessage;
|
||||
_headers: HeadersObject;
|
||||
constructor(req: http.IncomingMessage);
|
||||
assignSocket(socket: Socket): void;
|
||||
_flush(): void;
|
||||
detachSocket(_socket: Socket): void;
|
||||
writeContinue(_callback?: Callback): void;
|
||||
writeHead(statusCode: number, arg1?: string | http.OutgoingHttpHeaders | http.OutgoingHttpHeader[], arg2?: http.OutgoingHttpHeaders | http.OutgoingHttpHeader[]): this;
|
||||
writeProcessing(): void;
|
||||
setTimeout(_msecs: number, _callback?: Callback): this;
|
||||
setHeader(name: string, value: number | string | ReadonlyArray<string>): this;
|
||||
getHeader(name: string): number | string | string[] | undefined;
|
||||
getHeaders(): http.OutgoingHttpHeaders;
|
||||
getHeaderNames(): string[];
|
||||
hasHeader(name: string): boolean;
|
||||
removeHeader(name: string): void;
|
||||
addTrailers(_headers: http.OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void;
|
||||
flushHeaders(): void;
|
||||
}
|
||||
81
node_modules/unenv/runtime/node/http/_response.mjs
generated
vendored
Normal file
81
node_modules/unenv/runtime/node/http/_response.mjs
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
import { Writable } from "../stream/writable.mjs";
|
||||
export class ServerResponse extends Writable {
|
||||
constructor(req) {
|
||||
super();
|
||||
this.statusCode = 200;
|
||||
this.statusMessage = "";
|
||||
this.upgrading = false;
|
||||
this.chunkedEncoding = false;
|
||||
this.shouldKeepAlive = false;
|
||||
this.useChunkedEncodingByDefault = false;
|
||||
this.sendDate = false;
|
||||
this.finished = false;
|
||||
this.headersSent = false;
|
||||
this.connection = null;
|
||||
this.socket = null;
|
||||
this._headers = {};
|
||||
this.req = req;
|
||||
}
|
||||
assignSocket(socket) {
|
||||
socket._httpMessage = this;
|
||||
this.socket = socket;
|
||||
this.connection = socket;
|
||||
this.emit("socket", socket);
|
||||
this._flush();
|
||||
}
|
||||
_flush() {
|
||||
this.flushHeaders();
|
||||
}
|
||||
detachSocket(_socket) {
|
||||
}
|
||||
writeContinue(_callback) {
|
||||
}
|
||||
writeHead(statusCode, arg1, arg2) {
|
||||
if (statusCode) {
|
||||
this.statusCode = statusCode;
|
||||
}
|
||||
if (typeof arg1 === "string") {
|
||||
this.statusMessage = arg1;
|
||||
arg1 = void 0;
|
||||
}
|
||||
const headers = arg2 || arg1;
|
||||
if (headers) {
|
||||
if (Array.isArray(headers)) {
|
||||
} else {
|
||||
for (const key in headers) {
|
||||
this.setHeader(key, headers[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.headersSent = true;
|
||||
return this;
|
||||
}
|
||||
writeProcessing() {
|
||||
}
|
||||
setTimeout(_msecs, _callback) {
|
||||
return this;
|
||||
}
|
||||
setHeader(name, value) {
|
||||
this._headers[name.toLowerCase()] = value + "";
|
||||
return this;
|
||||
}
|
||||
getHeader(name) {
|
||||
return this._headers[name.toLowerCase()];
|
||||
}
|
||||
getHeaders() {
|
||||
return this._headers;
|
||||
}
|
||||
getHeaderNames() {
|
||||
return Object.keys(this._headers);
|
||||
}
|
||||
hasHeader(name) {
|
||||
return name.toLowerCase() in this._headers;
|
||||
}
|
||||
removeHeader(name) {
|
||||
delete this._headers[name.toLowerCase()];
|
||||
}
|
||||
addTrailers(_headers) {
|
||||
}
|
||||
flushHeaders() {
|
||||
}
|
||||
}
|
||||
106
node_modules/unenv/runtime/node/http/index.cjs
generated
vendored
Normal file
106
node_modules/unenv/runtime/node/http/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var _exportNames = {
|
||||
createServer: true,
|
||||
request: true,
|
||||
get: true,
|
||||
Server: true,
|
||||
OutgoingMessage: true,
|
||||
ClientRequest: true,
|
||||
Agent: true,
|
||||
globalAgent: true
|
||||
};
|
||||
exports.request = exports.globalAgent = exports.get = exports.default = exports.createServer = exports.Server = exports.OutgoingMessage = exports.ClientRequest = exports.Agent = void 0;
|
||||
|
||||
var _utils = require("../../_internal/utils.cjs");
|
||||
|
||||
var _proxy = _interopRequireDefault(require("../../mock/proxy.cjs"));
|
||||
|
||||
var consts = _interopRequireWildcard(require("./_consts.cjs"));
|
||||
|
||||
Object.keys(consts).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === consts[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return consts[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var _request = require("./_request.cjs");
|
||||
|
||||
Object.keys(_request).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === _request[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _request[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var _response = require("./_response.cjs");
|
||||
|
||||
Object.keys(_response).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === _response[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _response[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
||||
|
||||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const createServer = (0, _utils.notImplemented)("http.createServer");
|
||||
exports.createServer = createServer;
|
||||
const request = (0, _utils.notImplemented)("http.request");
|
||||
exports.request = request;
|
||||
const get = (0, _utils.notImplemented)("http.get");
|
||||
exports.get = get;
|
||||
|
||||
const Server = _proxy.default.__createMock__("http.Server");
|
||||
|
||||
exports.Server = Server;
|
||||
|
||||
const OutgoingMessage = _proxy.default.__createMock__("http.OutgoingMessage");
|
||||
|
||||
exports.OutgoingMessage = OutgoingMessage;
|
||||
|
||||
const ClientRequest = _proxy.default.__createMock__("http.ClientRequest");
|
||||
|
||||
exports.ClientRequest = ClientRequest;
|
||||
|
||||
const Agent = _proxy.default.__createMock__("http.Agent");
|
||||
|
||||
exports.Agent = Agent;
|
||||
const globalAgent = new Agent();
|
||||
exports.globalAgent = globalAgent;
|
||||
var _default = { ...consts,
|
||||
IncomingMessage: _request.IncomingMessage,
|
||||
ServerResponse: _response.ServerResponse,
|
||||
createServer,
|
||||
request,
|
||||
get,
|
||||
Server,
|
||||
OutgoingMessage,
|
||||
ClientRequest,
|
||||
Agent,
|
||||
globalAgent
|
||||
};
|
||||
module.exports = _default;
|
||||
14
node_modules/unenv/runtime/node/http/index.d.ts
generated
vendored
Normal file
14
node_modules/unenv/runtime/node/http/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import http from "node:http";
|
||||
export * from "./_consts";
|
||||
export * from "./_request";
|
||||
export * from "./_response";
|
||||
export declare const createServer: typeof http.createServer;
|
||||
export declare const request: typeof http.request;
|
||||
export declare const get: typeof http.get;
|
||||
export declare const Server: typeof http.Server;
|
||||
export declare const OutgoingMessage: typeof http.OutgoingMessage;
|
||||
export declare const ClientRequest: typeof http.ClientRequest;
|
||||
export declare const Agent: typeof http.Agent;
|
||||
export declare const globalAgent: typeof http.globalAgent;
|
||||
declare const _default: any;
|
||||
export default _default;
|
||||
29
node_modules/unenv/runtime/node/http/index.mjs
generated
vendored
Normal file
29
node_modules/unenv/runtime/node/http/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import { notImplemented } from "../../_internal/utils.mjs";
|
||||
import mock from "../../mock/proxy.mjs";
|
||||
import * as consts from "./_consts.mjs";
|
||||
import { IncomingMessage } from "./_request.mjs";
|
||||
import { ServerResponse } from "./_response.mjs";
|
||||
export * from "./_consts.mjs";
|
||||
export * from "./_request.mjs";
|
||||
export * from "./_response.mjs";
|
||||
export const createServer = notImplemented("http.createServer");
|
||||
export const request = notImplemented("http.request");
|
||||
export const get = notImplemented("http.get");
|
||||
export const Server = mock.__createMock__("http.Server");
|
||||
export const OutgoingMessage = mock.__createMock__("http.OutgoingMessage");
|
||||
export const ClientRequest = mock.__createMock__("http.ClientRequest");
|
||||
export const Agent = mock.__createMock__("http.Agent");
|
||||
export const globalAgent = new Agent();
|
||||
export default {
|
||||
...consts,
|
||||
IncomingMessage,
|
||||
ServerResponse,
|
||||
createServer,
|
||||
request,
|
||||
get,
|
||||
Server,
|
||||
OutgoingMessage,
|
||||
ClientRequest,
|
||||
Agent,
|
||||
globalAgent
|
||||
};
|
||||
29
node_modules/unenv/runtime/node/net/index.cjs
generated
vendored
Normal file
29
node_modules/unenv/runtime/node/net/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var _exportNames = {};
|
||||
module.exports = void 0;
|
||||
|
||||
var socket = _interopRequireWildcard(require("./socket.cjs"));
|
||||
|
||||
Object.keys(socket).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === socket[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return socket[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
||||
|
||||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
var _default = { ...socket
|
||||
};
|
||||
module.exports = _default;
|
||||
3
node_modules/unenv/runtime/node/net/index.d.ts
generated
vendored
Normal file
3
node_modules/unenv/runtime/node/net/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from "./socket";
|
||||
declare const _default: any;
|
||||
export default _default;
|
||||
5
node_modules/unenv/runtime/node/net/index.mjs
generated
vendored
Normal file
5
node_modules/unenv/runtime/node/net/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import * as socket from "./socket.mjs";
|
||||
export * from "./socket.mjs";
|
||||
export default {
|
||||
...socket
|
||||
};
|
||||
76
node_modules/unenv/runtime/node/net/socket.cjs
generated
vendored
Normal file
76
node_modules/unenv/runtime/node/net/socket.cjs
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.Socket = void 0;
|
||||
|
||||
var _duplex = require("../stream/duplex.cjs");
|
||||
|
||||
class Socket extends _duplex.Duplex {
|
||||
constructor(_options) {
|
||||
super();
|
||||
this.bufferSize = 0;
|
||||
this.bytesRead = 0;
|
||||
this.bytesWritten = 0;
|
||||
this.connecting = false;
|
||||
this.destroyed = false;
|
||||
this.localAddress = "";
|
||||
this.localPort = 0;
|
||||
this.remoteAddress = "";
|
||||
this.remoteFamily = "";
|
||||
this.remotePort = 0;
|
||||
this.readyState = "readOnly";
|
||||
}
|
||||
|
||||
write(_buffer, _arg1, _arg2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
connect(_arg1, _arg2, _arg3) {
|
||||
return this;
|
||||
}
|
||||
|
||||
end(_arg1, _arg2, _arg3) {
|
||||
return this;
|
||||
}
|
||||
|
||||
setEncoding(_encoding) {
|
||||
return this;
|
||||
}
|
||||
|
||||
pause() {
|
||||
return this;
|
||||
}
|
||||
|
||||
resume() {
|
||||
return this;
|
||||
}
|
||||
|
||||
setTimeout(_timeout, _callback) {
|
||||
return this;
|
||||
}
|
||||
|
||||
setNoDelay(_noDelay) {
|
||||
return this;
|
||||
}
|
||||
|
||||
setKeepAlive(_enable, _initialDelay) {
|
||||
return this;
|
||||
}
|
||||
|
||||
address() {
|
||||
return {};
|
||||
}
|
||||
|
||||
unref() {
|
||||
return this;
|
||||
}
|
||||
|
||||
ref() {
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.Socket = Socket;
|
||||
30
node_modules/unenv/runtime/node/net/socket.d.ts
generated
vendored
Normal file
30
node_modules/unenv/runtime/node/net/socket.d.ts
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/// <reference types="node" />
|
||||
import type * as net from "node:net";
|
||||
import { Callback, BufferEncoding } from "../../_internal/types";
|
||||
import { Duplex } from "../stream/duplex";
|
||||
export declare class Socket extends Duplex implements net.Socket {
|
||||
readonly bufferSize: number;
|
||||
readonly bytesRead: number;
|
||||
readonly bytesWritten: number;
|
||||
readonly connecting: boolean;
|
||||
readonly destroyed: boolean;
|
||||
readonly localAddress: string;
|
||||
readonly localPort: number;
|
||||
readonly remoteAddress?: string;
|
||||
readonly remoteFamily?: string;
|
||||
readonly remotePort?: number;
|
||||
readonly readyState: net.SocketReadyState;
|
||||
constructor(_options?: net.SocketConstructorOpts);
|
||||
write(_buffer: Uint8Array | string, _arg1?: BufferEncoding | Callback<Error | undefined>, _arg2?: Callback<Error | undefined>): boolean;
|
||||
connect(_arg1: number | string | net.SocketConnectOpts, _arg2?: string | Callback, _arg3?: Callback): this;
|
||||
end(_arg1?: Callback | Uint8Array | string, _arg2?: BufferEncoding | Callback, _arg3?: Callback): this;
|
||||
setEncoding(_encoding?: BufferEncoding): this;
|
||||
pause(): this;
|
||||
resume(): this;
|
||||
setTimeout(_timeout: number, _callback?: Callback): this;
|
||||
setNoDelay(_noDelay?: boolean): this;
|
||||
setKeepAlive(_enable?: boolean, _initialDelay?: number): this;
|
||||
address(): {};
|
||||
unref(): this;
|
||||
ref(): this;
|
||||
}
|
||||
53
node_modules/unenv/runtime/node/net/socket.mjs
generated
vendored
Normal file
53
node_modules/unenv/runtime/node/net/socket.mjs
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
import { Duplex } from "../stream/duplex.mjs";
|
||||
export class Socket extends Duplex {
|
||||
constructor(_options) {
|
||||
super();
|
||||
this.bufferSize = 0;
|
||||
this.bytesRead = 0;
|
||||
this.bytesWritten = 0;
|
||||
this.connecting = false;
|
||||
this.destroyed = false;
|
||||
this.localAddress = "";
|
||||
this.localPort = 0;
|
||||
this.remoteAddress = "";
|
||||
this.remoteFamily = "";
|
||||
this.remotePort = 0;
|
||||
this.readyState = "readOnly";
|
||||
}
|
||||
write(_buffer, _arg1, _arg2) {
|
||||
return false;
|
||||
}
|
||||
connect(_arg1, _arg2, _arg3) {
|
||||
return this;
|
||||
}
|
||||
end(_arg1, _arg2, _arg3) {
|
||||
return this;
|
||||
}
|
||||
setEncoding(_encoding) {
|
||||
return this;
|
||||
}
|
||||
pause() {
|
||||
return this;
|
||||
}
|
||||
resume() {
|
||||
return this;
|
||||
}
|
||||
setTimeout(_timeout, _callback) {
|
||||
return this;
|
||||
}
|
||||
setNoDelay(_noDelay) {
|
||||
return this;
|
||||
}
|
||||
setKeepAlive(_enable, _initialDelay) {
|
||||
return this;
|
||||
}
|
||||
address() {
|
||||
return {};
|
||||
}
|
||||
unref() {
|
||||
return this;
|
||||
}
|
||||
ref() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
45
node_modules/unenv/runtime/node/path/index.cjs
generated
vendored
Normal file
45
node_modules/unenv/runtime/node/path/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var _exportNames = {
|
||||
posix: true,
|
||||
win32: true,
|
||||
platform: true
|
||||
};
|
||||
exports.win32 = exports.posix = exports.platform = exports.default = void 0;
|
||||
|
||||
var _path = _interopRequireWildcard(require("pathe"));
|
||||
|
||||
Object.keys(_path).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === _path[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _path[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
||||
|
||||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
const _pathModule = { ..._path,
|
||||
platform: "posix",
|
||||
posix: void 0,
|
||||
win32: void 0
|
||||
};
|
||||
_pathModule.posix = _pathModule;
|
||||
_pathModule.win32 = _pathModule;
|
||||
const posix = _pathModule;
|
||||
exports.posix = posix;
|
||||
const win32 = _pathModule;
|
||||
exports.win32 = win32;
|
||||
const platform = "posix";
|
||||
exports.platform = platform;
|
||||
var _default = _pathModule;
|
||||
module.exports = _default;
|
||||
7
node_modules/unenv/runtime/node/path/index.d.ts
generated
vendored
Normal file
7
node_modules/unenv/runtime/node/path/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type path from "node:path";
|
||||
export * from "pathe";
|
||||
export declare const posix: typeof path.posix;
|
||||
export declare const win32: typeof path.posix;
|
||||
export declare const platform = "posix";
|
||||
declare const _default: any;
|
||||
export default _default;
|
||||
14
node_modules/unenv/runtime/node/path/index.mjs
generated
vendored
Normal file
14
node_modules/unenv/runtime/node/path/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import * as _path from "pathe";
|
||||
export * from "pathe";
|
||||
const _pathModule = {
|
||||
..._path,
|
||||
platform: "posix",
|
||||
posix: void 0,
|
||||
win32: void 0
|
||||
};
|
||||
_pathModule.posix = _pathModule;
|
||||
_pathModule.win32 = _pathModule;
|
||||
export const posix = _pathModule;
|
||||
export const win32 = _pathModule;
|
||||
export const platform = "posix";
|
||||
export default _pathModule;
|
||||
194
node_modules/unenv/runtime/node/process/_process.cjs
generated
vendored
Normal file
194
node_modules/unenv/runtime/node/process/_process.cjs
generated
vendored
Normal file
@@ -0,0 +1,194 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.process = void 0;
|
||||
const process = {};
|
||||
exports.process = process;
|
||||
let cachedSetTimeout;
|
||||
let cachedClearTimeout;
|
||||
|
||||
function defaultSetTimeout() {
|
||||
throw new Error("setTimeout has not been defined");
|
||||
}
|
||||
|
||||
function defaultClearTimeout() {
|
||||
throw new Error("clearTimeout has not been defined");
|
||||
}
|
||||
|
||||
(function () {
|
||||
try {
|
||||
cachedSetTimeout = typeof setTimeout === "function" ? setTimeout : defaultSetTimeout;
|
||||
} catch {
|
||||
cachedSetTimeout = defaultSetTimeout;
|
||||
}
|
||||
|
||||
try {
|
||||
cachedClearTimeout = typeof clearTimeout === "function" ? clearTimeout : defaultClearTimeout;
|
||||
} catch {
|
||||
cachedClearTimeout = defaultClearTimeout;
|
||||
}
|
||||
})();
|
||||
|
||||
function runTimeout(fun) {
|
||||
if (cachedSetTimeout === setTimeout) {
|
||||
return setTimeout(fun, 0);
|
||||
}
|
||||
|
||||
if ((cachedSetTimeout === defaultSetTimeout || !cachedSetTimeout) && setTimeout) {
|
||||
cachedSetTimeout = setTimeout;
|
||||
return setTimeout(fun, 0);
|
||||
}
|
||||
|
||||
try {
|
||||
return cachedSetTimeout(fun, 0);
|
||||
} catch {
|
||||
try {
|
||||
return cachedSetTimeout.call(null, fun, 0);
|
||||
} catch {
|
||||
return cachedSetTimeout.call(this, fun, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function runClearTimeout(marker) {
|
||||
if (cachedClearTimeout === clearTimeout) {
|
||||
return clearTimeout(marker);
|
||||
}
|
||||
|
||||
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
||||
cachedClearTimeout = clearTimeout;
|
||||
return clearTimeout(marker);
|
||||
}
|
||||
|
||||
try {
|
||||
return cachedClearTimeout(marker);
|
||||
} catch {
|
||||
try {
|
||||
return cachedClearTimeout.call(null, marker);
|
||||
} catch {
|
||||
return cachedClearTimeout.call(this, marker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let queue = [];
|
||||
let draining = false;
|
||||
let currentQueue;
|
||||
let queueIndex = -1;
|
||||
|
||||
function cleanUpNextTick() {
|
||||
if (!draining || !currentQueue) {
|
||||
return;
|
||||
}
|
||||
|
||||
draining = false;
|
||||
|
||||
if (currentQueue.length > 0) {
|
||||
queue = [...currentQueue, ...queue];
|
||||
} else {
|
||||
queueIndex = -1;
|
||||
}
|
||||
|
||||
if (queue.length > 0) {
|
||||
drainQueue();
|
||||
}
|
||||
}
|
||||
|
||||
function drainQueue() {
|
||||
if (draining) {
|
||||
return;
|
||||
}
|
||||
|
||||
const timeout = runTimeout(cleanUpNextTick);
|
||||
draining = true;
|
||||
let len = queue.length;
|
||||
|
||||
while (len) {
|
||||
currentQueue = queue;
|
||||
queue = [];
|
||||
|
||||
while (++queueIndex < len) {
|
||||
if (currentQueue) {
|
||||
currentQueue[queueIndex].run();
|
||||
}
|
||||
}
|
||||
|
||||
queueIndex = -1;
|
||||
len = queue.length;
|
||||
}
|
||||
|
||||
currentQueue = null;
|
||||
draining = false;
|
||||
runClearTimeout(timeout);
|
||||
}
|
||||
|
||||
process.nextTick = function (fun) {
|
||||
const args = Array.from({
|
||||
length: arguments.length - 1
|
||||
});
|
||||
|
||||
if (arguments.length > 1) {
|
||||
for (let i = 1; i < arguments.length; i++) {
|
||||
args[i - 1] = arguments[i];
|
||||
}
|
||||
}
|
||||
|
||||
queue.push(new Item(fun, args));
|
||||
|
||||
if (queue.length === 1 && !draining) {
|
||||
runTimeout(drainQueue);
|
||||
}
|
||||
};
|
||||
|
||||
function Item(fun, array) {
|
||||
this.fun = fun;
|
||||
this.array = array;
|
||||
}
|
||||
|
||||
Item.prototype.run = function () {
|
||||
this.fun.apply(null, this.array);
|
||||
};
|
||||
|
||||
process.title = "unenv";
|
||||
process.env = {};
|
||||
process.argv = [];
|
||||
process.version = "";
|
||||
process.versions = {};
|
||||
|
||||
function noop() {
|
||||
return process;
|
||||
}
|
||||
|
||||
process.on = noop;
|
||||
process.addListener = noop;
|
||||
process.once = noop;
|
||||
process.off = noop;
|
||||
process.removeListener = noop;
|
||||
process.removeAllListeners = noop;
|
||||
process.emit = noop;
|
||||
process.prependListener = noop;
|
||||
process.prependOnceListener = noop;
|
||||
|
||||
process.listeners = function (name) {
|
||||
return [];
|
||||
};
|
||||
|
||||
process.binding = function (name) {
|
||||
throw new Error("[unenv] process.binding is not supported");
|
||||
};
|
||||
|
||||
let cwd = "/";
|
||||
|
||||
process.cwd = function () {
|
||||
return cwd;
|
||||
};
|
||||
|
||||
process.chdir = function (dir) {
|
||||
cwd = dir;
|
||||
};
|
||||
|
||||
process.umask = function () {
|
||||
return 0;
|
||||
};
|
||||
2
node_modules/unenv/runtime/node/process/_process.d.ts
generated
vendored
Normal file
2
node_modules/unenv/runtime/node/process/_process.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/// <reference types="node" />
|
||||
export declare const process: NodeJS.Process;
|
||||
149
node_modules/unenv/runtime/node/process/_process.mjs
generated
vendored
Normal file
149
node_modules/unenv/runtime/node/process/_process.mjs
generated
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
export const process = {};
|
||||
let cachedSetTimeout;
|
||||
let cachedClearTimeout;
|
||||
function defaultSetTimeout() {
|
||||
throw new Error("setTimeout has not been defined");
|
||||
}
|
||||
function defaultClearTimeout() {
|
||||
throw new Error("clearTimeout has not been defined");
|
||||
}
|
||||
(function() {
|
||||
try {
|
||||
cachedSetTimeout = typeof setTimeout === "function" ? setTimeout : defaultSetTimeout;
|
||||
} catch {
|
||||
cachedSetTimeout = defaultSetTimeout;
|
||||
}
|
||||
try {
|
||||
cachedClearTimeout = typeof clearTimeout === "function" ? clearTimeout : defaultClearTimeout;
|
||||
} catch {
|
||||
cachedClearTimeout = defaultClearTimeout;
|
||||
}
|
||||
})();
|
||||
function runTimeout(fun) {
|
||||
if (cachedSetTimeout === setTimeout) {
|
||||
return setTimeout(fun, 0);
|
||||
}
|
||||
if ((cachedSetTimeout === defaultSetTimeout || !cachedSetTimeout) && setTimeout) {
|
||||
cachedSetTimeout = setTimeout;
|
||||
return setTimeout(fun, 0);
|
||||
}
|
||||
try {
|
||||
return cachedSetTimeout(fun, 0);
|
||||
} catch {
|
||||
try {
|
||||
return cachedSetTimeout.call(null, fun, 0);
|
||||
} catch {
|
||||
return cachedSetTimeout.call(this, fun, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
function runClearTimeout(marker) {
|
||||
if (cachedClearTimeout === clearTimeout) {
|
||||
return clearTimeout(marker);
|
||||
}
|
||||
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
||||
cachedClearTimeout = clearTimeout;
|
||||
return clearTimeout(marker);
|
||||
}
|
||||
try {
|
||||
return cachedClearTimeout(marker);
|
||||
} catch {
|
||||
try {
|
||||
return cachedClearTimeout.call(null, marker);
|
||||
} catch {
|
||||
return cachedClearTimeout.call(this, marker);
|
||||
}
|
||||
}
|
||||
}
|
||||
let queue = [];
|
||||
let draining = false;
|
||||
let currentQueue;
|
||||
let queueIndex = -1;
|
||||
function cleanUpNextTick() {
|
||||
if (!draining || !currentQueue) {
|
||||
return;
|
||||
}
|
||||
draining = false;
|
||||
if (currentQueue.length > 0) {
|
||||
queue = [...currentQueue, ...queue];
|
||||
} else {
|
||||
queueIndex = -1;
|
||||
}
|
||||
if (queue.length > 0) {
|
||||
drainQueue();
|
||||
}
|
||||
}
|
||||
function drainQueue() {
|
||||
if (draining) {
|
||||
return;
|
||||
}
|
||||
const timeout = runTimeout(cleanUpNextTick);
|
||||
draining = true;
|
||||
let len = queue.length;
|
||||
while (len) {
|
||||
currentQueue = queue;
|
||||
queue = [];
|
||||
while (++queueIndex < len) {
|
||||
if (currentQueue) {
|
||||
currentQueue[queueIndex].run();
|
||||
}
|
||||
}
|
||||
queueIndex = -1;
|
||||
len = queue.length;
|
||||
}
|
||||
currentQueue = null;
|
||||
draining = false;
|
||||
runClearTimeout(timeout);
|
||||
}
|
||||
process.nextTick = function(fun) {
|
||||
const args = Array.from({ length: arguments.length - 1 });
|
||||
if (arguments.length > 1) {
|
||||
for (let i = 1; i < arguments.length; i++) {
|
||||
args[i - 1] = arguments[i];
|
||||
}
|
||||
}
|
||||
queue.push(new Item(fun, args));
|
||||
if (queue.length === 1 && !draining) {
|
||||
runTimeout(drainQueue);
|
||||
}
|
||||
};
|
||||
function Item(fun, array) {
|
||||
this.fun = fun;
|
||||
this.array = array;
|
||||
}
|
||||
Item.prototype.run = function() {
|
||||
this.fun.apply(null, this.array);
|
||||
};
|
||||
process.title = "unenv";
|
||||
process.env = {};
|
||||
process.argv = [];
|
||||
process.version = "";
|
||||
process.versions = {};
|
||||
function noop() {
|
||||
return process;
|
||||
}
|
||||
process.on = noop;
|
||||
process.addListener = noop;
|
||||
process.once = noop;
|
||||
process.off = noop;
|
||||
process.removeListener = noop;
|
||||
process.removeAllListeners = noop;
|
||||
process.emit = noop;
|
||||
process.prependListener = noop;
|
||||
process.prependOnceListener = noop;
|
||||
process.listeners = function(name) {
|
||||
return [];
|
||||
};
|
||||
process.binding = function(name) {
|
||||
throw new Error("[unenv] process.binding is not supported");
|
||||
};
|
||||
let cwd = "/";
|
||||
process.cwd = function() {
|
||||
return cwd;
|
||||
};
|
||||
process.chdir = function(dir) {
|
||||
cwd = dir;
|
||||
};
|
||||
process.umask = function() {
|
||||
return 0;
|
||||
};
|
||||
11
node_modules/unenv/runtime/node/process/index.cjs
generated
vendored
Normal file
11
node_modules/unenv/runtime/node/process/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
module.exports = void 0;
|
||||
|
||||
var _process2 = require("./_process.cjs");
|
||||
|
||||
var _default = _process2.process;
|
||||
module.exports = _default;
|
||||
2
node_modules/unenv/runtime/node/process/index.d.ts
generated
vendored
Normal file
2
node_modules/unenv/runtime/node/process/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
declare const _default: any;
|
||||
export default _default;
|
||||
2
node_modules/unenv/runtime/node/process/index.mjs
generated
vendored
Normal file
2
node_modules/unenv/runtime/node/process/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import { process as _process } from "./_process.mjs";
|
||||
export default _process;
|
||||
27
node_modules/unenv/runtime/node/stream/consumers/index.cjs
generated
vendored
Normal file
27
node_modules/unenv/runtime/node/stream/consumers/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.text = exports.json = exports.default = exports.buffer = exports.blob = exports.arrayBuffer = void 0;
|
||||
|
||||
var _utils = require("../../../_internal/utils.cjs");
|
||||
|
||||
const arrayBuffer = (0, _utils.notImplemented)("stream.consumers.arrayBuffer");
|
||||
exports.arrayBuffer = arrayBuffer;
|
||||
const blob = (0, _utils.notImplemented)("stream.consumers.blob");
|
||||
exports.blob = blob;
|
||||
const buffer = (0, _utils.notImplemented)("stream.consumers.buffer");
|
||||
exports.buffer = buffer;
|
||||
const text = (0, _utils.notImplemented)("stream.consumers.text");
|
||||
exports.text = text;
|
||||
const json = (0, _utils.notImplemented)("stream.consumers.json");
|
||||
exports.json = json;
|
||||
var _default = {
|
||||
arrayBuffer,
|
||||
blob,
|
||||
buffer,
|
||||
text,
|
||||
json
|
||||
};
|
||||
module.exports = _default;
|
||||
9
node_modules/unenv/runtime/node/stream/consumers/index.d.ts
generated
vendored
Normal file
9
node_modules/unenv/runtime/node/stream/consumers/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/// <reference types="node" />
|
||||
import type * as stramConsumers from "node:stream/consumers";
|
||||
export declare const arrayBuffer: () => any;
|
||||
export declare const blob: () => any;
|
||||
export declare const buffer: () => any;
|
||||
export declare const text: () => any;
|
||||
export declare const json: () => any;
|
||||
declare const _default: typeof stramConsumers;
|
||||
export default _default;
|
||||
13
node_modules/unenv/runtime/node/stream/consumers/index.mjs
generated
vendored
Normal file
13
node_modules/unenv/runtime/node/stream/consumers/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { notImplemented } from "../../../_internal/utils.mjs";
|
||||
export const arrayBuffer = notImplemented("stream.consumers.arrayBuffer");
|
||||
export const blob = notImplemented("stream.consumers.blob");
|
||||
export const buffer = notImplemented("stream.consumers.buffer");
|
||||
export const text = notImplemented("stream.consumers.text");
|
||||
export const json = notImplemented("stream.consumers.json");
|
||||
export default {
|
||||
arrayBuffer,
|
||||
blob,
|
||||
buffer,
|
||||
text,
|
||||
json
|
||||
};
|
||||
25
node_modules/unenv/runtime/node/stream/duplex.cjs
generated
vendored
Normal file
25
node_modules/unenv/runtime/node/stream/duplex.cjs
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.Duplex = void 0;
|
||||
|
||||
var _utils = require("../../_internal/utils.cjs");
|
||||
|
||||
var _readable = require("./readable.cjs");
|
||||
|
||||
var _writable = require("./writable.cjs");
|
||||
|
||||
const Duplex = class {
|
||||
constructor(readable = new _readable.Readable(), writable = new _writable.Writable()) {
|
||||
this.allowHalfOpen = true;
|
||||
Object.assign(this, readable);
|
||||
Object.assign(this, writable);
|
||||
this._destroy = (0, _utils.mergeFns)(readable._destroy, writable._destroy);
|
||||
}
|
||||
|
||||
};
|
||||
exports.Duplex = Duplex;
|
||||
Object.assign(Duplex.prototype, _readable.Readable.prototype);
|
||||
Object.assign(Duplex.prototype, _writable.Writable.prototype);
|
||||
5
node_modules/unenv/runtime/node/stream/duplex.d.ts
generated
vendored
Normal file
5
node_modules/unenv/runtime/node/stream/duplex.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/// <reference types="node" />
|
||||
import type * as stream from "node:stream";
|
||||
declare type DuplexClass = new () => stream.Duplex;
|
||||
export declare const Duplex: DuplexClass;
|
||||
export {};
|
||||
13
node_modules/unenv/runtime/node/stream/duplex.mjs
generated
vendored
Normal file
13
node_modules/unenv/runtime/node/stream/duplex.mjs
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { mergeFns } from "../../_internal/utils.mjs";
|
||||
import { Readable } from "./readable.mjs";
|
||||
import { Writable } from "./writable.mjs";
|
||||
export const Duplex = class {
|
||||
constructor(readable = new Readable(), writable = new Writable()) {
|
||||
this.allowHalfOpen = true;
|
||||
Object.assign(this, readable);
|
||||
Object.assign(this, writable);
|
||||
this._destroy = mergeFns(readable._destroy, writable._destroy);
|
||||
}
|
||||
};
|
||||
Object.assign(Duplex.prototype, Readable.prototype);
|
||||
Object.assign(Duplex.prototype, Writable.prototype);
|
||||
100
node_modules/unenv/runtime/node/stream/index.cjs
generated
vendored
Normal file
100
node_modules/unenv/runtime/node/stream/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "Duplex", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _duplex.Duplex;
|
||||
}
|
||||
});
|
||||
exports.PassThrough = void 0;
|
||||
Object.defineProperty(exports, "Readable", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _readable.Readable;
|
||||
}
|
||||
});
|
||||
exports.Stream = void 0;
|
||||
Object.defineProperty(exports, "Transform", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _transform.Transform;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "Writable", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _writable.Writable;
|
||||
}
|
||||
});
|
||||
exports.pipeline = exports.isReadable = exports.isErrored = exports.isDisturbed = exports.finished = exports.destroy = exports.default = exports.compose = exports.addAbortSignal = exports._uint8ArrayToBuffer = exports._isUint8Array = void 0;
|
||||
|
||||
var _proxy = _interopRequireDefault(require("../../mock/proxy.cjs"));
|
||||
|
||||
var _utils = require("../../_internal/utils.cjs");
|
||||
|
||||
var _readable = require("./readable.cjs");
|
||||
|
||||
var _writable = require("./writable.cjs");
|
||||
|
||||
var _duplex = require("./duplex.cjs");
|
||||
|
||||
var _transform = require("./transform.cjs");
|
||||
|
||||
var _index = _interopRequireDefault(require("./promises/index.cjs"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const Stream = _proxy.default.__createMock__("Stream");
|
||||
|
||||
exports.Stream = Stream;
|
||||
|
||||
const PassThrough = _proxy.default.__createMock__("PassThrough");
|
||||
|
||||
exports.PassThrough = PassThrough;
|
||||
const pipeline = (0, _utils.notImplemented)("stream.pipeline");
|
||||
exports.pipeline = pipeline;
|
||||
const finished = (0, _utils.notImplemented)("stream.finished");
|
||||
exports.finished = finished;
|
||||
const addAbortSignal = (0, _utils.notImplemented)("stream.addAbortSignal");
|
||||
exports.addAbortSignal = addAbortSignal;
|
||||
const isDisturbed = (0, _utils.notImplemented)("stream.isDisturbed");
|
||||
exports.isDisturbed = isDisturbed;
|
||||
const isReadable = (0, _utils.notImplemented)("stream.isReadable");
|
||||
exports.isReadable = isReadable;
|
||||
const compose = (0, _utils.notImplemented)("stream.compose");
|
||||
exports.compose = compose;
|
||||
const isErrored = (0, _utils.notImplemented)("stream.isErrored");
|
||||
exports.isErrored = isErrored;
|
||||
const destroy = (0, _utils.notImplemented)("stream.destroy");
|
||||
exports.destroy = destroy;
|
||||
|
||||
const _isUint8Array = (0, _utils.notImplemented)("stream._isUint8Array");
|
||||
|
||||
exports._isUint8Array = _isUint8Array;
|
||||
|
||||
const _uint8ArrayToBuffer = (0, _utils.notImplemented)("stream._uint8ArrayToBuffer");
|
||||
|
||||
exports._uint8ArrayToBuffer = _uint8ArrayToBuffer;
|
||||
var _default = {
|
||||
Readable: _readable.Readable,
|
||||
Writable: _writable.Writable,
|
||||
Duplex: _duplex.Duplex,
|
||||
Transform: _transform.Transform,
|
||||
Stream,
|
||||
PassThrough,
|
||||
pipeline,
|
||||
finished,
|
||||
addAbortSignal,
|
||||
promises: _index.default,
|
||||
isDisturbed,
|
||||
isReadable,
|
||||
compose,
|
||||
_uint8ArrayToBuffer,
|
||||
isErrored,
|
||||
destroy,
|
||||
_isUint8Array
|
||||
};
|
||||
module.exports = _default;
|
||||
19
node_modules/unenv/runtime/node/stream/index.d.ts
generated
vendored
Normal file
19
node_modules/unenv/runtime/node/stream/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import stream from "node:stream";
|
||||
export { Readable } from "./readable";
|
||||
export { Writable } from "./writable";
|
||||
export { Duplex } from "./duplex";
|
||||
export { Transform } from "./transform";
|
||||
export declare const Stream: stream.Stream;
|
||||
export declare const PassThrough: stream.PassThrough;
|
||||
export declare const pipeline: typeof stream.pipeline;
|
||||
export declare const finished: typeof stream.finished;
|
||||
export declare const addAbortSignal: typeof stream.addAbortSignal;
|
||||
export declare const isDisturbed: () => any;
|
||||
export declare const isReadable: () => any;
|
||||
export declare const compose: () => any;
|
||||
export declare const isErrored: () => any;
|
||||
export declare const destroy: () => any;
|
||||
export declare const _isUint8Array: () => any;
|
||||
export declare const _uint8ArrayToBuffer: () => any;
|
||||
declare const _default: any;
|
||||
export default _default;
|
||||
42
node_modules/unenv/runtime/node/stream/index.mjs
generated
vendored
Normal file
42
node_modules/unenv/runtime/node/stream/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
import mock from "../../mock/proxy.mjs";
|
||||
import { notImplemented } from "../../_internal/utils.mjs";
|
||||
import { Readable } from "./readable.mjs";
|
||||
import { Writable } from "./writable.mjs";
|
||||
import { Duplex } from "./duplex.mjs";
|
||||
import { Transform } from "./transform.mjs";
|
||||
import promises from "./promises/index.mjs";
|
||||
export { Readable } from "./readable.mjs";
|
||||
export { Writable } from "./writable.mjs";
|
||||
export { Duplex } from "./duplex.mjs";
|
||||
export { Transform } from "./transform.mjs";
|
||||
export const Stream = mock.__createMock__("Stream");
|
||||
export const PassThrough = mock.__createMock__("PassThrough");
|
||||
export const pipeline = notImplemented("stream.pipeline");
|
||||
export const finished = notImplemented("stream.finished");
|
||||
export const addAbortSignal = notImplemented("stream.addAbortSignal");
|
||||
export const isDisturbed = notImplemented("stream.isDisturbed");
|
||||
export const isReadable = notImplemented("stream.isReadable");
|
||||
export const compose = notImplemented("stream.compose");
|
||||
export const isErrored = notImplemented("stream.isErrored");
|
||||
export const destroy = notImplemented("stream.destroy");
|
||||
export const _isUint8Array = notImplemented("stream._isUint8Array");
|
||||
export const _uint8ArrayToBuffer = notImplemented("stream._uint8ArrayToBuffer");
|
||||
export default {
|
||||
Readable,
|
||||
Writable,
|
||||
Duplex,
|
||||
Transform,
|
||||
Stream,
|
||||
PassThrough,
|
||||
pipeline,
|
||||
finished,
|
||||
addAbortSignal,
|
||||
promises,
|
||||
isDisturbed,
|
||||
isReadable,
|
||||
compose,
|
||||
_uint8ArrayToBuffer,
|
||||
isErrored,
|
||||
destroy,
|
||||
_isUint8Array
|
||||
};
|
||||
18
node_modules/unenv/runtime/node/stream/promises/index.cjs
generated
vendored
Normal file
18
node_modules/unenv/runtime/node/stream/promises/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.pipeline = exports.finished = exports.default = void 0;
|
||||
|
||||
var _utils = require("../../../_internal/utils.cjs");
|
||||
|
||||
const finished = (0, _utils.notImplemented)("stream.promises.finished");
|
||||
exports.finished = finished;
|
||||
const pipeline = (0, _utils.notImplemented)("stream.promises.pipeline");
|
||||
exports.pipeline = pipeline;
|
||||
var _default = {
|
||||
finished,
|
||||
pipeline
|
||||
};
|
||||
module.exports = _default;
|
||||
6
node_modules/unenv/runtime/node/stream/promises/index.d.ts
generated
vendored
Normal file
6
node_modules/unenv/runtime/node/stream/promises/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/// <reference types="node" />
|
||||
import type * as stramPromises from "node:stream/promises";
|
||||
export declare const finished: () => any;
|
||||
export declare const pipeline: () => any;
|
||||
declare const _default: typeof stramPromises;
|
||||
export default _default;
|
||||
7
node_modules/unenv/runtime/node/stream/promises/index.mjs
generated
vendored
Normal file
7
node_modules/unenv/runtime/node/stream/promises/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import { notImplemented } from "../../../_internal/utils.mjs";
|
||||
export const finished = notImplemented("stream.promises.finished");
|
||||
export const pipeline = notImplemented("stream.promises.pipeline");
|
||||
export default {
|
||||
finished,
|
||||
pipeline
|
||||
};
|
||||
83
node_modules/unenv/runtime/node/stream/readable.cjs
generated
vendored
Normal file
83
node_modules/unenv/runtime/node/stream/readable.cjs
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.Readable = void 0;
|
||||
|
||||
var _nodeEvents = require("node:events");
|
||||
|
||||
class Readable extends _nodeEvents.EventEmitter {
|
||||
constructor(_opts) {
|
||||
super();
|
||||
this.readableEncoding = null;
|
||||
this.readableEnded = true;
|
||||
this.readableFlowing = false;
|
||||
this.readableHighWaterMark = 0;
|
||||
this.readableLength = 0;
|
||||
this.readableObjectMode = false;
|
||||
this.readableAborted = false;
|
||||
this.readableDidRead = false;
|
||||
this.readable = false;
|
||||
this.destroyed = false;
|
||||
}
|
||||
|
||||
static from(_iterable, options) {
|
||||
return new Readable(options);
|
||||
}
|
||||
|
||||
_read(_size) {}
|
||||
|
||||
read(_size) {}
|
||||
|
||||
setEncoding(_encoding) {
|
||||
return this;
|
||||
}
|
||||
|
||||
pause() {
|
||||
return this;
|
||||
}
|
||||
|
||||
resume() {
|
||||
return this;
|
||||
}
|
||||
|
||||
isPaused() {
|
||||
return true;
|
||||
}
|
||||
|
||||
unpipe(_destination) {
|
||||
return this;
|
||||
}
|
||||
|
||||
unshift(_chunk, _encoding) {}
|
||||
|
||||
wrap(_oldStream) {
|
||||
return this;
|
||||
}
|
||||
|
||||
push(_chunk, _encoding) {
|
||||
return false;
|
||||
}
|
||||
|
||||
_destroy(_error, _callback) {
|
||||
this.removeAllListeners();
|
||||
}
|
||||
|
||||
destroy(error) {
|
||||
this.destroyed = true;
|
||||
|
||||
this._destroy(error);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
pipe(_destenition, _options) {
|
||||
return {};
|
||||
}
|
||||
|
||||
async *[Symbol.asyncIterator]() {}
|
||||
|
||||
}
|
||||
|
||||
exports.Readable = Readable;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user