mirror of
https://github.com/denoland/deno.git
synced 2024-12-25 00:29:09 -05:00
refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019)
This commit changes "include_js_files!" macro from "deno_core" in a way that "dir" option doesn't cause specifiers to be rewritten to include it. Example: ``` include_js_files! { dir "js", "hello.js", } ``` The above definition required embedders to use: `import ... from "internal:<ext_name>/js/hello.js"`. But with this change, the "js" directory in which the files are stored is an implementation detail, which for embedders results in: `import ... from "internal:<ext_name>/hello.js"`. The directory the files are stored in, is an implementation detail and in some cases might result in a significant size difference for the snapshot. As an example, in "deno_node" extension, we store the source code in "polyfills" directory; which resulted in each specifier to look like "internal:deno_node/polyfills/<module_name>", but with this change it's "internal:deno_node/<module_name>". Given that "deno_node" has over 100 files, many of them having several import specifiers to the same extension, this change removes 10 characters from each import specifier.
This commit is contained in:
parent
01028fcdf4
commit
b40086fd7d
219 changed files with 1205 additions and 1273 deletions
|
@ -3,9 +3,9 @@
|
||||||
const core = globalThis.Deno.core;
|
const core = globalThis.Deno.core;
|
||||||
const ops = core.ops;
|
const ops = core.ops;
|
||||||
const internals = globalThis.__bootstrap.internals;
|
const internals = globalThis.__bootstrap.internals;
|
||||||
import { setExitHandler } from "internal:runtime/js/30_os.js";
|
import { setExitHandler } from "internal:runtime/30_os.js";
|
||||||
import { Console } from "internal:deno_console/02_console.js";
|
import { Console } from "internal:deno_console/02_console.js";
|
||||||
import { serializePermissions } from "internal:runtime/js/10_permissions.js";
|
import { serializePermissions } from "internal:runtime/10_permissions.js";
|
||||||
import { assert } from "internal:deno_web/00_infra.js";
|
import { assert } from "internal:deno_web/00_infra.js";
|
||||||
const primordials = globalThis.__bootstrap.primordials;
|
const primordials = globalThis.__bootstrap.primordials;
|
||||||
const {
|
const {
|
||||||
|
@ -1424,6 +1424,6 @@ internals.testing = {
|
||||||
enableBench,
|
enableBench,
|
||||||
};
|
};
|
||||||
|
|
||||||
import { denoNs } from "internal:runtime/js/90_deno_ns.js";
|
import { denoNs } from "internal:runtime/90_deno_ns.js";
|
||||||
denoNs.bench = bench;
|
denoNs.bench = bench;
|
||||||
denoNs.test = test;
|
denoNs.test = test;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
await import("internal:runtime/js/01_build.js");
|
await import("internal:runtime/01_build.js");
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
error: Uncaught TypeError: Cannot load internal module from external code
|
error: Uncaught TypeError: Cannot load internal module from external code
|
||||||
await import("internal:runtime/js/01_build.js");
|
await import("internal:runtime/01_build.js");
|
||||||
^
|
^
|
||||||
at [WILDCARD]/internal_dynamic_import.ts:1:1
|
at [WILDCARD]/internal_dynamic_import.ts:1:1
|
||||||
|
|
2
cli/tests/testdata/run/internal_import.ts
vendored
2
cli/tests/testdata/run/internal_import.ts
vendored
|
@ -1 +1 @@
|
||||||
import "internal:runtime/js/01_build.js";
|
import "internal:runtime/01_build.js";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
error: Unsupported scheme "internal" for module "internal:runtime/js/01_build.js". Supported schemes: [
|
error: Unsupported scheme "internal" for module "internal:runtime/01_build.js". Supported schemes: [
|
||||||
"data",
|
"data",
|
||||||
"blob",
|
"blob",
|
||||||
"file",
|
"file",
|
||||||
|
|
|
@ -5,4 +5,4 @@ error: Uncaught (in worker "") Error
|
||||||
at Object.action (internal:deno_web/02_timers.js:[WILDCARD])
|
at Object.action (internal:deno_web/02_timers.js:[WILDCARD])
|
||||||
at handleTimerMacrotask (internal:deno_web/02_timers.js:[WILDCARD])
|
at handleTimerMacrotask (internal:deno_web/02_timers.js:[WILDCARD])
|
||||||
error: Uncaught (in promise) Error: Unhandled error in child worker.
|
error: Uncaught (in promise) Error: Unhandled error in child worker.
|
||||||
at Worker.#pollControl (internal:runtime/js/11_workers.js:[WILDCARD])
|
at Worker.#pollControl (internal:runtime/11_workers.js:[WILDCARD])
|
||||||
|
|
|
@ -37,13 +37,13 @@ failing step in failing test ... FAILED ([WILDCARD])
|
||||||
|
|
||||||
nested failure => ./test/steps/failing_steps.ts:[WILDCARD]
|
nested failure => ./test/steps/failing_steps.ts:[WILDCARD]
|
||||||
error: Error: 1 test step failed.
|
error: Error: 1 test step failed.
|
||||||
at runTest (internal:cli/js/40_testing.js:[WILDCARD])
|
at runTest (internal:cli/40_testing.js:[WILDCARD])
|
||||||
at async runTests (internal:cli/js/40_testing.js:[WILDCARD])
|
at async runTests (internal:cli/40_testing.js:[WILDCARD])
|
||||||
|
|
||||||
multiple test step failures => ./test/steps/failing_steps.ts:[WILDCARD]
|
multiple test step failures => ./test/steps/failing_steps.ts:[WILDCARD]
|
||||||
error: Error: 2 test steps failed.
|
error: Error: 2 test steps failed.
|
||||||
at runTest (internal:cli/js/40_testing.js:[WILDCARD])
|
at runTest (internal:cli/40_testing.js:[WILDCARD])
|
||||||
at async runTests (internal:cli/js/40_testing.js:[WILDCARD])
|
at async runTests (internal:cli/40_testing.js:[WILDCARD])
|
||||||
|
|
||||||
failing step in failing test => ./test/steps/failing_steps.ts:[WILDCARD]
|
failing step in failing test => ./test/steps/failing_steps.ts:[WILDCARD]
|
||||||
error: Error: Fail test.
|
error: Error: Fail test.
|
||||||
|
|
|
@ -323,7 +323,7 @@ macro_rules! include_js_files {
|
||||||
(dir $dir:literal, $($file:literal,)+) => {
|
(dir $dir:literal, $($file:literal,)+) => {
|
||||||
vec![
|
vec![
|
||||||
$($crate::ExtensionFileSource {
|
$($crate::ExtensionFileSource {
|
||||||
specifier: concat!($dir, "/", $file).to_string(),
|
specifier: concat!($file).to_string(),
|
||||||
code: $crate::ExtensionFileSourceCode::IncludedInBinary(
|
code: $crate::ExtensionFileSourceCode::IncludedInBinary(
|
||||||
include_str!(concat!($dir, "/", $file)
|
include_str!(concat!($dir, "/", $file)
|
||||||
)),
|
)),
|
||||||
|
@ -349,7 +349,7 @@ macro_rules! include_js_files {
|
||||||
(dir $dir:literal, $($file:literal,)+) => {
|
(dir $dir:literal, $($file:literal,)+) => {
|
||||||
vec![
|
vec![
|
||||||
$($crate::ExtensionFileSource {
|
$($crate::ExtensionFileSource {
|
||||||
specifier: concat!($dir, "/", $file).to_string(),
|
specifier: concat!($file).to_string(),
|
||||||
code: $crate::ExtensionFileSourceCode::LoadedFromFsDuringSnapshot(
|
code: $crate::ExtensionFileSourceCode::LoadedFromFsDuringSnapshot(
|
||||||
std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join($dir).join($file)
|
std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join($dir).join($file)
|
||||||
),
|
),
|
||||||
|
|
|
@ -364,7 +364,7 @@ pub fn init_polyfill() -> Extension {
|
||||||
|
|
||||||
Extension::builder(env!("CARGO_PKG_NAME"))
|
Extension::builder(env!("CARGO_PKG_NAME"))
|
||||||
.esm(esm_files)
|
.esm(esm_files)
|
||||||
.esm_entry_point("internal:deno_node/polyfills/module_all.ts")
|
.esm_entry_point("internal:deno_node/module_all.ts")
|
||||||
.ops(vec![
|
.ops(vec![
|
||||||
crypto::op_node_create_hash::decl(),
|
crypto::op_node_create_hash::decl(),
|
||||||
crypto::op_node_hash_update::decl(),
|
crypto::op_node_hash_update::decl(),
|
||||||
|
|
|
@ -21,75 +21,75 @@ pub struct NodeModulePolyfill {
|
||||||
pub static SUPPORTED_BUILTIN_NODE_MODULES: &[NodeModulePolyfill] = &[
|
pub static SUPPORTED_BUILTIN_NODE_MODULES: &[NodeModulePolyfill] = &[
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "assert",
|
name: "assert",
|
||||||
specifier: "internal:deno_node/polyfills/assert.ts",
|
specifier: "internal:deno_node/assert.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "assert/strict",
|
name: "assert/strict",
|
||||||
specifier: "internal:deno_node/polyfills/assert/strict.ts",
|
specifier: "internal:deno_node/assert/strict.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "async_hooks",
|
name: "async_hooks",
|
||||||
specifier: "internal:deno_node/polyfills/async_hooks.ts",
|
specifier: "internal:deno_node/async_hooks.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "buffer",
|
name: "buffer",
|
||||||
specifier: "internal:deno_node/polyfills/buffer.ts",
|
specifier: "internal:deno_node/buffer.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "child_process",
|
name: "child_process",
|
||||||
specifier: "internal:deno_node/polyfills/child_process.ts",
|
specifier: "internal:deno_node/child_process.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "cluster",
|
name: "cluster",
|
||||||
specifier: "internal:deno_node/polyfills/cluster.ts",
|
specifier: "internal:deno_node/cluster.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "console",
|
name: "console",
|
||||||
specifier: "internal:deno_node/polyfills/console.ts",
|
specifier: "internal:deno_node/console.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "constants",
|
name: "constants",
|
||||||
specifier: "internal:deno_node/polyfills/constants.ts",
|
specifier: "internal:deno_node/constants.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "crypto",
|
name: "crypto",
|
||||||
specifier: "internal:deno_node/polyfills/crypto.ts",
|
specifier: "internal:deno_node/crypto.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "dgram",
|
name: "dgram",
|
||||||
specifier: "internal:deno_node/polyfills/dgram.ts",
|
specifier: "internal:deno_node/dgram.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "dns",
|
name: "dns",
|
||||||
specifier: "internal:deno_node/polyfills/dns.ts",
|
specifier: "internal:deno_node/dns.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "dns/promises",
|
name: "dns/promises",
|
||||||
specifier: "internal:deno_node/polyfills/dns/promises.ts",
|
specifier: "internal:deno_node/dns/promises.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "domain",
|
name: "domain",
|
||||||
specifier: "internal:deno_node/polyfills/domain.ts",
|
specifier: "internal:deno_node/domain.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "events",
|
name: "events",
|
||||||
specifier: "internal:deno_node/polyfills/events.ts",
|
specifier: "internal:deno_node/events.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "fs",
|
name: "fs",
|
||||||
specifier: "internal:deno_node/polyfills/fs.ts",
|
specifier: "internal:deno_node/fs.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "fs/promises",
|
name: "fs/promises",
|
||||||
specifier: "internal:deno_node/polyfills/fs/promises.ts",
|
specifier: "internal:deno_node/fs/promises.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "http",
|
name: "http",
|
||||||
specifier: "internal:deno_node/polyfills/http.ts",
|
specifier: "internal:deno_node/http.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "https",
|
name: "https",
|
||||||
specifier: "internal:deno_node/polyfills/https.ts",
|
specifier: "internal:deno_node/https.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "module",
|
name: "module",
|
||||||
|
@ -97,106 +97,106 @@ pub static SUPPORTED_BUILTIN_NODE_MODULES: &[NodeModulePolyfill] = &[
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "net",
|
name: "net",
|
||||||
specifier: "internal:deno_node/polyfills/net.ts",
|
specifier: "internal:deno_node/net.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "os",
|
name: "os",
|
||||||
specifier: "internal:deno_node/polyfills/os.ts",
|
specifier: "internal:deno_node/os.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "path",
|
name: "path",
|
||||||
specifier: "internal:deno_node/polyfills/path.ts",
|
specifier: "internal:deno_node/path.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "path/posix",
|
name: "path/posix",
|
||||||
specifier: "internal:deno_node/polyfills/path/posix.ts",
|
specifier: "internal:deno_node/path/posix.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "path/win32",
|
name: "path/win32",
|
||||||
specifier: "internal:deno_node/polyfills/path/win32.ts",
|
specifier: "internal:deno_node/path/win32.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "perf_hooks",
|
name: "perf_hooks",
|
||||||
specifier: "internal:deno_node/polyfills/perf_hooks.ts",
|
specifier: "internal:deno_node/perf_hooks.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "process",
|
name: "process",
|
||||||
specifier: "internal:deno_node/polyfills/process.ts",
|
specifier: "internal:deno_node/process.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "querystring",
|
name: "querystring",
|
||||||
specifier: "internal:deno_node/polyfills/querystring.ts",
|
specifier: "internal:deno_node/querystring.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "readline",
|
name: "readline",
|
||||||
specifier: "internal:deno_node/polyfills/readline.ts",
|
specifier: "internal:deno_node/readline.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "stream",
|
name: "stream",
|
||||||
specifier: "internal:deno_node/polyfills/stream.ts",
|
specifier: "internal:deno_node/stream.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "stream/consumers",
|
name: "stream/consumers",
|
||||||
specifier: "internal:deno_node/polyfills/stream/consumers.mjs",
|
specifier: "internal:deno_node/stream/consumers.mjs",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "stream/promises",
|
name: "stream/promises",
|
||||||
specifier: "internal:deno_node/polyfills/stream/promises.mjs",
|
specifier: "internal:deno_node/stream/promises.mjs",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "stream/web",
|
name: "stream/web",
|
||||||
specifier: "internal:deno_node/polyfills/stream/web.ts",
|
specifier: "internal:deno_node/stream/web.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "string_decoder",
|
name: "string_decoder",
|
||||||
specifier: "internal:deno_node/polyfills/string_decoder.ts",
|
specifier: "internal:deno_node/string_decoder.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "sys",
|
name: "sys",
|
||||||
specifier: "internal:deno_node/polyfills/sys.ts",
|
specifier: "internal:deno_node/sys.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "timers",
|
name: "timers",
|
||||||
specifier: "internal:deno_node/polyfills/timers.ts",
|
specifier: "internal:deno_node/timers.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "timers/promises",
|
name: "timers/promises",
|
||||||
specifier: "internal:deno_node/polyfills/timers/promises.ts",
|
specifier: "internal:deno_node/timers/promises.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "tls",
|
name: "tls",
|
||||||
specifier: "internal:deno_node/polyfills/tls.ts",
|
specifier: "internal:deno_node/tls.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "tty",
|
name: "tty",
|
||||||
specifier: "internal:deno_node/polyfills/tty.ts",
|
specifier: "internal:deno_node/tty.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "url",
|
name: "url",
|
||||||
specifier: "internal:deno_node/polyfills/url.ts",
|
specifier: "internal:deno_node/url.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "util",
|
name: "util",
|
||||||
specifier: "internal:deno_node/polyfills/util.ts",
|
specifier: "internal:deno_node/util.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "util/types",
|
name: "util/types",
|
||||||
specifier: "internal:deno_node/polyfills/util/types.ts",
|
specifier: "internal:deno_node/util/types.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "v8",
|
name: "v8",
|
||||||
specifier: "internal:deno_node/polyfills/v8.ts",
|
specifier: "internal:deno_node/v8.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "vm",
|
name: "vm",
|
||||||
specifier: "internal:deno_node/polyfills/vm.ts",
|
specifier: "internal:deno_node/vm.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "worker_threads",
|
name: "worker_threads",
|
||||||
specifier: "internal:deno_node/polyfills/worker_threads.ts",
|
specifier: "internal:deno_node/worker_threads.ts",
|
||||||
},
|
},
|
||||||
NodeModulePolyfill {
|
NodeModulePolyfill {
|
||||||
name: "zlib",
|
name: "zlib",
|
||||||
specifier: "internal:deno_node/polyfills/zlib.ts",
|
specifier: "internal:deno_node/zlib.ts",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -24,21 +24,21 @@
|
||||||
|
|
||||||
const kRejection = Symbol.for("nodejs.rejection");
|
const kRejection = Symbol.for("nodejs.rejection");
|
||||||
|
|
||||||
import { inspect } from "internal:deno_node/polyfills/internal/util/inspect.mjs";
|
import { inspect } from "internal:deno_node/internal/util/inspect.mjs";
|
||||||
import {
|
import {
|
||||||
AbortError,
|
AbortError,
|
||||||
// kEnhanceStackBeforeInspector,
|
// kEnhanceStackBeforeInspector,
|
||||||
ERR_INVALID_ARG_TYPE,
|
ERR_INVALID_ARG_TYPE,
|
||||||
ERR_OUT_OF_RANGE,
|
ERR_OUT_OF_RANGE,
|
||||||
ERR_UNHANDLED_ERROR,
|
ERR_UNHANDLED_ERROR,
|
||||||
} from "internal:deno_node/polyfills/internal/errors.ts";
|
} from "internal:deno_node/internal/errors.ts";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
validateAbortSignal,
|
validateAbortSignal,
|
||||||
validateBoolean,
|
validateBoolean,
|
||||||
validateFunction,
|
validateFunction,
|
||||||
} from "internal:deno_node/polyfills/internal/validators.mjs";
|
} from "internal:deno_node/internal/validators.mjs";
|
||||||
import { spliceOne } from "internal:deno_node/polyfills/_utils.ts";
|
import { spliceOne } from "internal:deno_node/_utils.ts";
|
||||||
|
|
||||||
const kCapture = Symbol("kCapture");
|
const kCapture = Symbol("kCapture");
|
||||||
const kErrorMonitor = Symbol("events.errorMonitor");
|
const kErrorMonitor = Symbol("events.errorMonitor");
|
||||||
|
|
|
@ -3,15 +3,15 @@
|
||||||
import {
|
import {
|
||||||
type CallbackWithError,
|
type CallbackWithError,
|
||||||
makeCallback,
|
makeCallback,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
} from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
import { fs } from "internal:deno_node/polyfills/internal_binding/constants.ts";
|
import { fs } from "internal:deno_node/internal_binding/constants.ts";
|
||||||
import { codeMap } from "internal:deno_node/polyfills/internal_binding/uv.ts";
|
import { codeMap } from "internal:deno_node/internal_binding/uv.ts";
|
||||||
import {
|
import {
|
||||||
getValidatedPath,
|
getValidatedPath,
|
||||||
getValidMode,
|
getValidMode,
|
||||||
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
} from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
import type { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import type { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
export function access(
|
export function access(
|
||||||
path: string | Buffer | URL,
|
path: string | Buffer | URL,
|
||||||
|
|
|
@ -4,17 +4,17 @@ import {
|
||||||
isFd,
|
isFd,
|
||||||
maybeCallback,
|
maybeCallback,
|
||||||
WriteFileOptions,
|
WriteFileOptions,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
} from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
import { Encodings } from "internal:deno_node/polyfills/_utils.ts";
|
import { Encodings } from "internal:deno_node/_utils.ts";
|
||||||
import {
|
import {
|
||||||
copyObject,
|
copyObject,
|
||||||
getOptions,
|
getOptions,
|
||||||
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
} from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
import {
|
import {
|
||||||
writeFile,
|
writeFile,
|
||||||
writeFileSync,
|
writeFileSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_writeFile.ts";
|
} from "internal:deno_node/_fs/_fs_writeFile.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Also accept 'data' parameter as a Node polyfill Buffer type once these
|
* TODO: Also accept 'data' parameter as a Node polyfill Buffer type once these
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import type { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
import { getValidatedPath } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
import { getValidatedPath } from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
import * as pathModule from "internal:deno_node/polyfills/path.ts";
|
import * as pathModule from "internal:deno_node/path.ts";
|
||||||
import { parseFileMode } from "internal:deno_node/polyfills/internal/validators.mjs";
|
import { parseFileMode } from "internal:deno_node/internal/validators.mjs";
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
export function chmod(
|
export function chmod(
|
||||||
path: string | Buffer | URL,
|
path: string | Buffer | URL,
|
||||||
|
|
|
@ -2,15 +2,15 @@
|
||||||
import {
|
import {
|
||||||
type CallbackWithError,
|
type CallbackWithError,
|
||||||
makeCallback,
|
makeCallback,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
} from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
import {
|
import {
|
||||||
getValidatedPath,
|
getValidatedPath,
|
||||||
kMaxUserId,
|
kMaxUserId,
|
||||||
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
} from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
import * as pathModule from "internal:deno_node/polyfills/path.ts";
|
import * as pathModule from "internal:deno_node/path.ts";
|
||||||
import { validateInteger } from "internal:deno_node/polyfills/internal/validators.mjs";
|
import { validateInteger } from "internal:deno_node/internal/validators.mjs";
|
||||||
import type { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import type { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Asynchronously changes the owner and group
|
* Asynchronously changes the owner and group
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import type { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
import { getValidatedFd } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
import { getValidatedFd } from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
|
|
||||||
export function close(fd: number, callback: CallbackWithError) {
|
export function close(fd: number, callback: CallbackWithError) {
|
||||||
fd = getValidatedFd(fd);
|
fd = getValidatedFd(fd);
|
||||||
|
|
|
@ -7,15 +7,15 @@ import {
|
||||||
O_RDWR,
|
O_RDWR,
|
||||||
O_TRUNC,
|
O_TRUNC,
|
||||||
O_WRONLY,
|
O_WRONLY,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_constants.ts";
|
} from "internal:deno_node/_fs/_fs_constants.ts";
|
||||||
import { validateFunction } from "internal:deno_node/polyfills/internal/validators.mjs";
|
import { validateFunction } from "internal:deno_node/internal/validators.mjs";
|
||||||
import type { ErrnoException } from "internal:deno_node/polyfills/_global.d.ts";
|
import type { ErrnoException } from "internal:deno_node/_global.d.ts";
|
||||||
import {
|
import {
|
||||||
BinaryEncodings,
|
BinaryEncodings,
|
||||||
Encodings,
|
Encodings,
|
||||||
notImplemented,
|
notImplemented,
|
||||||
TextEncodings,
|
TextEncodings,
|
||||||
} from "internal:deno_node/polyfills/_utils.ts";
|
} from "internal:deno_node/_utils.ts";
|
||||||
|
|
||||||
export type CallbackWithError = (err: ErrnoException | null) => void;
|
export type CallbackWithError = (err: ErrnoException | null) => void;
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ export function getOpenOptions(
|
||||||
return openOptions;
|
return openOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
export { isUint32 as isFd } from "internal:deno_node/polyfills/internal/validators.mjs";
|
export { isUint32 as isFd } from "internal:deno_node/internal/validators.mjs";
|
||||||
|
|
||||||
export function maybeCallback(cb: unknown) {
|
export function maybeCallback(cb: unknown) {
|
||||||
validateFunction(cb, "cb");
|
validateFunction(cb, "cb");
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import { fs } from "internal:deno_node/polyfills/internal_binding/constants.ts";
|
import { fs } from "internal:deno_node/internal_binding/constants.ts";
|
||||||
|
|
||||||
export const {
|
export const {
|
||||||
F_OK,
|
F_OK,
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import type { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
import { makeCallback } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
import { makeCallback } from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import {
|
import {
|
||||||
getValidatedPath,
|
getValidatedPath,
|
||||||
getValidMode,
|
getValidMode,
|
||||||
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
} from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
import { fs } from "internal:deno_node/polyfills/internal_binding/constants.ts";
|
import { fs } from "internal:deno_node/internal_binding/constants.ts";
|
||||||
import { codeMap } from "internal:deno_node/polyfills/internal_binding/uv.ts";
|
import { codeMap } from "internal:deno_node/internal_binding/uv.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
export function copyFile(
|
export function copyFile(
|
||||||
src: string | Buffer | URL,
|
src: string | Buffer | URL,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import Dirent from "internal:deno_node/polyfills/_fs/_fs_dirent.ts";
|
import Dirent from "internal:deno_node/_fs/_fs_dirent.ts";
|
||||||
import { assert } from "internal:deno_node/polyfills/_util/asserts.ts";
|
import { assert } from "internal:deno_node/_util/asserts.ts";
|
||||||
import { ERR_MISSING_ARGS } from "internal:deno_node/polyfills/internal/errors.ts";
|
import { ERR_MISSING_ARGS } from "internal:deno_node/internal/errors.ts";
|
||||||
import { TextDecoder } from "internal:deno_web/08_text_encoding.js";
|
import { TextDecoder } from "internal:deno_web/08_text_encoding.js";
|
||||||
|
|
||||||
export default class Dir {
|
export default class Dir {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { notImplemented } from "internal:deno_node/polyfills/_utils.ts";
|
import { notImplemented } from "internal:deno_node/_utils.ts";
|
||||||
|
|
||||||
export default class Dirent {
|
export default class Dirent {
|
||||||
constructor(private entry: Deno.DirEntry) {}
|
constructor(private entry: Deno.DirEntry) {}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { fromFileUrl } from "internal:deno_node/polyfills/path.ts";
|
import { fromFileUrl } from "internal:deno_node/path.ts";
|
||||||
|
|
||||||
type ExistsCallback = (exists: boolean) => void;
|
type ExistsCallback = (exists: boolean) => void;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
import { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
|
|
||||||
export function fdatasync(
|
export function fdatasync(
|
||||||
fd: number,
|
fd: number,
|
||||||
|
|
|
@ -6,7 +6,7 @@ import {
|
||||||
statCallbackBigInt,
|
statCallbackBigInt,
|
||||||
statOptions,
|
statOptions,
|
||||||
Stats,
|
Stats,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_stat.ts";
|
} from "internal:deno_node/_fs/_fs_stat.ts";
|
||||||
|
|
||||||
export function fstat(fd: number, callback: statCallback): void;
|
export function fstat(fd: number, callback: statCallback): void;
|
||||||
export function fstat(
|
export function fstat(
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
import { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
|
|
||||||
export function fsync(
|
export function fsync(
|
||||||
fd: number,
|
fd: number,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
import { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
|
|
||||||
export function ftruncate(
|
export function ftruncate(
|
||||||
fd: number,
|
fd: number,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import type { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
|
|
||||||
function getValidTime(
|
function getValidTime(
|
||||||
time: number | string | Date,
|
time: number | string | Date,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import type { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
import { fromFileUrl } from "internal:deno_node/polyfills/path.ts";
|
import { fromFileUrl } from "internal:deno_node/path.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Also accept 'path' parameter as a Node polyfill Buffer type once these
|
* TODO: Also accept 'path' parameter as a Node polyfill Buffer type once these
|
||||||
|
|
|
@ -6,8 +6,8 @@ import {
|
||||||
statCallbackBigInt,
|
statCallbackBigInt,
|
||||||
statOptions,
|
statOptions,
|
||||||
Stats,
|
Stats,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_stat.ts";
|
} from "internal:deno_node/_fs/_fs_stat.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
export function lstat(path: string | URL, callback: statCallback): void;
|
export function lstat(path: string | URL, callback: statCallback): void;
|
||||||
export function lstat(
|
export function lstat(
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import type { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
import { denoErrorToNodeError } from "internal:deno_node/polyfills/internal/errors.ts";
|
import { denoErrorToNodeError } from "internal:deno_node/internal/errors.ts";
|
||||||
import { getValidatedPath } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
import { getValidatedPath } from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
import { validateBoolean } from "internal:deno_node/polyfills/internal/validators.mjs";
|
import { validateBoolean } from "internal:deno_node/internal/validators.mjs";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Also accept 'path' parameter as a Node polyfill Buffer type once these
|
* TODO: Also accept 'path' parameter as a Node polyfill Buffer type once these
|
||||||
|
|
|
@ -5,16 +5,13 @@ import {
|
||||||
TextDecoder,
|
TextDecoder,
|
||||||
TextEncoder,
|
TextEncoder,
|
||||||
} from "internal:deno_web/08_text_encoding.js";
|
} from "internal:deno_web/08_text_encoding.js";
|
||||||
import { existsSync } from "internal:deno_node/polyfills/_fs/_fs_exists.ts";
|
import { existsSync } from "internal:deno_node/_fs/_fs_exists.ts";
|
||||||
import {
|
import { mkdir, mkdirSync } from "internal:deno_node/_fs/_fs_mkdir.ts";
|
||||||
mkdir,
|
|
||||||
mkdirSync,
|
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_mkdir.ts";
|
|
||||||
import {
|
import {
|
||||||
ERR_INVALID_ARG_TYPE,
|
ERR_INVALID_ARG_TYPE,
|
||||||
ERR_INVALID_OPT_VALUE_ENCODING,
|
ERR_INVALID_OPT_VALUE_ENCODING,
|
||||||
} from "internal:deno_node/polyfills/internal/errors.ts";
|
} from "internal:deno_node/internal/errors.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
export type mkdtempCallback = (
|
export type mkdtempCallback = (
|
||||||
err: Error | null,
|
err: Error | null,
|
||||||
|
|
|
@ -6,13 +6,13 @@ import {
|
||||||
O_RDWR,
|
O_RDWR,
|
||||||
O_TRUNC,
|
O_TRUNC,
|
||||||
O_WRONLY,
|
O_WRONLY,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_constants.ts";
|
} from "internal:deno_node/_fs/_fs_constants.ts";
|
||||||
import { getOpenOptions } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
import { getOpenOptions } from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
import { parseFileMode } from "internal:deno_node/polyfills/internal/validators.mjs";
|
import { parseFileMode } from "internal:deno_node/internal/validators.mjs";
|
||||||
import { ERR_INVALID_ARG_TYPE } from "internal:deno_node/polyfills/internal/errors.ts";
|
import { ERR_INVALID_ARG_TYPE } from "internal:deno_node/internal/errors.ts";
|
||||||
import { getValidatedPath } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
import { getValidatedPath } from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
import type { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import type { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
|
|
||||||
function existsSync(filePath: string | URL): boolean {
|
function existsSync(filePath: string | URL): boolean {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import Dir from "internal:deno_node/polyfills/_fs/_fs_dir.ts";
|
import Dir from "internal:deno_node/_fs/_fs_dir.ts";
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import {
|
import {
|
||||||
getOptions,
|
getOptions,
|
||||||
getValidatedPath,
|
getValidatedPath,
|
||||||
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
} from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
import { denoErrorToNodeError } from "internal:deno_node/polyfills/internal/errors.ts";
|
import { denoErrorToNodeError } from "internal:deno_node/internal/errors.ts";
|
||||||
import {
|
import {
|
||||||
validateFunction,
|
validateFunction,
|
||||||
validateInteger,
|
validateInteger,
|
||||||
} from "internal:deno_node/polyfills/internal/validators.mjs";
|
} from "internal:deno_node/internal/validators.mjs";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
/** These options aren't funcitonally used right now, as `Dir` doesn't yet support them.
|
/** These options aren't funcitonally used right now, as `Dir` doesn't yet support them.
|
||||||
* However, these values are still validated.
|
* However, these values are still validated.
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import { ERR_INVALID_ARG_TYPE } from "internal:deno_node/polyfills/internal/errors.ts";
|
import { ERR_INVALID_ARG_TYPE } from "internal:deno_node/internal/errors.ts";
|
||||||
import {
|
import {
|
||||||
validateOffsetLengthRead,
|
validateOffsetLengthRead,
|
||||||
validatePosition,
|
validatePosition,
|
||||||
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
} from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
import {
|
import {
|
||||||
validateBuffer,
|
validateBuffer,
|
||||||
validateInteger,
|
validateInteger,
|
||||||
} from "internal:deno_node/polyfills/internal/validators.mjs";
|
} from "internal:deno_node/internal/validators.mjs";
|
||||||
|
|
||||||
type readOptions = {
|
type readOptions = {
|
||||||
buffer: Buffer | Uint8Array;
|
buffer: Buffer | Uint8Array;
|
||||||
|
|
|
@ -4,15 +4,15 @@ import {
|
||||||
FileOptionsArgument,
|
FileOptionsArgument,
|
||||||
getEncoding,
|
getEncoding,
|
||||||
TextOptionsArgument,
|
TextOptionsArgument,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
} from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import { fromFileUrl } from "internal:deno_node/polyfills/path.ts";
|
import { fromFileUrl } from "internal:deno_node/path.ts";
|
||||||
import {
|
import {
|
||||||
BinaryEncodings,
|
BinaryEncodings,
|
||||||
Encodings,
|
Encodings,
|
||||||
TextEncodings,
|
TextEncodings,
|
||||||
} from "internal:deno_node/polyfills/_utils.ts";
|
} from "internal:deno_node/_utils.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
function maybeDecode(data: Uint8Array, encoding: TextEncodings): string;
|
function maybeDecode(data: Uint8Array, encoding: TextEncodings): string;
|
||||||
function maybeDecode(
|
function maybeDecode(
|
||||||
|
|
|
@ -4,12 +4,12 @@ import {
|
||||||
TextDecoder,
|
TextDecoder,
|
||||||
TextEncoder,
|
TextEncoder,
|
||||||
} from "internal:deno_web/08_text_encoding.js";
|
} from "internal:deno_web/08_text_encoding.js";
|
||||||
import { asyncIterableToCallback } from "internal:deno_node/polyfills/_fs/_fs_watch.ts";
|
import { asyncIterableToCallback } from "internal:deno_node/_fs/_fs_watch.ts";
|
||||||
import Dirent from "internal:deno_node/polyfills/_fs/_fs_dirent.ts";
|
import Dirent from "internal:deno_node/_fs/_fs_dirent.ts";
|
||||||
import { denoErrorToNodeError } from "internal:deno_node/polyfills/internal/errors.ts";
|
import { denoErrorToNodeError } from "internal:deno_node/internal/errors.ts";
|
||||||
import { getValidatedPath } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
import { getValidatedPath } from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
function toDirent(val: Deno.DirEntry): Dirent {
|
function toDirent(val: Deno.DirEntry): Dirent {
|
||||||
return new Dirent(val);
|
return new Dirent(val);
|
||||||
|
|
|
@ -5,9 +5,9 @@ import {
|
||||||
intoCallbackAPIWithIntercept,
|
intoCallbackAPIWithIntercept,
|
||||||
MaybeEmpty,
|
MaybeEmpty,
|
||||||
notImplemented,
|
notImplemented,
|
||||||
} from "internal:deno_node/polyfills/_utils.ts";
|
} from "internal:deno_node/_utils.ts";
|
||||||
import { fromFileUrl } from "internal:deno_node/polyfills/path.ts";
|
import { fromFileUrl } from "internal:deno_node/path.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
type ReadlinkCallback = (
|
type ReadlinkCallback = (
|
||||||
err: MaybeEmpty<Error>,
|
err: MaybeEmpty<Error>,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
type Options = { encoding: string };
|
type Options = { encoding: string };
|
||||||
type Callback = (err: Error | null, path?: string) => void;
|
type Callback = (err: Error | null, path?: string) => void;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { fromFileUrl } from "internal:deno_node/polyfills/path.ts";
|
import { fromFileUrl } from "internal:deno_node/path.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
export function rename(
|
export function rename(
|
||||||
oldPath: string | URL,
|
oldPath: string | URL,
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
import {
|
import {
|
||||||
validateRmOptions,
|
validateRmOptions,
|
||||||
validateRmOptionsSync,
|
validateRmOptionsSync,
|
||||||
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
} from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
import { denoErrorToNodeError } from "internal:deno_node/polyfills/internal/errors.ts";
|
import { denoErrorToNodeError } from "internal:deno_node/internal/errors.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
type rmOptions = {
|
type rmOptions = {
|
||||||
force?: boolean;
|
force?: boolean;
|
||||||
|
|
|
@ -5,14 +5,14 @@ import {
|
||||||
validateRmdirOptions,
|
validateRmdirOptions,
|
||||||
validateRmOptions,
|
validateRmOptions,
|
||||||
validateRmOptionsSync,
|
validateRmOptionsSync,
|
||||||
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
} from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
import { toNamespacedPath } from "internal:deno_node/polyfills/path.ts";
|
import { toNamespacedPath } from "internal:deno_node/path.ts";
|
||||||
import {
|
import {
|
||||||
denoErrorToNodeError,
|
denoErrorToNodeError,
|
||||||
ERR_FS_RMDIR_ENOTDIR,
|
ERR_FS_RMDIR_ENOTDIR,
|
||||||
} from "internal:deno_node/polyfills/internal/errors.ts";
|
} from "internal:deno_node/internal/errors.ts";
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
type rmdirOptions = {
|
type rmdirOptions = {
|
||||||
maxRetries?: number;
|
maxRetries?: number;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { denoErrorToNodeError } from "internal:deno_node/polyfills/internal/errors.ts";
|
import { denoErrorToNodeError } from "internal:deno_node/internal/errors.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
export type statOptions = {
|
export type statOptions = {
|
||||||
bigint: boolean;
|
bigint: boolean;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
import { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
import { fromFileUrl } from "internal:deno_node/polyfills/path.ts";
|
import { fromFileUrl } from "internal:deno_node/path.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
type SymlinkType = "file" | "dir";
|
type SymlinkType = "file" | "dir";
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
import { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
import { fromFileUrl } from "internal:deno_node/polyfills/path.ts";
|
import { fromFileUrl } from "internal:deno_node/path.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
export function truncate(
|
export function truncate(
|
||||||
path: string | URL,
|
path: string | URL,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
export function unlink(path: string | URL, callback: (err?: Error) => void) {
|
export function unlink(path: string | URL, callback: (err?: Error) => void) {
|
||||||
if (!callback) throw new Error("No callback function supplied");
|
if (!callback) throw new Error("No callback function supplied");
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import type { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
import { fromFileUrl } from "internal:deno_node/polyfills/path.ts";
|
import { fromFileUrl } from "internal:deno_node/path.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
function getValidTime(
|
function getValidTime(
|
||||||
time: number | string | Date,
|
time: number | string | Date,
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { basename } from "internal:deno_node/polyfills/path.ts";
|
import { basename } from "internal:deno_node/path.ts";
|
||||||
import { EventEmitter } from "internal:deno_node/polyfills/events.ts";
|
import { EventEmitter } from "internal:deno_node/events.ts";
|
||||||
import { notImplemented } from "internal:deno_node/polyfills/_utils.ts";
|
import { notImplemented } from "internal:deno_node/_utils.ts";
|
||||||
import { promisify } from "internal:deno_node/polyfills/util.ts";
|
import { promisify } from "internal:deno_node/util.ts";
|
||||||
import { getValidatedPath } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
import { getValidatedPath } from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
import { validateFunction } from "internal:deno_node/polyfills/internal/validators.mjs";
|
import { validateFunction } from "internal:deno_node/internal/validators.mjs";
|
||||||
import { stat, Stats } from "internal:deno_node/polyfills/_fs/_fs_stat.ts";
|
import { stat, Stats } from "internal:deno_node/_fs/_fs_stat.ts";
|
||||||
import { Stats as StatsClass } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
import { Stats as StatsClass } from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import { delay } from "internal:deno_node/polyfills/_util/async.ts";
|
import { delay } from "internal:deno_node/_util/async.ts";
|
||||||
|
|
||||||
const statPromisified = promisify(stat);
|
const statPromisified = promisify(stat);
|
||||||
const statAsync = async (filename: string): Promise<Stats | null> => {
|
const statAsync = async (filename: string): Promise<Stats | null> => {
|
||||||
|
|
2
ext/node/polyfills/_fs/_fs_write.d.ts
vendored
2
ext/node/polyfills/_fs/_fs_write.d.ts
vendored
|
@ -4,7 +4,7 @@
|
||||||
import {
|
import {
|
||||||
BufferEncoding,
|
BufferEncoding,
|
||||||
ErrnoException,
|
ErrnoException,
|
||||||
} from "internal:deno_node/polyfills/_global.d.ts";
|
} from "internal:deno_node/_global.d.ts";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write `buffer` to the file specified by `fd`. If `buffer` is a normal object, it
|
* Write `buffer` to the file specified by `fd`. If `buffer` is a normal object, it
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
// Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license.
|
// Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license.
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import { validateEncoding, validateInteger } from "internal:deno_node/polyfills/internal/validators.mjs";
|
import { validateEncoding, validateInteger } from "internal:deno_node/internal/validators.mjs";
|
||||||
import {
|
import {
|
||||||
getValidatedFd,
|
getValidatedFd,
|
||||||
showStringCoercionDeprecation,
|
showStringCoercionDeprecation,
|
||||||
validateOffsetLengthWrite,
|
validateOffsetLengthWrite,
|
||||||
validateStringAfterArrayBufferView,
|
validateStringAfterArrayBufferView,
|
||||||
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
} from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
import { isArrayBufferView } from "internal:deno_node/polyfills/internal/util/types.ts";
|
import { isArrayBufferView } from "internal:deno_node/internal/util/types.ts";
|
||||||
import { maybeCallback } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
import { maybeCallback } from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
|
|
||||||
export function writeSync(fd, buffer, offset, length, position) {
|
export function writeSync(fd, buffer, offset, length, position) {
|
||||||
fd = getValidatedFd(fd);
|
fd = getValidatedFd(fd);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { Encodings } from "internal:deno_node/polyfills/_utils.ts";
|
import { Encodings } from "internal:deno_node/_utils.ts";
|
||||||
import { fromFileUrl } from "internal:deno_node/polyfills/path.ts";
|
import { fromFileUrl } from "internal:deno_node/path.ts";
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import {
|
import {
|
||||||
CallbackWithError,
|
CallbackWithError,
|
||||||
checkEncoding,
|
checkEncoding,
|
||||||
|
@ -9,17 +9,17 @@ import {
|
||||||
getOpenOptions,
|
getOpenOptions,
|
||||||
isFileOptions,
|
isFileOptions,
|
||||||
WriteFileOptions,
|
WriteFileOptions,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
} from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
import { isWindows } from "internal:deno_node/polyfills/_util/os.ts";
|
import { isWindows } from "internal:deno_node/_util/os.ts";
|
||||||
import {
|
import {
|
||||||
AbortError,
|
AbortError,
|
||||||
denoErrorToNodeError,
|
denoErrorToNodeError,
|
||||||
} from "internal:deno_node/polyfills/internal/errors.ts";
|
} from "internal:deno_node/internal/errors.ts";
|
||||||
import {
|
import {
|
||||||
showStringCoercionDeprecation,
|
showStringCoercionDeprecation,
|
||||||
validateStringAfterArrayBufferView,
|
validateStringAfterArrayBufferView,
|
||||||
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
} from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
interface Writer {
|
interface Writer {
|
||||||
write(p: Uint8Array): Promise<number>;
|
write(p: Uint8Array): Promise<number>;
|
||||||
|
|
2
ext/node/polyfills/_fs/_fs_writev.d.ts
vendored
2
ext/node/polyfills/_fs/_fs_writev.d.ts
vendored
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
// Forked from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/d9df51e34526f48bef4e2546a006157b391ad96c/types/node/fs.d.ts
|
// Forked from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/d9df51e34526f48bef4e2546a006157b391ad96c/types/node/fs.d.ts
|
||||||
|
|
||||||
import { ErrnoException } from "internal:deno_node/polyfills/_global.d.ts";
|
import { ErrnoException } from "internal:deno_node/_global.d.ts";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`.
|
* Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`.
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
// Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license.
|
// Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license.
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import { validateBufferArray } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
import { validateBufferArray } from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
import { getValidatedFd } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
import { getValidatedFd } from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
import { maybeCallback } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
|
import { maybeCallback } from "internal:deno_node/_fs/_fs_common.ts";
|
||||||
|
|
||||||
export function writev(fd, buffers, position, callback) {
|
export function writev(fd, buffers, position, callback) {
|
||||||
const innerWritev = async (fd, buffers, position) => {
|
const innerWritev = async (fd, buffers, position) => {
|
||||||
|
|
4
ext/node/polyfills/_global.d.ts
vendored
4
ext/node/polyfills/_global.d.ts
vendored
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { EventEmitter } from "internal:deno_node/polyfills/_events.d.ts";
|
import { EventEmitter } from "internal:deno_node/_events.d.ts";
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
|
|
||||||
/** One of:
|
/** One of:
|
||||||
* | "ascii"
|
* | "ascii"
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import * as net from "internal:deno_node/polyfills/net.ts";
|
import * as net from "internal:deno_node/net.ts";
|
||||||
import EventEmitter from "internal:deno_node/polyfills/events.ts";
|
import EventEmitter from "internal:deno_node/events.ts";
|
||||||
import { debuglog } from "internal:deno_node/polyfills/internal/util/debuglog.ts";
|
import { debuglog } from "internal:deno_node/internal/util/debuglog.ts";
|
||||||
let debug = debuglog("http", (fn) => {
|
let debug = debuglog("http", (fn) => {
|
||||||
debug = fn;
|
debug = fn;
|
||||||
});
|
});
|
||||||
import { AsyncResource } from "internal:deno_node/polyfills/async_hooks.ts";
|
import { AsyncResource } from "internal:deno_node/async_hooks.ts";
|
||||||
import { symbols } from "internal:deno_node/polyfills/internal/async_hooks.ts";
|
import { symbols } from "internal:deno_node/internal/async_hooks.ts";
|
||||||
// deno-lint-ignore camelcase
|
// deno-lint-ignore camelcase
|
||||||
const { async_id_symbol } = symbols;
|
const { async_id_symbol } = symbols;
|
||||||
import { ERR_OUT_OF_RANGE } from "internal:deno_node/polyfills/internal/errors.ts";
|
import { ERR_OUT_OF_RANGE } from "internal:deno_node/internal/errors.ts";
|
||||||
import { once } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { once } from "internal:deno_node/internal/util.mjs";
|
||||||
import {
|
import {
|
||||||
validateNumber,
|
validateNumber,
|
||||||
validateOneOf,
|
validateOneOf,
|
||||||
validateString,
|
validateString,
|
||||||
} from "internal:deno_node/polyfills/internal/validators.mjs";
|
} from "internal:deno_node/internal/validators.mjs";
|
||||||
|
|
||||||
const kOnKeylog = Symbol("onkeylog");
|
const kOnKeylog = Symbol("onkeylog");
|
||||||
const kRequestOptions = Symbol("requestOptions");
|
const kRequestOptions = Symbol("requestOptions");
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import { getDefaultHighWaterMark } from "internal:deno_node/polyfills/internal/streams/state.mjs";
|
import { getDefaultHighWaterMark } from "internal:deno_node/internal/streams/state.mjs";
|
||||||
import assert from "internal:deno_node/polyfills/internal/assert.mjs";
|
import assert from "internal:deno_node/internal/assert.mjs";
|
||||||
import EE from "internal:deno_node/polyfills/events.ts";
|
import EE from "internal:deno_node/events.ts";
|
||||||
import { Stream } from "internal:deno_node/polyfills/stream.ts";
|
import { Stream } from "internal:deno_node/stream.ts";
|
||||||
import { deprecate } from "internal:deno_node/polyfills/util.ts";
|
import { deprecate } from "internal:deno_node/util.ts";
|
||||||
import type { Socket } from "internal:deno_node/polyfills/net.ts";
|
import type { Socket } from "internal:deno_node/net.ts";
|
||||||
import {
|
import {
|
||||||
kNeedDrain,
|
kNeedDrain,
|
||||||
kOutHeaders,
|
kOutHeaders,
|
||||||
utcDate,
|
utcDate,
|
||||||
} from "internal:deno_node/polyfills/internal/http.ts";
|
} from "internal:deno_node/internal/http.ts";
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import {
|
import {
|
||||||
_checkInvalidHeaderChar as checkInvalidHeaderChar,
|
_checkInvalidHeaderChar as checkInvalidHeaderChar,
|
||||||
_checkIsHttpToken as checkIsHttpToken,
|
_checkIsHttpToken as checkIsHttpToken,
|
||||||
chunkExpression as RE_TE_CHUNKED,
|
chunkExpression as RE_TE_CHUNKED,
|
||||||
} from "internal:deno_node/polyfills/_http_common.ts";
|
} from "internal:deno_node/_http_common.ts";
|
||||||
import {
|
import {
|
||||||
defaultTriggerAsyncIdScope,
|
defaultTriggerAsyncIdScope,
|
||||||
symbols,
|
symbols,
|
||||||
} from "internal:deno_node/polyfills/internal/async_hooks.ts";
|
} from "internal:deno_node/internal/async_hooks.ts";
|
||||||
// deno-lint-ignore camelcase
|
// deno-lint-ignore camelcase
|
||||||
const { async_id_symbol } = symbols;
|
const { async_id_symbol } = symbols;
|
||||||
import {
|
import {
|
||||||
|
@ -39,11 +39,11 @@ import {
|
||||||
ERR_STREAM_NULL_VALUES,
|
ERR_STREAM_NULL_VALUES,
|
||||||
ERR_STREAM_WRITE_AFTER_END,
|
ERR_STREAM_WRITE_AFTER_END,
|
||||||
hideStackFrames,
|
hideStackFrames,
|
||||||
} from "internal:deno_node/polyfills/internal/errors.ts";
|
} from "internal:deno_node/internal/errors.ts";
|
||||||
import { validateString } from "internal:deno_node/polyfills/internal/validators.mjs";
|
import { validateString } from "internal:deno_node/internal/validators.mjs";
|
||||||
import { isUint8Array } from "internal:deno_node/polyfills/internal/util/types.ts";
|
import { isUint8Array } from "internal:deno_node/internal/util/types.ts";
|
||||||
|
|
||||||
import { debuglog } from "internal:deno_node/polyfills/internal/util/debuglog.ts";
|
import { debuglog } from "internal:deno_node/internal/util/debuglog.ts";
|
||||||
let debug = debuglog("http", (fn) => {
|
let debug = debuglog("http", (fn) => {
|
||||||
debug = fn;
|
debug = fn;
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
// Copyright Joyent, Inc. and other Node contributors.
|
// Copyright Joyent, Inc. and other Node contributors.
|
||||||
|
|
||||||
import { core } from "internal:deno_node/polyfills/_core.ts";
|
import { core } from "internal:deno_node/_core.ts";
|
||||||
import { validateFunction } from "internal:deno_node/polyfills/internal/validators.mjs";
|
import { validateFunction } from "internal:deno_node/internal/validators.mjs";
|
||||||
import { _exiting } from "internal:deno_node/polyfills/_process/exiting.ts";
|
import { _exiting } from "internal:deno_node/_process/exiting.ts";
|
||||||
import { FixedQueue } from "internal:deno_node/polyfills/internal/fixed_queue.ts";
|
import { FixedQueue } from "internal:deno_node/internal/fixed_queue.ts";
|
||||||
|
|
||||||
interface Tock {
|
interface Tock {
|
||||||
callback: (...args: Array<unknown>) => void;
|
callback: (...args: Array<unknown>) => void;
|
||||||
|
|
|
@ -418,7 +418,7 @@ const gen_bitlen = (s, desc) => // deflate_state *s;
|
||||||
/* Now recompute all bit lengths, scanning in increasing frequency.
|
/* Now recompute all bit lengths, scanning in increasing frequency.
|
||||||
* h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
|
* h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
|
||||||
* lengths instead of fixing only the wrong ones. This idea is taken
|
* lengths instead of fixing only the wrong ones. This idea is taken
|
||||||
* from "internal:deno_node/polyfills/ar" written by Haruhiko Okumura.)
|
* from "internal:deno_node/ar" written by Haruhiko Okumura.)
|
||||||
*/
|
*/
|
||||||
for (bits = max_length; bits !== 0; bits--) {
|
for (bits = max_length; bits !== 0; bits--) {
|
||||||
n = s.bl_count[bits];
|
n = s.bl_count[bits];
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
// The following are all the process APIs that don't depend on the stream module
|
// The following are all the process APIs that don't depend on the stream module
|
||||||
// They have to be split this way to prevent a circular dependency
|
// They have to be split this way to prevent a circular dependency
|
||||||
|
|
||||||
import { build } from "internal:runtime/js/01_build.js";
|
import { build } from "internal:runtime/01_build.js";
|
||||||
import { nextTick as _nextTick } from "internal:deno_node/polyfills/_next_tick.ts";
|
import { nextTick as _nextTick } from "internal:deno_node/_next_tick.ts";
|
||||||
import { _exiting } from "internal:deno_node/polyfills/_process/exiting.ts";
|
import { _exiting } from "internal:deno_node/_process/exiting.ts";
|
||||||
import * as fs from "internal:runtime/js/30_fs.js";
|
import * as fs from "internal:runtime/30_fs.js";
|
||||||
|
|
||||||
/** Returns the operating system CPU architecture for which the Deno binary was compiled */
|
/** Returns the operating system CPU architecture for which the Deno binary was compiled */
|
||||||
export function arch(): string {
|
export function arch(): string {
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
// Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license.
|
// Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import {
|
import {
|
||||||
clearLine,
|
clearLine,
|
||||||
clearScreenDown,
|
clearScreenDown,
|
||||||
cursorTo,
|
cursorTo,
|
||||||
moveCursor,
|
moveCursor,
|
||||||
} from "internal:deno_node/polyfills/internal/readline/callbacks.mjs";
|
} from "internal:deno_node/internal/readline/callbacks.mjs";
|
||||||
import { Duplex, Readable, Writable } from "internal:deno_node/polyfills/stream.ts";
|
import { Duplex, Readable, Writable } from "internal:deno_node/stream.ts";
|
||||||
import { isWindows } from "internal:deno_node/polyfills/_util/os.ts";
|
import { isWindows } from "internal:deno_node/_util/os.ts";
|
||||||
import { fs as fsConstants } from "internal:deno_node/polyfills/internal_binding/constants.ts";
|
import { fs as fsConstants } from "internal:deno_node/internal_binding/constants.ts";
|
||||||
import * as files from "internal:runtime/js/40_files.js";
|
import * as files from "internal:runtime/40_files.js";
|
||||||
|
|
||||||
// https://github.com/nodejs/node/blob/00738314828074243c9a52a228ab4c68b04259ef/lib/internal/bootstrap/switches/is_main_thread.js#L41
|
// https://github.com/nodejs/node/blob/00738314828074243c9a52a228ab4c68b04259ef/lib/internal/bootstrap/switches/is_main_thread.js#L41
|
||||||
export function createWritableStdioStream(writer, name) {
|
export function createWritableStdioStream(writer, name) {
|
||||||
|
|
13
ext/node/polyfills/_readline.d.ts
vendored
13
ext/node/polyfills/_readline.d.ts
vendored
|
@ -3,22 +3,19 @@
|
||||||
|
|
||||||
// Forked from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/cd61f5b4d3d143108569ec3f88adc0eb34b961c4/types/node/readline.d.ts
|
// Forked from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/cd61f5b4d3d143108569ec3f88adc0eb34b961c4/types/node/readline.d.ts
|
||||||
|
|
||||||
import {
|
import { Abortable, EventEmitter } from "internal:deno_node/_events.d.ts";
|
||||||
Abortable,
|
import * as promises from "internal:deno_node/readline/promises.ts";
|
||||||
EventEmitter,
|
|
||||||
} from "internal:deno_node/polyfills/_events.d.ts";
|
|
||||||
import * as promises from "internal:deno_node/polyfills/readline/promises.ts";
|
|
||||||
import {
|
import {
|
||||||
ReadableStream,
|
ReadableStream,
|
||||||
WritableStream,
|
WritableStream,
|
||||||
} from "internal:deno_node/polyfills/_global.d.ts";
|
} from "internal:deno_node/_global.d.ts";
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import type {
|
import type {
|
||||||
AsyncCompleter,
|
AsyncCompleter,
|
||||||
Completer,
|
Completer,
|
||||||
CompleterResult,
|
CompleterResult,
|
||||||
ReadLineOptions,
|
ReadLineOptions,
|
||||||
} from "internal:deno_node/polyfills/_readline_shared_types.d.ts";
|
} from "internal:deno_node/_readline_shared_types.d.ts";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The `readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time.
|
* The `readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time.
|
||||||
|
|
|
@ -27,13 +27,13 @@ import {
|
||||||
clearScreenDown,
|
clearScreenDown,
|
||||||
cursorTo,
|
cursorTo,
|
||||||
moveCursor,
|
moveCursor,
|
||||||
} from "internal:deno_node/polyfills/internal/readline/callbacks.mjs";
|
} from "internal:deno_node/internal/readline/callbacks.mjs";
|
||||||
import { emitKeypressEvents } from "internal:deno_node/polyfills/internal/readline/emitKeypressEvents.mjs";
|
import { emitKeypressEvents } from "internal:deno_node/internal/readline/emitKeypressEvents.mjs";
|
||||||
import promises from "internal:deno_node/polyfills/readline/promises.ts";
|
import promises from "internal:deno_node/readline/promises.ts";
|
||||||
import { validateAbortSignal } from "internal:deno_node/polyfills/internal/validators.mjs";
|
import { validateAbortSignal } from "internal:deno_node/internal/validators.mjs";
|
||||||
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { promisify } from "internal:deno_node/internal/util.mjs";
|
||||||
import { AbortError } from "internal:deno_node/polyfills/internal/errors.ts";
|
import { AbortError } from "internal:deno_node/internal/errors.ts";
|
||||||
import process from "internal:deno_node/polyfills/process.ts";
|
import process from "internal:deno_node/process.ts";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Interface as _Interface,
|
Interface as _Interface,
|
||||||
|
@ -71,7 +71,7 @@ import {
|
||||||
kWordLeft,
|
kWordLeft,
|
||||||
kWordRight,
|
kWordRight,
|
||||||
kWriteToOutput,
|
kWriteToOutput,
|
||||||
} from "internal:deno_node/polyfills/internal/readline/interface.mjs";
|
} from "internal:deno_node/internal/readline/interface.mjs";
|
||||||
|
|
||||||
function Interface(input, output, completer, terminal) {
|
function Interface(input, output, completer, terminal) {
|
||||||
if (!(this instanceof Interface)) {
|
if (!(this instanceof Interface)) {
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import type {
|
import type {
|
||||||
ReadableStream,
|
ReadableStream,
|
||||||
WritableStream,
|
WritableStream,
|
||||||
} from "internal:deno_node/polyfills/_global.d.ts";
|
} from "internal:deno_node/_global.d.ts";
|
||||||
|
|
||||||
export type Completer = (line: string) => CompleterResult;
|
export type Completer = (line: string) => CompleterResult;
|
||||||
export type AsyncCompleter = (
|
export type AsyncCompleter = (
|
||||||
|
|
9
ext/node/polyfills/_stream.d.ts
vendored
9
ext/node/polyfills/_stream.d.ts
vendored
|
@ -3,11 +3,8 @@
|
||||||
|
|
||||||
// Forked from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/4f538975138678878fed5b2555c0672aa578ab7d/types/node/stream.d.ts
|
// Forked from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/4f538975138678878fed5b2555c0672aa578ab7d/types/node/stream.d.ts
|
||||||
|
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import {
|
import { Abortable, EventEmitter } from "internal:deno_node/_events.d.ts";
|
||||||
Abortable,
|
|
||||||
EventEmitter,
|
|
||||||
} from "internal:deno_node/polyfills/_events.d.ts";
|
|
||||||
import {
|
import {
|
||||||
Buffered,
|
Buffered,
|
||||||
BufferEncoding,
|
BufferEncoding,
|
||||||
|
@ -15,7 +12,7 @@ import {
|
||||||
ReadableStream,
|
ReadableStream,
|
||||||
ReadWriteStream,
|
ReadWriteStream,
|
||||||
WritableStream,
|
WritableStream,
|
||||||
} from "internal:deno_node/polyfills/_global.d.ts";
|
} from "internal:deno_node/_global.d.ts";
|
||||||
|
|
||||||
export class Stream extends EventEmitter {
|
export class Stream extends EventEmitter {
|
||||||
pipe<T extends WritableStream>(
|
pipe<T extends WritableStream>(
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -5,25 +5,25 @@
|
||||||
import {
|
import {
|
||||||
ObjectAssign,
|
ObjectAssign,
|
||||||
StringPrototypeReplace,
|
StringPrototypeReplace,
|
||||||
} from "internal:deno_node/polyfills/internal/primordials.mjs";
|
} from "internal:deno_node/internal/primordials.mjs";
|
||||||
import assert from "internal:deno_node/polyfills/internal/assert.mjs";
|
import assert from "internal:deno_node/internal/assert.mjs";
|
||||||
import * as net from "internal:deno_node/polyfills/net.ts";
|
import * as net from "internal:deno_node/net.ts";
|
||||||
import { createSecureContext } from "internal:deno_node/polyfills/_tls_common.ts";
|
import { createSecureContext } from "internal:deno_node/_tls_common.ts";
|
||||||
import { kStreamBaseField } from "internal:deno_node/polyfills/internal_binding/stream_wrap.ts";
|
import { kStreamBaseField } from "internal:deno_node/internal_binding/stream_wrap.ts";
|
||||||
import { connResetException } from "internal:deno_node/polyfills/internal/errors.ts";
|
import { connResetException } from "internal:deno_node/internal/errors.ts";
|
||||||
import { emitWarning } from "internal:deno_node/polyfills/process.ts";
|
import { emitWarning } from "internal:deno_node/process.ts";
|
||||||
import { debuglog } from "internal:deno_node/polyfills/internal/util/debuglog.ts";
|
import { debuglog } from "internal:deno_node/internal/util/debuglog.ts";
|
||||||
import {
|
import {
|
||||||
constants as TCPConstants,
|
constants as TCPConstants,
|
||||||
TCP,
|
TCP,
|
||||||
} from "internal:deno_node/polyfills/internal_binding/tcp_wrap.ts";
|
} from "internal:deno_node/internal_binding/tcp_wrap.ts";
|
||||||
import {
|
import {
|
||||||
constants as PipeConstants,
|
constants as PipeConstants,
|
||||||
Pipe,
|
Pipe,
|
||||||
} from "internal:deno_node/polyfills/internal_binding/pipe_wrap.ts";
|
} from "internal:deno_node/internal_binding/pipe_wrap.ts";
|
||||||
import { EventEmitter } from "internal:deno_node/polyfills/events.ts";
|
import { EventEmitter } from "internal:deno_node/events.ts";
|
||||||
import { kEmptyObject } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { kEmptyObject } from "internal:deno_node/internal/util.mjs";
|
||||||
import { nextTick } from "internal:deno_node/polyfills/_next_tick.ts";
|
import { nextTick } from "internal:deno_node/_next_tick.ts";
|
||||||
|
|
||||||
const kConnectOptions = Symbol("connect-options");
|
const kConnectOptions = Symbol("connect-options");
|
||||||
const kIsVerified = Symbol("verified");
|
const kIsVerified = Symbol("verified");
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
// These are simplified versions of the "real" errors in Node.
|
// These are simplified versions of the "real" errors in Node.
|
||||||
|
|
||||||
import { nextTick } from "internal:deno_node/polyfills/_next_tick.ts";
|
import { nextTick } from "internal:deno_node/_next_tick.ts";
|
||||||
|
|
||||||
class NodeFalsyValueRejectionError extends Error {
|
class NodeFalsyValueRejectionError extends Error {
|
||||||
public reason: unknown;
|
public reason: unknown;
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
// vendored from std/testing/asserts.ts
|
// vendored from std/testing/asserts.ts
|
||||||
|
|
||||||
import { red } from "internal:deno_node/polyfills/_util/std_fmt_colors.ts";
|
import { red } from "internal:deno_node/_util/std_fmt_colors.ts";
|
||||||
import {
|
import {
|
||||||
buildMessage,
|
buildMessage,
|
||||||
diff,
|
diff,
|
||||||
diffstr,
|
diffstr,
|
||||||
} from "internal:deno_node/polyfills/_util/std_testing_diff.ts";
|
} from "internal:deno_node/_util/std_testing_diff.ts";
|
||||||
|
|
||||||
/** Converts the input into a string. Objects, Sets and Maps are sorted so as to
|
/** Converts the input into a string. Objects, Sets and Maps are sorted so as to
|
||||||
* make tests less flaky */
|
* make tests less flaky */
|
||||||
|
|
|
@ -9,7 +9,7 @@ import {
|
||||||
green,
|
green,
|
||||||
red,
|
red,
|
||||||
white,
|
white,
|
||||||
} from "internal:deno_node/polyfills/_util/std_fmt_colors.ts";
|
} from "internal:deno_node/_util/std_fmt_colors.ts";
|
||||||
|
|
||||||
interface FarthestPoint {
|
interface FarthestPoint {
|
||||||
y: number;
|
y: number;
|
||||||
|
|
|
@ -4,8 +4,8 @@ import {
|
||||||
TextDecoder,
|
TextDecoder,
|
||||||
TextEncoder,
|
TextEncoder,
|
||||||
} from "internal:deno_web/08_text_encoding.js";
|
} from "internal:deno_web/08_text_encoding.js";
|
||||||
import { errorMap } from "internal:deno_node/polyfills/internal_binding/uv.ts";
|
import { errorMap } from "internal:deno_node/internal_binding/uv.ts";
|
||||||
import { codes } from "internal:deno_node/polyfills/internal/error_codes.ts";
|
import { codes } from "internal:deno_node/internal/error_codes.ts";
|
||||||
|
|
||||||
export type BinaryEncodings = "binary";
|
export type BinaryEncodings = "binary";
|
||||||
|
|
||||||
|
|
|
@ -4,13 +4,13 @@
|
||||||
|
|
||||||
// deno-lint-ignore-file
|
// deno-lint-ignore-file
|
||||||
|
|
||||||
import { Buffer, kMaxLength } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer, kMaxLength } from "internal:deno_node/buffer.ts";
|
||||||
import { Transform } from "internal:deno_node/polyfills/stream.ts";
|
import { Transform } from "internal:deno_node/stream.ts";
|
||||||
import * as binding from "internal:deno_node/polyfills/_zlib_binding.mjs";
|
import * as binding from "internal:deno_node/_zlib_binding.mjs";
|
||||||
import util from "internal:deno_node/polyfills/util.ts";
|
import util from "internal:deno_node/util.ts";
|
||||||
import { ok as assert } from "internal:deno_node/polyfills/assert.ts";
|
import { ok as assert } from "internal:deno_node/assert.ts";
|
||||||
import { zlib as zlibConstants } from "internal:deno_node/polyfills/internal_binding/constants.ts";
|
import { zlib as zlibConstants } from "internal:deno_node/internal_binding/constants.ts";
|
||||||
import { nextTick } from "internal:deno_node/polyfills/_next_tick.ts";
|
import { nextTick } from "internal:deno_node/_next_tick.ts";
|
||||||
|
|
||||||
var kRangeErrorMessage = "Cannot create final Buffer. It would be larger " +
|
var kRangeErrorMessage = "Cannot create final Buffer. It would be larger " +
|
||||||
"than 0x" + kMaxLength.toString(16) + " bytes";
|
"than 0x" + kMaxLength.toString(16) + " bytes";
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
|
|
||||||
// deno-lint-ignore-file
|
// deno-lint-ignore-file
|
||||||
|
|
||||||
import assert from "internal:deno_node/polyfills/assert.ts";
|
import assert from "internal:deno_node/assert.ts";
|
||||||
import { constants, zlib_deflate, zlib_inflate, Zstream } from "internal:deno_node/polyfills/_pako.mjs";
|
import { constants, zlib_deflate, zlib_inflate, Zstream } from "internal:deno_node/_pako.mjs";
|
||||||
import { nextTick } from "internal:deno_node/polyfills/_next_tick.ts";
|
import { nextTick } from "internal:deno_node/_next_tick.ts";
|
||||||
|
|
||||||
export const Z_NO_FLUSH = constants.Z_NO_FLUSH;
|
export const Z_NO_FLUSH = constants.Z_NO_FLUSH;
|
||||||
export const Z_PARTIAL_FLUSH = constants.Z_PARTIAL_FLUSH;
|
export const Z_PARTIAL_FLUSH = constants.Z_PARTIAL_FLUSH;
|
||||||
|
|
|
@ -3,17 +3,17 @@
|
||||||
import {
|
import {
|
||||||
AssertionError,
|
AssertionError,
|
||||||
AssertionErrorConstructorOptions,
|
AssertionErrorConstructorOptions,
|
||||||
} from "internal:deno_node/polyfills/assertion_error.ts";
|
} from "internal:deno_node/assertion_error.ts";
|
||||||
import * as asserts from "internal:deno_node/polyfills/_util/std_asserts.ts";
|
import * as asserts from "internal:deno_node/_util/std_asserts.ts";
|
||||||
import { inspect } from "internal:deno_node/polyfills/util.ts";
|
import { inspect } from "internal:deno_node/util.ts";
|
||||||
import {
|
import {
|
||||||
ERR_AMBIGUOUS_ARGUMENT,
|
ERR_AMBIGUOUS_ARGUMENT,
|
||||||
ERR_INVALID_ARG_TYPE,
|
ERR_INVALID_ARG_TYPE,
|
||||||
ERR_INVALID_ARG_VALUE,
|
ERR_INVALID_ARG_VALUE,
|
||||||
ERR_INVALID_RETURN_VALUE,
|
ERR_INVALID_RETURN_VALUE,
|
||||||
ERR_MISSING_ARGS,
|
ERR_MISSING_ARGS,
|
||||||
} from "internal:deno_node/polyfills/internal/errors.ts";
|
} from "internal:deno_node/internal/errors.ts";
|
||||||
import { isDeepEqual } from "internal:deno_node/polyfills/internal/util/comparisons.ts";
|
import { isDeepEqual } from "internal:deno_node/internal/util/comparisons.ts";
|
||||||
|
|
||||||
function innerFail(obj: {
|
function innerFail(obj: {
|
||||||
actual?: unknown;
|
actual?: unknown;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { strict } from "internal:deno_node/polyfills/assert.ts";
|
import { strict } from "internal:deno_node/assert.ts";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
AssertionError,
|
AssertionError,
|
||||||
|
@ -20,7 +20,7 @@ export {
|
||||||
rejects,
|
rejects,
|
||||||
strictEqual,
|
strictEqual,
|
||||||
throws,
|
throws,
|
||||||
} from "internal:deno_node/polyfills/assert.ts";
|
} from "internal:deno_node/assert.ts";
|
||||||
|
|
||||||
export { strict };
|
export { strict };
|
||||||
export default strict;
|
export default strict;
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
import { inspect } from "internal:deno_node/polyfills/util.ts";
|
import { inspect } from "internal:deno_node/util.ts";
|
||||||
import { stripColor as removeColors } from "internal:deno_node/polyfills/_util/std_fmt_colors.ts";
|
import { stripColor as removeColors } from "internal:deno_node/_util/std_fmt_colors.ts";
|
||||||
|
|
||||||
function getConsoleWidth(): number {
|
function getConsoleWidth(): number {
|
||||||
try {
|
try {
|
||||||
|
@ -44,7 +44,7 @@ const {
|
||||||
keys: ObjectKeys,
|
keys: ObjectKeys,
|
||||||
} = Object;
|
} = Object;
|
||||||
|
|
||||||
import { ERR_INVALID_ARG_TYPE } from "internal:deno_node/polyfills/internal/errors.ts";
|
import { ERR_INVALID_ARG_TYPE } from "internal:deno_node/internal/errors.ts";
|
||||||
|
|
||||||
let blue = "";
|
let blue = "";
|
||||||
let green = "";
|
let green = "";
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
// This implementation is inspired by "workerd" AsyncLocalStorage implementation:
|
// This implementation is inspired by "workerd" AsyncLocalStorage implementation:
|
||||||
// https://github.com/cloudflare/workerd/blob/77fd0ed6ddba184414f0216508fc62b06e716cab/src/workerd/api/node/async-hooks.c++#L9
|
// https://github.com/cloudflare/workerd/blob/77fd0ed6ddba184414f0216508fc62b06e716cab/src/workerd/api/node/async-hooks.c++#L9
|
||||||
|
|
||||||
import { validateFunction } from "internal:deno_node/polyfills/internal/validators.mjs";
|
import { validateFunction } from "internal:deno_node/internal/validators.mjs";
|
||||||
import { core } from "internal:deno_node/polyfills/_core.ts";
|
import { core } from "internal:deno_node/_core.ts";
|
||||||
|
|
||||||
function assert(cond: boolean) {
|
function assert(cond: boolean) {
|
||||||
if (!cond) throw new Error("Assertion failed");
|
if (!cond) throw new Error("Assertion failed");
|
||||||
|
|
|
@ -10,4 +10,4 @@ export {
|
||||||
kMaxLength,
|
kMaxLength,
|
||||||
kStringMaxLength,
|
kStringMaxLength,
|
||||||
SlowBuffer,
|
SlowBuffer,
|
||||||
} from "internal:deno_node/polyfills/internal/buffer.mjs";
|
} from "internal:deno_node/internal/buffer.mjs";
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
// This module implements 'child_process' module of Node.JS API.
|
// This module implements 'child_process' module of Node.JS API.
|
||||||
// ref: https://nodejs.org/api/child_process.html
|
// ref: https://nodejs.org/api/child_process.html
|
||||||
import { core } from "internal:deno_node/polyfills/_core.ts";
|
import { core } from "internal:deno_node/_core.ts";
|
||||||
import {
|
import {
|
||||||
ChildProcess,
|
ChildProcess,
|
||||||
ChildProcessOptions,
|
ChildProcessOptions,
|
||||||
|
@ -12,13 +12,13 @@ import {
|
||||||
type SpawnSyncOptions,
|
type SpawnSyncOptions,
|
||||||
type SpawnSyncResult,
|
type SpawnSyncResult,
|
||||||
stdioStringToArray,
|
stdioStringToArray,
|
||||||
} from "internal:deno_node/polyfills/internal/child_process.ts";
|
} from "internal:deno_node/internal/child_process.ts";
|
||||||
import {
|
import {
|
||||||
validateAbortSignal,
|
validateAbortSignal,
|
||||||
validateFunction,
|
validateFunction,
|
||||||
validateObject,
|
validateObject,
|
||||||
validateString,
|
validateString,
|
||||||
} from "internal:deno_node/polyfills/internal/validators.mjs";
|
} from "internal:deno_node/internal/validators.mjs";
|
||||||
import {
|
import {
|
||||||
ERR_CHILD_PROCESS_IPC_REQUIRED,
|
ERR_CHILD_PROCESS_IPC_REQUIRED,
|
||||||
ERR_CHILD_PROCESS_STDIO_MAXBUFFER,
|
ERR_CHILD_PROCESS_STDIO_MAXBUFFER,
|
||||||
|
@ -26,7 +26,7 @@ import {
|
||||||
ERR_INVALID_ARG_VALUE,
|
ERR_INVALID_ARG_VALUE,
|
||||||
ERR_OUT_OF_RANGE,
|
ERR_OUT_OF_RANGE,
|
||||||
genericNodeError,
|
genericNodeError,
|
||||||
} from "internal:deno_node/polyfills/internal/errors.ts";
|
} from "internal:deno_node/internal/errors.ts";
|
||||||
import {
|
import {
|
||||||
ArrayIsArray,
|
ArrayIsArray,
|
||||||
ArrayPrototypeJoin,
|
ArrayPrototypeJoin,
|
||||||
|
@ -34,18 +34,15 @@ import {
|
||||||
ArrayPrototypeSlice,
|
ArrayPrototypeSlice,
|
||||||
ObjectAssign,
|
ObjectAssign,
|
||||||
StringPrototypeSlice,
|
StringPrototypeSlice,
|
||||||
} from "internal:deno_node/polyfills/internal/primordials.mjs";
|
} from "internal:deno_node/internal/primordials.mjs";
|
||||||
import {
|
import { getSystemErrorName, promisify } from "internal:deno_node/util.ts";
|
||||||
getSystemErrorName,
|
import { createDeferredPromise } from "internal:deno_node/internal/util.mjs";
|
||||||
promisify,
|
import process from "internal:deno_node/process.ts";
|
||||||
} from "internal:deno_node/polyfills/util.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import { createDeferredPromise } from "internal:deno_node/polyfills/internal/util.mjs";
|
|
||||||
import process from "internal:deno_node/polyfills/process.ts";
|
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
|
||||||
import {
|
import {
|
||||||
convertToValidSignal,
|
convertToValidSignal,
|
||||||
kEmptyObject,
|
kEmptyObject,
|
||||||
} from "internal:deno_node/polyfills/internal/util.mjs";
|
} from "internal:deno_node/internal/util.mjs";
|
||||||
|
|
||||||
const MAX_BUFFER = 1024 * 1024;
|
const MAX_BUFFER = 1024 * 1024;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import { notImplemented } from "internal:deno_node/polyfills/_utils.ts";
|
import { notImplemented } from "internal:deno_node/_utils.ts";
|
||||||
|
|
||||||
/** A Worker object contains all public information and method about a worker.
|
/** A Worker object contains all public information and method about a worker.
|
||||||
* In the primary it can be obtained using cluster.workers. In a worker it can
|
* In the primary it can be obtained using cluster.workers. In a worker it can
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import { Console } from "internal:deno_node/polyfills/internal/console/constructor.mjs";
|
import { Console } from "internal:deno_node/internal/console/constructor.mjs";
|
||||||
import { windowOrWorkerGlobalScope } from "internal:runtime/js/98_global_scope.js";
|
import { windowOrWorkerGlobalScope } from "internal:runtime/98_global_scope.js";
|
||||||
// Don't rely on global `console` because during bootstrapping, it is pointing
|
// Don't rely on global `console` because during bootstrapping, it is pointing
|
||||||
// to native `console` object provided by V8.
|
// to native `console` object provided by V8.
|
||||||
const console = windowOrWorkerGlobalScope.console.value;
|
const console = windowOrWorkerGlobalScope.console.value;
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
// Based on: https://github.com/nodejs/node/blob/0646eda/lib/constants.js
|
// Based on: https://github.com/nodejs/node/blob/0646eda/lib/constants.js
|
||||||
|
|
||||||
import { constants as fsConstants } from "internal:deno_node/polyfills/fs.ts";
|
import { constants as fsConstants } from "internal:deno_node/fs.ts";
|
||||||
import { constants as osConstants } from "internal:deno_node/polyfills/os.ts";
|
import { constants as osConstants } from "internal:deno_node/os.ts";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
...fsConstants,
|
...fsConstants,
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
// Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license.
|
// Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import { ERR_CRYPTO_FIPS_FORCED } from "internal:deno_node/polyfills/internal/errors.ts";
|
import { ERR_CRYPTO_FIPS_FORCED } from "internal:deno_node/internal/errors.ts";
|
||||||
import { crypto as constants } from "internal:deno_node/polyfills/internal_binding/constants.ts";
|
import { crypto as constants } from "internal:deno_node/internal_binding/constants.ts";
|
||||||
import { getOptionValue } from "internal:deno_node/polyfills/internal/options.ts";
|
import { getOptionValue } from "internal:deno_node/internal/options.ts";
|
||||||
import {
|
import {
|
||||||
getFipsCrypto,
|
getFipsCrypto,
|
||||||
setFipsCrypto,
|
setFipsCrypto,
|
||||||
timingSafeEqual,
|
timingSafeEqual,
|
||||||
} from "internal:deno_node/polyfills/internal_binding/crypto.ts";
|
} from "internal:deno_node/internal_binding/crypto.ts";
|
||||||
import {
|
import {
|
||||||
checkPrime,
|
checkPrime,
|
||||||
checkPrimeSync,
|
checkPrimeSync,
|
||||||
|
@ -19,36 +19,33 @@ import {
|
||||||
randomFillSync,
|
randomFillSync,
|
||||||
randomInt,
|
randomInt,
|
||||||
randomUUID,
|
randomUUID,
|
||||||
} from "internal:deno_node/polyfills/internal/crypto/random.ts";
|
} from "internal:deno_node/internal/crypto/random.ts";
|
||||||
import type {
|
import type {
|
||||||
CheckPrimeOptions,
|
CheckPrimeOptions,
|
||||||
GeneratePrimeOptions,
|
GeneratePrimeOptions,
|
||||||
GeneratePrimeOptionsArrayBuffer,
|
GeneratePrimeOptionsArrayBuffer,
|
||||||
GeneratePrimeOptionsBigInt,
|
GeneratePrimeOptionsBigInt,
|
||||||
LargeNumberLike,
|
LargeNumberLike,
|
||||||
} from "internal:deno_node/polyfills/internal/crypto/random.ts";
|
} from "internal:deno_node/internal/crypto/random.ts";
|
||||||
import {
|
import {
|
||||||
pbkdf2,
|
pbkdf2,
|
||||||
pbkdf2Sync,
|
pbkdf2Sync,
|
||||||
} from "internal:deno_node/polyfills/internal/crypto/pbkdf2.ts";
|
} from "internal:deno_node/internal/crypto/pbkdf2.ts";
|
||||||
import type {
|
import type {
|
||||||
Algorithms,
|
Algorithms,
|
||||||
NormalizedAlgorithms,
|
NormalizedAlgorithms,
|
||||||
} from "internal:deno_node/polyfills/internal/crypto/pbkdf2.ts";
|
} from "internal:deno_node/internal/crypto/pbkdf2.ts";
|
||||||
import {
|
import {
|
||||||
scrypt,
|
scrypt,
|
||||||
scryptSync,
|
scryptSync,
|
||||||
} from "internal:deno_node/polyfills/internal/crypto/scrypt.ts";
|
} from "internal:deno_node/internal/crypto/scrypt.ts";
|
||||||
import {
|
import { hkdf, hkdfSync } from "internal:deno_node/internal/crypto/hkdf.ts";
|
||||||
hkdf,
|
|
||||||
hkdfSync,
|
|
||||||
} from "internal:deno_node/polyfills/internal/crypto/hkdf.ts";
|
|
||||||
import {
|
import {
|
||||||
generateKey,
|
generateKey,
|
||||||
generateKeyPair,
|
generateKeyPair,
|
||||||
generateKeyPairSync,
|
generateKeyPairSync,
|
||||||
generateKeySync,
|
generateKeySync,
|
||||||
} from "internal:deno_node/polyfills/internal/crypto/keygen.ts";
|
} from "internal:deno_node/internal/crypto/keygen.ts";
|
||||||
import type {
|
import type {
|
||||||
BasePrivateKeyEncodingOptions,
|
BasePrivateKeyEncodingOptions,
|
||||||
DSAKeyPairKeyObjectOptions,
|
DSAKeyPairKeyObjectOptions,
|
||||||
|
@ -69,26 +66,26 @@ import type {
|
||||||
X25519KeyPairOptions,
|
X25519KeyPairOptions,
|
||||||
X448KeyPairKeyObjectOptions,
|
X448KeyPairKeyObjectOptions,
|
||||||
X448KeyPairOptions,
|
X448KeyPairOptions,
|
||||||
} from "internal:deno_node/polyfills/internal/crypto/keygen.ts";
|
} from "internal:deno_node/internal/crypto/keygen.ts";
|
||||||
import {
|
import {
|
||||||
createPrivateKey,
|
createPrivateKey,
|
||||||
createPublicKey,
|
createPublicKey,
|
||||||
createSecretKey,
|
createSecretKey,
|
||||||
KeyObject,
|
KeyObject,
|
||||||
} from "internal:deno_node/polyfills/internal/crypto/keys.ts";
|
} from "internal:deno_node/internal/crypto/keys.ts";
|
||||||
import type {
|
import type {
|
||||||
AsymmetricKeyDetails,
|
AsymmetricKeyDetails,
|
||||||
JsonWebKeyInput,
|
JsonWebKeyInput,
|
||||||
JwkKeyExportOptions,
|
JwkKeyExportOptions,
|
||||||
KeyExportOptions,
|
KeyExportOptions,
|
||||||
KeyObjectType,
|
KeyObjectType,
|
||||||
} from "internal:deno_node/polyfills/internal/crypto/keys.ts";
|
} from "internal:deno_node/internal/crypto/keys.ts";
|
||||||
import {
|
import {
|
||||||
DiffieHellman,
|
DiffieHellman,
|
||||||
diffieHellman,
|
diffieHellman,
|
||||||
DiffieHellmanGroup,
|
DiffieHellmanGroup,
|
||||||
ECDH,
|
ECDH,
|
||||||
} from "internal:deno_node/polyfills/internal/crypto/diffiehellman.ts";
|
} from "internal:deno_node/internal/crypto/diffiehellman.ts";
|
||||||
import {
|
import {
|
||||||
Cipheriv,
|
Cipheriv,
|
||||||
Decipheriv,
|
Decipheriv,
|
||||||
|
@ -97,7 +94,7 @@ import {
|
||||||
privateEncrypt,
|
privateEncrypt,
|
||||||
publicDecrypt,
|
publicDecrypt,
|
||||||
publicEncrypt,
|
publicEncrypt,
|
||||||
} from "internal:deno_node/polyfills/internal/crypto/cipher.ts";
|
} from "internal:deno_node/internal/crypto/cipher.ts";
|
||||||
import type {
|
import type {
|
||||||
Cipher,
|
Cipher,
|
||||||
CipherCCM,
|
CipherCCM,
|
||||||
|
@ -114,7 +111,7 @@ import type {
|
||||||
DecipherCCM,
|
DecipherCCM,
|
||||||
DecipherGCM,
|
DecipherGCM,
|
||||||
DecipherOCB,
|
DecipherOCB,
|
||||||
} from "internal:deno_node/polyfills/internal/crypto/cipher.ts";
|
} from "internal:deno_node/internal/crypto/cipher.ts";
|
||||||
import type {
|
import type {
|
||||||
BinaryLike,
|
BinaryLike,
|
||||||
BinaryToTextEncoding,
|
BinaryToTextEncoding,
|
||||||
|
@ -127,13 +124,13 @@ import type {
|
||||||
LegacyCharacterEncoding,
|
LegacyCharacterEncoding,
|
||||||
PrivateKeyInput,
|
PrivateKeyInput,
|
||||||
PublicKeyInput,
|
PublicKeyInput,
|
||||||
} from "internal:deno_node/polyfills/internal/crypto/types.ts";
|
} from "internal:deno_node/internal/crypto/types.ts";
|
||||||
import {
|
import {
|
||||||
Sign,
|
Sign,
|
||||||
signOneShot,
|
signOneShot,
|
||||||
Verify,
|
Verify,
|
||||||
verifyOneShot,
|
verifyOneShot,
|
||||||
} from "internal:deno_node/polyfills/internal/crypto/sig.ts";
|
} from "internal:deno_node/internal/crypto/sig.ts";
|
||||||
import type {
|
import type {
|
||||||
DSAEncoding,
|
DSAEncoding,
|
||||||
KeyLike,
|
KeyLike,
|
||||||
|
@ -142,30 +139,30 @@ import type {
|
||||||
SignPrivateKeyInput,
|
SignPrivateKeyInput,
|
||||||
VerifyKeyObjectInput,
|
VerifyKeyObjectInput,
|
||||||
VerifyPublicKeyInput,
|
VerifyPublicKeyInput,
|
||||||
} from "internal:deno_node/polyfills/internal/crypto/sig.ts";
|
} from "internal:deno_node/internal/crypto/sig.ts";
|
||||||
import {
|
import {
|
||||||
createHash,
|
createHash,
|
||||||
Hash,
|
Hash,
|
||||||
Hmac,
|
Hmac,
|
||||||
} from "internal:deno_node/polyfills/internal/crypto/hash.ts";
|
} from "internal:deno_node/internal/crypto/hash.ts";
|
||||||
import { X509Certificate } from "internal:deno_node/polyfills/internal/crypto/x509.ts";
|
import { X509Certificate } from "internal:deno_node/internal/crypto/x509.ts";
|
||||||
import type {
|
import type {
|
||||||
PeerCertificate,
|
PeerCertificate,
|
||||||
X509CheckOptions,
|
X509CheckOptions,
|
||||||
} from "internal:deno_node/polyfills/internal/crypto/x509.ts";
|
} from "internal:deno_node/internal/crypto/x509.ts";
|
||||||
import {
|
import {
|
||||||
getCiphers,
|
getCiphers,
|
||||||
getCurves,
|
getCurves,
|
||||||
getHashes,
|
getHashes,
|
||||||
secureHeapUsed,
|
secureHeapUsed,
|
||||||
setEngine,
|
setEngine,
|
||||||
} from "internal:deno_node/polyfills/internal/crypto/util.ts";
|
} from "internal:deno_node/internal/crypto/util.ts";
|
||||||
import type { SecureHeapUsage } from "internal:deno_node/polyfills/internal/crypto/util.ts";
|
import type { SecureHeapUsage } from "internal:deno_node/internal/crypto/util.ts";
|
||||||
import Certificate from "internal:deno_node/polyfills/internal/crypto/certificate.ts";
|
import Certificate from "internal:deno_node/internal/crypto/certificate.ts";
|
||||||
import type {
|
import type {
|
||||||
TransformOptions,
|
TransformOptions,
|
||||||
WritableOptions,
|
WritableOptions,
|
||||||
} from "internal:deno_node/polyfills/_stream.d.ts";
|
} from "internal:deno_node/_stream.d.ts";
|
||||||
import { crypto as webcrypto } from "internal:deno_crypto/00_crypto.js";
|
import { crypto as webcrypto } from "internal:deno_crypto/00_crypto.js";
|
||||||
|
|
||||||
const fipsForced = getOptionValue("--force-fips");
|
const fipsForced = getOptionValue("--force-fips");
|
||||||
|
|
|
@ -20,13 +20,13 @@
|
||||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import { EventEmitter } from "internal:deno_node/polyfills/events.ts";
|
import { EventEmitter } from "internal:deno_node/events.ts";
|
||||||
import { lookup as defaultLookup } from "internal:deno_node/polyfills/dns.ts";
|
import { lookup as defaultLookup } from "internal:deno_node/dns.ts";
|
||||||
import type {
|
import type {
|
||||||
ErrnoException,
|
ErrnoException,
|
||||||
NodeSystemErrorCtx,
|
NodeSystemErrorCtx,
|
||||||
} from "internal:deno_node/polyfills/internal/errors.ts";
|
} from "internal:deno_node/internal/errors.ts";
|
||||||
import {
|
import {
|
||||||
ERR_BUFFER_OUT_OF_BOUNDS,
|
ERR_BUFFER_OUT_OF_BOUNDS,
|
||||||
ERR_INVALID_ARG_TYPE,
|
ERR_INVALID_ARG_TYPE,
|
||||||
|
@ -40,34 +40,28 @@ import {
|
||||||
ERR_SOCKET_DGRAM_NOT_RUNNING,
|
ERR_SOCKET_DGRAM_NOT_RUNNING,
|
||||||
errnoException,
|
errnoException,
|
||||||
exceptionWithHostPort,
|
exceptionWithHostPort,
|
||||||
} from "internal:deno_node/polyfills/internal/errors.ts";
|
} from "internal:deno_node/internal/errors.ts";
|
||||||
import type { Abortable } from "internal:deno_node/polyfills/_events.d.ts";
|
import type { Abortable } from "internal:deno_node/_events.d.ts";
|
||||||
import {
|
import { kStateSymbol, newHandle } from "internal:deno_node/internal/dgram.ts";
|
||||||
kStateSymbol,
|
import type { SocketType } from "internal:deno_node/internal/dgram.ts";
|
||||||
newHandle,
|
|
||||||
} from "internal:deno_node/polyfills/internal/dgram.ts";
|
|
||||||
import type { SocketType } from "internal:deno_node/polyfills/internal/dgram.ts";
|
|
||||||
import {
|
import {
|
||||||
asyncIdSymbol,
|
asyncIdSymbol,
|
||||||
defaultTriggerAsyncIdScope,
|
defaultTriggerAsyncIdScope,
|
||||||
ownerSymbol,
|
ownerSymbol,
|
||||||
} from "internal:deno_node/polyfills/internal/async_hooks.ts";
|
} from "internal:deno_node/internal/async_hooks.ts";
|
||||||
import {
|
import { SendWrap, UDP } from "internal:deno_node/internal_binding/udp_wrap.ts";
|
||||||
SendWrap,
|
|
||||||
UDP,
|
|
||||||
} from "internal:deno_node/polyfills/internal_binding/udp_wrap.ts";
|
|
||||||
import {
|
import {
|
||||||
isInt32,
|
isInt32,
|
||||||
validateAbortSignal,
|
validateAbortSignal,
|
||||||
validateNumber,
|
validateNumber,
|
||||||
validatePort,
|
validatePort,
|
||||||
validateString,
|
validateString,
|
||||||
} from "internal:deno_node/polyfills/internal/validators.mjs";
|
} from "internal:deno_node/internal/validators.mjs";
|
||||||
import { guessHandleType } from "internal:deno_node/polyfills/internal_binding/util.ts";
|
import { guessHandleType } from "internal:deno_node/internal_binding/util.ts";
|
||||||
import { os } from "internal:deno_node/polyfills/internal_binding/constants.ts";
|
import { os } from "internal:deno_node/internal_binding/constants.ts";
|
||||||
import { nextTick } from "internal:deno_node/polyfills/process.ts";
|
import { nextTick } from "internal:deno_node/process.ts";
|
||||||
import { channel } from "internal:deno_node/polyfills/diagnostics_channel.ts";
|
import { channel } from "internal:deno_node/diagnostics_channel.ts";
|
||||||
import { isArrayBufferView } from "internal:deno_node/polyfills/internal/util/types.ts";
|
import { isArrayBufferView } from "internal:deno_node/internal/util/types.ts";
|
||||||
|
|
||||||
const { UV_UDP_REUSEADDR, UV_UDP_IPV6ONLY } = os;
|
const { UV_UDP_REUSEADDR, UV_UDP_IPV6ONLY } = os;
|
||||||
|
|
||||||
|
@ -247,8 +241,8 @@ export class Socket extends EventEmitter {
|
||||||
* `EADDRINUSE` error will occur:
|
* `EADDRINUSE` error will occur:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import cluster from "internal:deno_node/polyfills/cluster";
|
* import cluster from "internal:deno_node/cluster";
|
||||||
* import dgram from "internal:deno_node/polyfills/dgram";
|
* import dgram from "internal:deno_node/dgram";
|
||||||
*
|
*
|
||||||
* if (cluster.isPrimary) {
|
* if (cluster.isPrimary) {
|
||||||
* cluster.fork(); // Works ok.
|
* cluster.fork(); // Works ok.
|
||||||
|
@ -349,7 +343,7 @@ export class Socket extends EventEmitter {
|
||||||
* Example of a UDP server listening on port 41234:
|
* Example of a UDP server listening on port 41234:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import dgram from "internal:deno_node/polyfills/dgram";
|
* import dgram from "internal:deno_node/dgram";
|
||||||
*
|
*
|
||||||
* const server = dgram.createSocket('udp4');
|
* const server = dgram.createSocket('udp4');
|
||||||
*
|
*
|
||||||
|
@ -798,8 +792,8 @@ export class Socket extends EventEmitter {
|
||||||
* Example of sending a UDP packet to a port on `localhost`;
|
* Example of sending a UDP packet to a port on `localhost`;
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import dgram from "internal:deno_node/polyfills/dgram";
|
* import dgram from "internal:deno_node/dgram";
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/buffer";
|
* import { Buffer } from "internal:deno_node/buffer";
|
||||||
*
|
*
|
||||||
* const message = Buffer.from('Some bytes');
|
* const message = Buffer.from('Some bytes');
|
||||||
* const client = dgram.createSocket('udp4');
|
* const client = dgram.createSocket('udp4');
|
||||||
|
@ -812,8 +806,8 @@ export class Socket extends EventEmitter {
|
||||||
* `127.0.0.1`;
|
* `127.0.0.1`;
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import dgram from "internal:deno_node/polyfills/dgram";
|
* import dgram from "internal:deno_node/dgram";
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/buffer";
|
* import { Buffer } from "internal:deno_node/buffer";
|
||||||
*
|
*
|
||||||
* const buf1 = Buffer.from('Some ');
|
* const buf1 = Buffer.from('Some ');
|
||||||
* const buf2 = Buffer.from('bytes');
|
* const buf2 = Buffer.from('bytes');
|
||||||
|
@ -832,8 +826,8 @@ export class Socket extends EventEmitter {
|
||||||
* `localhost`:
|
* `localhost`:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import dgram from "internal:deno_node/polyfills/dgram";
|
* import dgram from "internal:deno_node/dgram";
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/buffer";
|
* import { Buffer } from "internal:deno_node/buffer";
|
||||||
*
|
*
|
||||||
* const message = Buffer.from('Some bytes');
|
* const message = Buffer.from('Some bytes');
|
||||||
* const client = dgram.createSocket('udp4');
|
* const client = dgram.createSocket('udp4');
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { ERR_INVALID_ARG_TYPE } from "internal:deno_node/polyfills/internal/errors.ts";
|
import { ERR_INVALID_ARG_TYPE } from "internal:deno_node/internal/errors.ts";
|
||||||
import { validateFunction } from "internal:deno_node/polyfills/internal/validators.mjs";
|
import { validateFunction } from "internal:deno_node/internal/validators.mjs";
|
||||||
import { nextTick } from "internal:deno_node/polyfills/process.ts";
|
import { nextTick } from "internal:deno_node/process.ts";
|
||||||
|
|
||||||
type Subscriber = (message: unknown, name?: string) => void;
|
type Subscriber = (message: unknown, name?: string) => void;
|
||||||
|
|
||||||
|
|
|
@ -20,16 +20,16 @@
|
||||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
import { nextTick } from "internal:deno_node/polyfills/_next_tick.ts";
|
import { nextTick } from "internal:deno_node/_next_tick.ts";
|
||||||
import { customPromisifyArgs } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { customPromisifyArgs } from "internal:deno_node/internal/util.mjs";
|
||||||
import {
|
import {
|
||||||
validateBoolean,
|
validateBoolean,
|
||||||
validateFunction,
|
validateFunction,
|
||||||
validateNumber,
|
validateNumber,
|
||||||
validateOneOf,
|
validateOneOf,
|
||||||
validateString,
|
validateString,
|
||||||
} from "internal:deno_node/polyfills/internal/validators.mjs";
|
} from "internal:deno_node/internal/validators.mjs";
|
||||||
import { isIP } from "internal:deno_node/polyfills/internal/net.ts";
|
import { isIP } from "internal:deno_node/internal/net.ts";
|
||||||
import {
|
import {
|
||||||
emitInvalidHostnameWarning,
|
emitInvalidHostnameWarning,
|
||||||
getDefaultResolver,
|
getDefaultResolver,
|
||||||
|
@ -42,7 +42,7 @@ import {
|
||||||
setDefaultResolver,
|
setDefaultResolver,
|
||||||
setDefaultResultOrder,
|
setDefaultResultOrder,
|
||||||
validateHints,
|
validateHints,
|
||||||
} from "internal:deno_node/polyfills/internal/dns/utils.ts";
|
} from "internal:deno_node/internal/dns/utils.ts";
|
||||||
import type {
|
import type {
|
||||||
AnyAaaaRecord,
|
AnyAaaaRecord,
|
||||||
AnyARecord,
|
AnyARecord,
|
||||||
|
@ -70,27 +70,27 @@ import type {
|
||||||
ResolveWithTtlOptions,
|
ResolveWithTtlOptions,
|
||||||
SoaRecord,
|
SoaRecord,
|
||||||
SrvRecord,
|
SrvRecord,
|
||||||
} from "internal:deno_node/polyfills/internal/dns/utils.ts";
|
} from "internal:deno_node/internal/dns/utils.ts";
|
||||||
import promisesBase from "internal:deno_node/polyfills/internal/dns/promises.ts";
|
import promisesBase from "internal:deno_node/internal/dns/promises.ts";
|
||||||
import type { ErrnoException } from "internal:deno_node/polyfills/internal/errors.ts";
|
import type { ErrnoException } from "internal:deno_node/internal/errors.ts";
|
||||||
import {
|
import {
|
||||||
dnsException,
|
dnsException,
|
||||||
ERR_INVALID_ARG_TYPE,
|
ERR_INVALID_ARG_TYPE,
|
||||||
ERR_INVALID_ARG_VALUE,
|
ERR_INVALID_ARG_VALUE,
|
||||||
} from "internal:deno_node/polyfills/internal/errors.ts";
|
} from "internal:deno_node/internal/errors.ts";
|
||||||
import {
|
import {
|
||||||
AI_ADDRCONFIG as ADDRCONFIG,
|
AI_ADDRCONFIG as ADDRCONFIG,
|
||||||
AI_ALL as ALL,
|
AI_ALL as ALL,
|
||||||
AI_V4MAPPED as V4MAPPED,
|
AI_V4MAPPED as V4MAPPED,
|
||||||
} from "internal:deno_node/polyfills/internal_binding/ares.ts";
|
} from "internal:deno_node/internal_binding/ares.ts";
|
||||||
import {
|
import {
|
||||||
ChannelWrapQuery,
|
ChannelWrapQuery,
|
||||||
getaddrinfo,
|
getaddrinfo,
|
||||||
GetAddrInfoReqWrap,
|
GetAddrInfoReqWrap,
|
||||||
QueryReqWrap,
|
QueryReqWrap,
|
||||||
} from "internal:deno_node/polyfills/internal_binding/cares_wrap.ts";
|
} from "internal:deno_node/internal_binding/cares_wrap.ts";
|
||||||
import { toASCII } from "internal:deno_node/polyfills/punycode.ts";
|
import { toASCII } from "internal:deno_node/punycode.ts";
|
||||||
import { notImplemented } from "internal:deno_node/polyfills/_utils.ts";
|
import { notImplemented } from "internal:deno_node/_utils.ts";
|
||||||
|
|
||||||
function onlookup(
|
function onlookup(
|
||||||
this: GetAddrInfoReqWrap,
|
this: GetAddrInfoReqWrap,
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
// 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
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
import { promises } from "internal:deno_node/polyfills/dns.ts";
|
import { promises } from "internal:deno_node/dns.ts";
|
||||||
export const {
|
export const {
|
||||||
getServers,
|
getServers,
|
||||||
lookup,
|
lookup,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import { notImplemented } from "internal:deno_node/polyfills/_utils.ts";
|
import { notImplemented } from "internal:deno_node/_utils.ts";
|
||||||
|
|
||||||
export function create() {
|
export function create() {
|
||||||
notImplemented("domain.create");
|
notImplemented("domain.create");
|
||||||
|
|
|
@ -11,4 +11,4 @@ export {
|
||||||
on,
|
on,
|
||||||
once,
|
once,
|
||||||
setMaxListeners,
|
setMaxListeners,
|
||||||
} from "internal:deno_node/polyfills/_events.mjs";
|
} from "internal:deno_node/_events.mjs";
|
||||||
|
|
|
@ -3,178 +3,153 @@ import {
|
||||||
access,
|
access,
|
||||||
accessPromise,
|
accessPromise,
|
||||||
accessSync,
|
accessSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_access.ts";
|
} from "internal:deno_node/_fs/_fs_access.ts";
|
||||||
import {
|
import {
|
||||||
appendFile,
|
appendFile,
|
||||||
appendFilePromise,
|
appendFilePromise,
|
||||||
appendFileSync,
|
appendFileSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_appendFile.ts";
|
} from "internal:deno_node/_fs/_fs_appendFile.ts";
|
||||||
import {
|
import {
|
||||||
chmod,
|
chmod,
|
||||||
chmodPromise,
|
chmodPromise,
|
||||||
chmodSync,
|
chmodSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_chmod.ts";
|
} from "internal:deno_node/_fs/_fs_chmod.ts";
|
||||||
import {
|
import {
|
||||||
chown,
|
chown,
|
||||||
chownPromise,
|
chownPromise,
|
||||||
chownSync,
|
chownSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_chown.ts";
|
} from "internal:deno_node/_fs/_fs_chown.ts";
|
||||||
import {
|
import { close, closeSync } from "internal:deno_node/_fs/_fs_close.ts";
|
||||||
close,
|
import * as constants from "internal:deno_node/_fs/_fs_constants.ts";
|
||||||
closeSync,
|
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_close.ts";
|
|
||||||
import * as constants from "internal:deno_node/polyfills/_fs/_fs_constants.ts";
|
|
||||||
import {
|
import {
|
||||||
copyFile,
|
copyFile,
|
||||||
copyFilePromise,
|
copyFilePromise,
|
||||||
copyFileSync,
|
copyFileSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_copy.ts";
|
} from "internal:deno_node/_fs/_fs_copy.ts";
|
||||||
import Dir from "internal:deno_node/polyfills/_fs/_fs_dir.ts";
|
import Dir from "internal:deno_node/_fs/_fs_dir.ts";
|
||||||
import Dirent from "internal:deno_node/polyfills/_fs/_fs_dirent.ts";
|
import Dirent from "internal:deno_node/_fs/_fs_dirent.ts";
|
||||||
import {
|
import { exists, existsSync } from "internal:deno_node/_fs/_fs_exists.ts";
|
||||||
exists,
|
|
||||||
existsSync,
|
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_exists.ts";
|
|
||||||
import {
|
import {
|
||||||
fdatasync,
|
fdatasync,
|
||||||
fdatasyncSync,
|
fdatasyncSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_fdatasync.ts";
|
} from "internal:deno_node/_fs/_fs_fdatasync.ts";
|
||||||
import {
|
import { fstat, fstatSync } from "internal:deno_node/_fs/_fs_fstat.ts";
|
||||||
fstat,
|
import { fsync, fsyncSync } from "internal:deno_node/_fs/_fs_fsync.ts";
|
||||||
fstatSync,
|
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_fstat.ts";
|
|
||||||
import {
|
|
||||||
fsync,
|
|
||||||
fsyncSync,
|
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_fsync.ts";
|
|
||||||
import {
|
import {
|
||||||
ftruncate,
|
ftruncate,
|
||||||
ftruncateSync,
|
ftruncateSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_ftruncate.ts";
|
} from "internal:deno_node/_fs/_fs_ftruncate.ts";
|
||||||
import {
|
import { futimes, futimesSync } from "internal:deno_node/_fs/_fs_futimes.ts";
|
||||||
futimes,
|
|
||||||
futimesSync,
|
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_futimes.ts";
|
|
||||||
import {
|
import {
|
||||||
link,
|
link,
|
||||||
linkPromise,
|
linkPromise,
|
||||||
linkSync,
|
linkSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_link.ts";
|
} from "internal:deno_node/_fs/_fs_link.ts";
|
||||||
import {
|
import {
|
||||||
lstat,
|
lstat,
|
||||||
lstatPromise,
|
lstatPromise,
|
||||||
lstatSync,
|
lstatSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_lstat.ts";
|
} from "internal:deno_node/_fs/_fs_lstat.ts";
|
||||||
import {
|
import {
|
||||||
mkdir,
|
mkdir,
|
||||||
mkdirPromise,
|
mkdirPromise,
|
||||||
mkdirSync,
|
mkdirSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_mkdir.ts";
|
} from "internal:deno_node/_fs/_fs_mkdir.ts";
|
||||||
import {
|
import {
|
||||||
mkdtemp,
|
mkdtemp,
|
||||||
mkdtempPromise,
|
mkdtempPromise,
|
||||||
mkdtempSync,
|
mkdtempSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_mkdtemp.ts";
|
} from "internal:deno_node/_fs/_fs_mkdtemp.ts";
|
||||||
import {
|
import {
|
||||||
open,
|
open,
|
||||||
openPromise,
|
openPromise,
|
||||||
openSync,
|
openSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_open.ts";
|
} from "internal:deno_node/_fs/_fs_open.ts";
|
||||||
import {
|
import {
|
||||||
opendir,
|
opendir,
|
||||||
opendirPromise,
|
opendirPromise,
|
||||||
opendirSync,
|
opendirSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_opendir.ts";
|
} from "internal:deno_node/_fs/_fs_opendir.ts";
|
||||||
import { read, readSync } from "internal:deno_node/polyfills/_fs/_fs_read.ts";
|
import { read, readSync } from "internal:deno_node/_fs/_fs_read.ts";
|
||||||
import {
|
import {
|
||||||
readdir,
|
readdir,
|
||||||
readdirPromise,
|
readdirPromise,
|
||||||
readdirSync,
|
readdirSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_readdir.ts";
|
} from "internal:deno_node/_fs/_fs_readdir.ts";
|
||||||
import {
|
import {
|
||||||
readFile,
|
readFile,
|
||||||
readFilePromise,
|
readFilePromise,
|
||||||
readFileSync,
|
readFileSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_readFile.ts";
|
} from "internal:deno_node/_fs/_fs_readFile.ts";
|
||||||
import {
|
import {
|
||||||
readlink,
|
readlink,
|
||||||
readlinkPromise,
|
readlinkPromise,
|
||||||
readlinkSync,
|
readlinkSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_readlink.ts";
|
} from "internal:deno_node/_fs/_fs_readlink.ts";
|
||||||
import {
|
import {
|
||||||
realpath,
|
realpath,
|
||||||
realpathPromise,
|
realpathPromise,
|
||||||
realpathSync,
|
realpathSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_realpath.ts";
|
} from "internal:deno_node/_fs/_fs_realpath.ts";
|
||||||
import {
|
import {
|
||||||
rename,
|
rename,
|
||||||
renamePromise,
|
renamePromise,
|
||||||
renameSync,
|
renameSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_rename.ts";
|
} from "internal:deno_node/_fs/_fs_rename.ts";
|
||||||
import {
|
import {
|
||||||
rmdir,
|
rmdir,
|
||||||
rmdirPromise,
|
rmdirPromise,
|
||||||
rmdirSync,
|
rmdirSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_rmdir.ts";
|
} from "internal:deno_node/_fs/_fs_rmdir.ts";
|
||||||
import {
|
import { rm, rmPromise, rmSync } from "internal:deno_node/_fs/_fs_rm.ts";
|
||||||
rm,
|
|
||||||
rmPromise,
|
|
||||||
rmSync,
|
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_rm.ts";
|
|
||||||
import {
|
import {
|
||||||
stat,
|
stat,
|
||||||
statPromise,
|
statPromise,
|
||||||
statSync,
|
statSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_stat.ts";
|
} from "internal:deno_node/_fs/_fs_stat.ts";
|
||||||
import {
|
import {
|
||||||
symlink,
|
symlink,
|
||||||
symlinkPromise,
|
symlinkPromise,
|
||||||
symlinkSync,
|
symlinkSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_symlink.ts";
|
} from "internal:deno_node/_fs/_fs_symlink.ts";
|
||||||
import {
|
import {
|
||||||
truncate,
|
truncate,
|
||||||
truncatePromise,
|
truncatePromise,
|
||||||
truncateSync,
|
truncateSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_truncate.ts";
|
} from "internal:deno_node/_fs/_fs_truncate.ts";
|
||||||
import {
|
import {
|
||||||
unlink,
|
unlink,
|
||||||
unlinkPromise,
|
unlinkPromise,
|
||||||
unlinkSync,
|
unlinkSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_unlink.ts";
|
} from "internal:deno_node/_fs/_fs_unlink.ts";
|
||||||
import {
|
import {
|
||||||
utimes,
|
utimes,
|
||||||
utimesPromise,
|
utimesPromise,
|
||||||
utimesSync,
|
utimesSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_utimes.ts";
|
} from "internal:deno_node/_fs/_fs_utimes.ts";
|
||||||
import {
|
import {
|
||||||
unwatchFile,
|
unwatchFile,
|
||||||
watch,
|
watch,
|
||||||
watchFile,
|
watchFile,
|
||||||
watchPromise,
|
watchPromise,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_watch.ts";
|
} from "internal:deno_node/_fs/_fs_watch.ts";
|
||||||
// @deno-types="./_fs/_fs_write.d.ts"
|
// @deno-types="./_fs/_fs_write.d.ts"
|
||||||
import {
|
import { write, writeSync } from "internal:deno_node/_fs/_fs_write.mjs";
|
||||||
write,
|
|
||||||
writeSync,
|
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_write.mjs";
|
|
||||||
// @deno-types="./_fs/_fs_writev.d.ts"
|
// @deno-types="./_fs/_fs_writev.d.ts"
|
||||||
import {
|
import { writev, writevSync } from "internal:deno_node/_fs/_fs_writev.mjs";
|
||||||
writev,
|
|
||||||
writevSync,
|
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_writev.mjs";
|
|
||||||
import {
|
import {
|
||||||
writeFile,
|
writeFile,
|
||||||
writeFilePromise,
|
writeFilePromise,
|
||||||
writeFileSync,
|
writeFileSync,
|
||||||
} from "internal:deno_node/polyfills/_fs/_fs_writeFile.ts";
|
} from "internal:deno_node/_fs/_fs_writeFile.ts";
|
||||||
import { Stats } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
import { Stats } from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
// @deno-types="./internal/fs/streams.d.ts"
|
// @deno-types="./internal/fs/streams.d.ts"
|
||||||
import {
|
import {
|
||||||
createReadStream,
|
createReadStream,
|
||||||
createWriteStream,
|
createWriteStream,
|
||||||
ReadStream,
|
ReadStream,
|
||||||
WriteStream,
|
WriteStream,
|
||||||
} from "internal:deno_node/polyfills/internal/fs/streams.mjs";
|
} from "internal:deno_node/internal/fs/streams.mjs";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
F_OK,
|
F_OK,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { promises as fsPromises } from "internal:deno_node/polyfills/fs.ts";
|
import { promises as fsPromises } from "internal:deno_node/fs.ts";
|
||||||
|
|
||||||
export const access = fsPromises.access;
|
export const access = fsPromises.access;
|
||||||
export const copyFile = fsPromises.copyFile;
|
export const copyFile = fsPromises.copyFile;
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
// deno-lint-ignore-file no-var
|
// deno-lint-ignore-file no-var
|
||||||
import processModule from "internal:deno_node/polyfills/process.ts";
|
import processModule from "internal:deno_node/process.ts";
|
||||||
import { Buffer as bufferModule } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer as bufferModule } from "internal:deno_node/buffer.ts";
|
||||||
import {
|
import {
|
||||||
clearInterval,
|
clearInterval,
|
||||||
clearTimeout,
|
clearTimeout,
|
||||||
setInterval,
|
setInterval,
|
||||||
setTimeout,
|
setTimeout,
|
||||||
} from "internal:deno_node/polyfills/timers.ts";
|
} from "internal:deno_node/timers.ts";
|
||||||
import timers from "internal:deno_node/polyfills/timers.ts";
|
import timers from "internal:deno_node/timers.ts";
|
||||||
|
|
||||||
type GlobalType = {
|
type GlobalType = {
|
||||||
process: typeof processModule;
|
process: typeof processModule;
|
||||||
|
|
|
@ -1,32 +1,29 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import { TextEncoder } from "internal:deno_web/08_text_encoding.js";
|
import { TextEncoder } from "internal:deno_web/08_text_encoding.js";
|
||||||
import {
|
import { type Deferred, deferred } from "internal:deno_node/_util/async.ts";
|
||||||
type Deferred,
|
|
||||||
deferred,
|
|
||||||
} from "internal:deno_node/polyfills/_util/async.ts";
|
|
||||||
import {
|
import {
|
||||||
_normalizeArgs,
|
_normalizeArgs,
|
||||||
ListenOptions,
|
ListenOptions,
|
||||||
Socket,
|
Socket,
|
||||||
} from "internal:deno_node/polyfills/net.ts";
|
} from "internal:deno_node/net.ts";
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import { ERR_SERVER_NOT_RUNNING } from "internal:deno_node/polyfills/internal/errors.ts";
|
import { ERR_SERVER_NOT_RUNNING } from "internal:deno_node/internal/errors.ts";
|
||||||
import { EventEmitter } from "internal:deno_node/polyfills/events.ts";
|
import { EventEmitter } from "internal:deno_node/events.ts";
|
||||||
import { nextTick } from "internal:deno_node/polyfills/_next_tick.ts";
|
import { nextTick } from "internal:deno_node/_next_tick.ts";
|
||||||
import { validatePort } from "internal:deno_node/polyfills/internal/validators.mjs";
|
import { validatePort } from "internal:deno_node/internal/validators.mjs";
|
||||||
import {
|
import {
|
||||||
Readable as NodeReadable,
|
Readable as NodeReadable,
|
||||||
Writable as NodeWritable,
|
Writable as NodeWritable,
|
||||||
} from "internal:deno_node/polyfills/stream.ts";
|
} from "internal:deno_node/stream.ts";
|
||||||
import { OutgoingMessage } from "internal:deno_node/polyfills/_http_outgoing.ts";
|
import { OutgoingMessage } from "internal:deno_node/_http_outgoing.ts";
|
||||||
import { Agent } from "internal:deno_node/polyfills/_http_agent.mjs";
|
import { Agent } from "internal:deno_node/_http_agent.mjs";
|
||||||
import { chunkExpression as RE_TE_CHUNKED } from "internal:deno_node/polyfills/_http_common.ts";
|
import { chunkExpression as RE_TE_CHUNKED } from "internal:deno_node/_http_common.ts";
|
||||||
import { urlToHttpOptions } from "internal:deno_node/polyfills/internal/url.ts";
|
import { urlToHttpOptions } from "internal:deno_node/internal/url.ts";
|
||||||
import {
|
import {
|
||||||
constants,
|
constants,
|
||||||
TCP,
|
TCP,
|
||||||
} from "internal:deno_node/polyfills/internal_binding/tcp_wrap.ts";
|
} from "internal:deno_node/internal_binding/tcp_wrap.ts";
|
||||||
|
|
||||||
enum STATUS_CODES {
|
enum STATUS_CODES {
|
||||||
/** RFC 7231, 6.2.1 */
|
/** RFC 7231, 6.2.1 */
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import { notImplemented } from "internal:deno_node/polyfills/_utils.ts";
|
import { notImplemented } from "internal:deno_node/_utils.ts";
|
||||||
|
|
||||||
export class Http2Session {
|
export class Http2Session {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import { notImplemented } from "internal:deno_node/polyfills/_utils.ts";
|
import { notImplemented } from "internal:deno_node/_utils.ts";
|
||||||
import { urlToHttpOptions } from "internal:deno_node/polyfills/internal/url.ts";
|
import { urlToHttpOptions } from "internal:deno_node/internal/url.ts";
|
||||||
import {
|
import {
|
||||||
Agent as HttpAgent,
|
Agent as HttpAgent,
|
||||||
ClientRequest,
|
ClientRequest,
|
||||||
IncomingMessageForClient as IncomingMessage,
|
IncomingMessageForClient as IncomingMessage,
|
||||||
type RequestOptions,
|
type RequestOptions,
|
||||||
} from "internal:deno_node/polyfills/http.ts";
|
} from "internal:deno_node/http.ts";
|
||||||
import type { Socket } from "internal:deno_node/polyfills/net.ts";
|
import type { Socket } from "internal:deno_node/net.ts";
|
||||||
|
|
||||||
export class Agent extends HttpAgent {
|
export class Agent extends HttpAgent {
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import { EventEmitter } from "internal:deno_node/polyfills/events.ts";
|
import { EventEmitter } from "internal:deno_node/events.ts";
|
||||||
import { notImplemented } from "internal:deno_node/polyfills/_utils.ts";
|
import { notImplemented } from "internal:deno_node/_utils.ts";
|
||||||
|
|
||||||
const connectionSymbol = Symbol("connectionProperty");
|
const connectionSymbol = Symbol("connectionProperty");
|
||||||
const messageCallbacksSymbol = Symbol("messageCallbacks");
|
const messageCallbacksSymbol = Symbol("messageCallbacks");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { ERR_INTERNAL_ASSERTION } from "internal:deno_node/polyfills/internal/errors.ts";
|
import { ERR_INTERNAL_ASSERTION } from "internal:deno_node/internal/errors.ts";
|
||||||
|
|
||||||
function assert(value, message) {
|
function assert(value, message) {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
||||||
|
|
||||||
// deno-lint-ignore camelcase
|
// deno-lint-ignore camelcase
|
||||||
import * as async_wrap from "internal:deno_node/polyfills/internal_binding/async_wrap.ts";
|
import * as async_wrap from "internal:deno_node/internal_binding/async_wrap.ts";
|
||||||
import { ERR_ASYNC_CALLBACK } from "internal:deno_node/polyfills/internal/errors.ts";
|
import { ERR_ASYNC_CALLBACK } from "internal:deno_node/internal/errors.ts";
|
||||||
export {
|
export {
|
||||||
asyncIdSymbol,
|
asyncIdSymbol,
|
||||||
ownerSymbol,
|
ownerSymbol,
|
||||||
} from "internal:deno_node/polyfills/internal_binding/symbols.ts";
|
} from "internal:deno_node/internal_binding/symbols.ts";
|
||||||
|
|
||||||
interface ActiveHooks {
|
interface ActiveHooks {
|
||||||
array: AsyncHook[];
|
array: AsyncHook[];
|
||||||
|
|
160
ext/node/polyfills/internal/buffer.d.ts
vendored
160
ext/node/polyfills/internal/buffer.d.ts
vendored
|
@ -35,7 +35,7 @@ type WithImplicitCoercion<T> =
|
||||||
* recommended to explicitly reference it via an import or require statement.
|
* recommended to explicitly reference it via an import or require statement.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* // Creates a zero-filled Buffer of length 10.
|
* // Creates a zero-filled Buffer of length 10.
|
||||||
* const buf1 = Buffer.alloc(10);
|
* const buf1 = Buffer.alloc(10);
|
||||||
|
@ -118,7 +118,7 @@ export class Buffer extends Uint8Array {
|
||||||
* Array entries outside that range will be truncated to fit into it.
|
* Array entries outside that range will be truncated to fit into it.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'.
|
* // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'.
|
||||||
* const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
|
* const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
|
||||||
|
@ -165,7 +165,7 @@ export class Buffer extends Uint8Array {
|
||||||
* Returns `true` if `obj` is a `Buffer`, `false` otherwise.
|
* Returns `true` if `obj` is a `Buffer`, `false` otherwise.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* Buffer.isBuffer(Buffer.alloc(10)); // true
|
* Buffer.isBuffer(Buffer.alloc(10)); // true
|
||||||
* Buffer.isBuffer(Buffer.from('foo')); // true
|
* Buffer.isBuffer(Buffer.from('foo')); // true
|
||||||
|
@ -181,7 +181,7 @@ export class Buffer extends Uint8Array {
|
||||||
* or `false` otherwise.
|
* or `false` otherwise.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* console.log(Buffer.isEncoding('utf8'));
|
* console.log(Buffer.isEncoding('utf8'));
|
||||||
* // Prints: true
|
* // Prints: true
|
||||||
|
@ -210,7 +210,7 @@ export class Buffer extends Uint8Array {
|
||||||
* string.
|
* string.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const str = '\u00bd + \u00bc = \u00be';
|
* const str = '\u00bd + \u00bc = \u00be';
|
||||||
*
|
*
|
||||||
|
@ -249,7 +249,7 @@ export class Buffer extends Uint8Array {
|
||||||
* truncated to `totalLength`.
|
* truncated to `totalLength`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* // Create a single `Buffer` from a list of three `Buffer` instances.
|
* // Create a single `Buffer` from a list of three `Buffer` instances.
|
||||||
*
|
*
|
||||||
|
@ -282,7 +282,7 @@ export class Buffer extends Uint8Array {
|
||||||
* Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`.
|
* Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf1 = Buffer.from('1234');
|
* const buf1 = Buffer.from('1234');
|
||||||
* const buf2 = Buffer.from('0123');
|
* const buf2 = Buffer.from('0123');
|
||||||
|
@ -300,7 +300,7 @@ export class Buffer extends Uint8Array {
|
||||||
* Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled.
|
* Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.alloc(5);
|
* const buf = Buffer.alloc(5);
|
||||||
*
|
*
|
||||||
|
@ -313,7 +313,7 @@ export class Buffer extends Uint8Array {
|
||||||
* If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`.
|
* If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.alloc(5, 'a');
|
* const buf = Buffer.alloc(5, 'a');
|
||||||
*
|
*
|
||||||
|
@ -325,7 +325,7 @@ export class Buffer extends Uint8Array {
|
||||||
* initialized by calling `buf.fill(fill, encoding)`.
|
* initialized by calling `buf.fill(fill, encoding)`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
|
* const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
|
||||||
*
|
*
|
||||||
|
@ -355,7 +355,7 @@ export class Buffer extends Uint8Array {
|
||||||
* _initialized_. The contents of the newly created `Buffer` are unknown and_may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes.
|
* _initialized_. The contents of the newly created `Buffer` are unknown and_may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(10);
|
* const buf = Buffer.allocUnsafe(10);
|
||||||
*
|
*
|
||||||
|
@ -406,7 +406,7 @@ export class Buffer extends Uint8Array {
|
||||||
* then copying out the relevant bits.
|
* then copying out the relevant bits.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* // Need to keep around a few small chunks of memory.
|
* // Need to keep around a few small chunks of memory.
|
||||||
* const store = [];
|
* const store = [];
|
||||||
|
@ -443,7 +443,7 @@ export class Buffer extends Uint8Array {
|
||||||
* written. However, partially encoded characters will not be written.
|
* written. However, partially encoded characters will not be written.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.alloc(256);
|
* const buf = Buffer.alloc(256);
|
||||||
*
|
*
|
||||||
|
@ -484,7 +484,7 @@ export class Buffer extends Uint8Array {
|
||||||
* as {@link constants.MAX_STRING_LENGTH}.
|
* as {@link constants.MAX_STRING_LENGTH}.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf1 = Buffer.allocUnsafe(26);
|
* const buf1 = Buffer.allocUnsafe(26);
|
||||||
*
|
*
|
||||||
|
@ -521,7 +521,7 @@ export class Buffer extends Uint8Array {
|
||||||
* In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`.
|
* In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]);
|
* const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]);
|
||||||
* const json = JSON.stringify(buf);
|
* const json = JSON.stringify(buf);
|
||||||
|
@ -548,7 +548,7 @@ export class Buffer extends Uint8Array {
|
||||||
* Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`.
|
* Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf1 = Buffer.from('ABC');
|
* const buf1 = Buffer.from('ABC');
|
||||||
* const buf2 = Buffer.from('414243', 'hex');
|
* const buf2 = Buffer.from('414243', 'hex');
|
||||||
|
@ -572,7 +572,7 @@ export class Buffer extends Uint8Array {
|
||||||
* * `-1` is returned if `target` should come _after_`buf` when sorted.
|
* * `-1` is returned if `target` should come _after_`buf` when sorted.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf1 = Buffer.from('ABC');
|
* const buf1 = Buffer.from('ABC');
|
||||||
* const buf2 = Buffer.from('BCD');
|
* const buf2 = Buffer.from('BCD');
|
||||||
|
@ -596,7 +596,7 @@ export class Buffer extends Uint8Array {
|
||||||
* The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively.
|
* The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]);
|
* const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]);
|
||||||
* const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]);
|
* const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]);
|
||||||
|
@ -632,7 +632,7 @@ export class Buffer extends Uint8Array {
|
||||||
* different function arguments.
|
* different function arguments.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* // Create two `Buffer` instances.
|
* // Create two `Buffer` instances.
|
||||||
* const buf1 = Buffer.allocUnsafe(26);
|
* const buf1 = Buffer.allocUnsafe(26);
|
||||||
|
@ -653,7 +653,7 @@ export class Buffer extends Uint8Array {
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* // Create a `Buffer` and copy data from one region to an overlapping region
|
* // Create a `Buffer` and copy data from one region to an overlapping region
|
||||||
* // within the same `Buffer`.
|
* // within the same `Buffer`.
|
||||||
|
@ -693,7 +693,7 @@ export class Buffer extends Uint8Array {
|
||||||
* which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`.
|
* which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from('buffer');
|
* const buf = Buffer.from('buffer');
|
||||||
*
|
*
|
||||||
|
@ -722,7 +722,7 @@ export class Buffer extends Uint8Array {
|
||||||
* Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap.
|
* Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte
|
* // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte
|
||||||
* // from the original `Buffer`.
|
* // from the original `Buffer`.
|
||||||
|
@ -749,7 +749,7 @@ export class Buffer extends Uint8Array {
|
||||||
* end of `buf` rather than the beginning.
|
* end of `buf` rather than the beginning.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from('buffer');
|
* const buf = Buffer.from('buffer');
|
||||||
*
|
*
|
||||||
|
@ -776,7 +776,7 @@ export class Buffer extends Uint8Array {
|
||||||
* `value` is interpreted and written as a two's complement signed integer.
|
* `value` is interpreted and written as a two's complement signed integer.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(8);
|
* const buf = Buffer.allocUnsafe(8);
|
||||||
*
|
*
|
||||||
|
@ -797,7 +797,7 @@ export class Buffer extends Uint8Array {
|
||||||
* `value` is interpreted and written as a two's complement signed integer.
|
* `value` is interpreted and written as a two's complement signed integer.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(8);
|
* const buf = Buffer.allocUnsafe(8);
|
||||||
*
|
*
|
||||||
|
@ -818,7 +818,7 @@ export class Buffer extends Uint8Array {
|
||||||
* This function is also available under the `writeBigUint64BE` alias.
|
* This function is also available under the `writeBigUint64BE` alias.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(8);
|
* const buf = Buffer.allocUnsafe(8);
|
||||||
*
|
*
|
||||||
|
@ -837,7 +837,7 @@ export class Buffer extends Uint8Array {
|
||||||
* Writes `value` to `buf` at the specified `offset` as little-endian
|
* Writes `value` to `buf` at the specified `offset` as little-endian
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(8);
|
* const buf = Buffer.allocUnsafe(8);
|
||||||
*
|
*
|
||||||
|
@ -861,7 +861,7 @@ export class Buffer extends Uint8Array {
|
||||||
* This function is also available under the `writeUintLE` alias.
|
* This function is also available under the `writeUintLE` alias.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(6);
|
* const buf = Buffer.allocUnsafe(6);
|
||||||
*
|
*
|
||||||
|
@ -884,7 +884,7 @@ export class Buffer extends Uint8Array {
|
||||||
* This function is also available under the `writeUintBE` alias.
|
* This function is also available under the `writeUintBE` alias.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(6);
|
* const buf = Buffer.allocUnsafe(6);
|
||||||
*
|
*
|
||||||
|
@ -905,7 +905,7 @@ export class Buffer extends Uint8Array {
|
||||||
* when `value` is anything other than a signed integer.
|
* when `value` is anything other than a signed integer.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(6);
|
* const buf = Buffer.allocUnsafe(6);
|
||||||
*
|
*
|
||||||
|
@ -926,7 +926,7 @@ export class Buffer extends Uint8Array {
|
||||||
* signed integer.
|
* signed integer.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(6);
|
* const buf = Buffer.allocUnsafe(6);
|
||||||
*
|
*
|
||||||
|
@ -948,7 +948,7 @@ export class Buffer extends Uint8Array {
|
||||||
* This function is also available under the `readBigUint64BE` alias.
|
* This function is also available under the `readBigUint64BE` alias.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
|
* const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
|
||||||
*
|
*
|
||||||
|
@ -965,7 +965,7 @@ export class Buffer extends Uint8Array {
|
||||||
* This function is also available under the `readBigUint64LE` alias.
|
* This function is also available under the `readBigUint64LE` alias.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
|
* const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
|
||||||
*
|
*
|
||||||
|
@ -1001,7 +1001,7 @@ export class Buffer extends Uint8Array {
|
||||||
* This function is also available under the `readUintLE` alias.
|
* This function is also available under the `readUintLE` alias.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
|
* const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
|
||||||
*
|
*
|
||||||
|
@ -1020,7 +1020,7 @@ export class Buffer extends Uint8Array {
|
||||||
* This function is also available under the `readUintBE` alias.
|
* This function is also available under the `readUintBE` alias.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
|
* const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
|
||||||
*
|
*
|
||||||
|
@ -1039,7 +1039,7 @@ export class Buffer extends Uint8Array {
|
||||||
* supporting up to 48 bits of accuracy.
|
* supporting up to 48 bits of accuracy.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
|
* const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
|
||||||
*
|
*
|
||||||
|
@ -1056,7 +1056,7 @@ export class Buffer extends Uint8Array {
|
||||||
* supporting up to 48 bits of accuracy.
|
* supporting up to 48 bits of accuracy.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
|
* const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
|
||||||
*
|
*
|
||||||
|
@ -1078,7 +1078,7 @@ export class Buffer extends Uint8Array {
|
||||||
* This function is also available under the `readUint8` alias.
|
* This function is also available under the `readUint8` alias.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([1, -2]);
|
* const buf = Buffer.from([1, -2]);
|
||||||
*
|
*
|
||||||
|
@ -1099,7 +1099,7 @@ export class Buffer extends Uint8Array {
|
||||||
* This function is also available under the `readUint16LE` alias.
|
* This function is also available under the `readUint16LE` alias.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([0x12, 0x34, 0x56]);
|
* const buf = Buffer.from([0x12, 0x34, 0x56]);
|
||||||
*
|
*
|
||||||
|
@ -1120,7 +1120,7 @@ export class Buffer extends Uint8Array {
|
||||||
* This function is also available under the `readUint16BE` alias.
|
* This function is also available under the `readUint16BE` alias.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([0x12, 0x34, 0x56]);
|
* const buf = Buffer.from([0x12, 0x34, 0x56]);
|
||||||
*
|
*
|
||||||
|
@ -1139,7 +1139,7 @@ export class Buffer extends Uint8Array {
|
||||||
* This function is also available under the `readUint32LE` alias.
|
* This function is also available under the `readUint32LE` alias.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
|
* const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
|
||||||
*
|
*
|
||||||
|
@ -1158,7 +1158,7 @@ export class Buffer extends Uint8Array {
|
||||||
* This function is also available under the `readUint32BE` alias.
|
* This function is also available under the `readUint32BE` alias.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
|
* const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
|
||||||
*
|
*
|
||||||
|
@ -1175,7 +1175,7 @@ export class Buffer extends Uint8Array {
|
||||||
* Integers read from a `Buffer` are interpreted as two's complement signed values.
|
* Integers read from a `Buffer` are interpreted as two's complement signed values.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([-1, 5]);
|
* const buf = Buffer.from([-1, 5]);
|
||||||
*
|
*
|
||||||
|
@ -1196,7 +1196,7 @@ export class Buffer extends Uint8Array {
|
||||||
* Integers read from a `Buffer` are interpreted as two's complement signed values.
|
* Integers read from a `Buffer` are interpreted as two's complement signed values.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([0, 5]);
|
* const buf = Buffer.from([0, 5]);
|
||||||
*
|
*
|
||||||
|
@ -1215,7 +1215,7 @@ export class Buffer extends Uint8Array {
|
||||||
* Integers read from a `Buffer` are interpreted as two's complement signed values.
|
* Integers read from a `Buffer` are interpreted as two's complement signed values.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([0, 5]);
|
* const buf = Buffer.from([0, 5]);
|
||||||
*
|
*
|
||||||
|
@ -1232,7 +1232,7 @@ export class Buffer extends Uint8Array {
|
||||||
* Integers read from a `Buffer` are interpreted as two's complement signed values.
|
* Integers read from a `Buffer` are interpreted as two's complement signed values.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([0, 0, 0, 5]);
|
* const buf = Buffer.from([0, 0, 0, 5]);
|
||||||
*
|
*
|
||||||
|
@ -1251,7 +1251,7 @@ export class Buffer extends Uint8Array {
|
||||||
* Integers read from a `Buffer` are interpreted as two's complement signed values.
|
* Integers read from a `Buffer` are interpreted as two's complement signed values.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([0, 0, 0, 5]);
|
* const buf = Buffer.from([0, 0, 0, 5]);
|
||||||
*
|
*
|
||||||
|
@ -1266,7 +1266,7 @@ export class Buffer extends Uint8Array {
|
||||||
* Reads a 32-bit, little-endian float from `buf` at the specified `offset`.
|
* Reads a 32-bit, little-endian float from `buf` at the specified `offset`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([1, 2, 3, 4]);
|
* const buf = Buffer.from([1, 2, 3, 4]);
|
||||||
*
|
*
|
||||||
|
@ -1283,7 +1283,7 @@ export class Buffer extends Uint8Array {
|
||||||
* Reads a 32-bit, big-endian float from `buf` at the specified `offset`.
|
* Reads a 32-bit, big-endian float from `buf` at the specified `offset`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([1, 2, 3, 4]);
|
* const buf = Buffer.from([1, 2, 3, 4]);
|
||||||
*
|
*
|
||||||
|
@ -1298,7 +1298,7 @@ export class Buffer extends Uint8Array {
|
||||||
* Reads a 64-bit, little-endian double from `buf` at the specified `offset`.
|
* Reads a 64-bit, little-endian double from `buf` at the specified `offset`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
|
* const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
|
||||||
*
|
*
|
||||||
|
@ -1315,7 +1315,7 @@ export class Buffer extends Uint8Array {
|
||||||
* Reads a 64-bit, big-endian double from `buf` at the specified `offset`.
|
* Reads a 64-bit, big-endian double from `buf` at the specified `offset`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
|
* const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
|
||||||
*
|
*
|
||||||
|
@ -1332,7 +1332,7 @@ export class Buffer extends Uint8Array {
|
||||||
* byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2.
|
* byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
|
* const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
|
||||||
*
|
*
|
||||||
|
@ -1354,7 +1354,7 @@ export class Buffer extends Uint8Array {
|
||||||
* between UTF-16 little-endian and UTF-16 big-endian:
|
* between UTF-16 little-endian and UTF-16 big-endian:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from('This is little-endian UTF-16', 'utf16le');
|
* const buf = Buffer.from('This is little-endian UTF-16', 'utf16le');
|
||||||
* buf.swap16(); // Convert to big-endian UTF-16 text.
|
* buf.swap16(); // Convert to big-endian UTF-16 text.
|
||||||
|
@ -1368,7 +1368,7 @@ export class Buffer extends Uint8Array {
|
||||||
* byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4.
|
* byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
|
* const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
|
||||||
*
|
*
|
||||||
|
@ -1394,7 +1394,7 @@ export class Buffer extends Uint8Array {
|
||||||
* Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8.
|
* Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
|
* const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
|
||||||
*
|
*
|
||||||
|
@ -1423,7 +1423,7 @@ export class Buffer extends Uint8Array {
|
||||||
* This function is also available under the `writeUint8` alias.
|
* This function is also available under the `writeUint8` alias.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(4);
|
* const buf = Buffer.allocUnsafe(4);
|
||||||
*
|
*
|
||||||
|
@ -1448,7 +1448,7 @@ export class Buffer extends Uint8Array {
|
||||||
* This function is also available under the `writeUint16LE` alias.
|
* This function is also available under the `writeUint16LE` alias.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(4);
|
* const buf = Buffer.allocUnsafe(4);
|
||||||
*
|
*
|
||||||
|
@ -1471,7 +1471,7 @@ export class Buffer extends Uint8Array {
|
||||||
* This function is also available under the `writeUint16BE` alias.
|
* This function is also available under the `writeUint16BE` alias.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(4);
|
* const buf = Buffer.allocUnsafe(4);
|
||||||
*
|
*
|
||||||
|
@ -1494,7 +1494,7 @@ export class Buffer extends Uint8Array {
|
||||||
* This function is also available under the `writeUint32LE` alias.
|
* This function is also available under the `writeUint32LE` alias.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(4);
|
* const buf = Buffer.allocUnsafe(4);
|
||||||
*
|
*
|
||||||
|
@ -1516,7 +1516,7 @@ export class Buffer extends Uint8Array {
|
||||||
* This function is also available under the `writeUint32BE` alias.
|
* This function is also available under the `writeUint32BE` alias.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(4);
|
* const buf = Buffer.allocUnsafe(4);
|
||||||
*
|
*
|
||||||
|
@ -1539,7 +1539,7 @@ export class Buffer extends Uint8Array {
|
||||||
* `value` is interpreted and written as a two's complement signed integer.
|
* `value` is interpreted and written as a two's complement signed integer.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(2);
|
* const buf = Buffer.allocUnsafe(2);
|
||||||
*
|
*
|
||||||
|
@ -1562,7 +1562,7 @@ export class Buffer extends Uint8Array {
|
||||||
* The `value` is interpreted and written as a two's complement signed integer.
|
* The `value` is interpreted and written as a two's complement signed integer.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(2);
|
* const buf = Buffer.allocUnsafe(2);
|
||||||
*
|
*
|
||||||
|
@ -1584,7 +1584,7 @@ export class Buffer extends Uint8Array {
|
||||||
* The `value` is interpreted and written as a two's complement signed integer.
|
* The `value` is interpreted and written as a two's complement signed integer.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(2);
|
* const buf = Buffer.allocUnsafe(2);
|
||||||
*
|
*
|
||||||
|
@ -1606,7 +1606,7 @@ export class Buffer extends Uint8Array {
|
||||||
* The `value` is interpreted and written as a two's complement signed integer.
|
* The `value` is interpreted and written as a two's complement signed integer.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(4);
|
* const buf = Buffer.allocUnsafe(4);
|
||||||
*
|
*
|
||||||
|
@ -1628,7 +1628,7 @@ export class Buffer extends Uint8Array {
|
||||||
* The `value` is interpreted and written as a two's complement signed integer.
|
* The `value` is interpreted and written as a two's complement signed integer.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(4);
|
* const buf = Buffer.allocUnsafe(4);
|
||||||
*
|
*
|
||||||
|
@ -1648,7 +1648,7 @@ export class Buffer extends Uint8Array {
|
||||||
* undefined when `value` is anything other than a JavaScript number.
|
* undefined when `value` is anything other than a JavaScript number.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(4);
|
* const buf = Buffer.allocUnsafe(4);
|
||||||
*
|
*
|
||||||
|
@ -1668,7 +1668,7 @@ export class Buffer extends Uint8Array {
|
||||||
* undefined when `value` is anything other than a JavaScript number.
|
* undefined when `value` is anything other than a JavaScript number.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(4);
|
* const buf = Buffer.allocUnsafe(4);
|
||||||
*
|
*
|
||||||
|
@ -1688,7 +1688,7 @@ export class Buffer extends Uint8Array {
|
||||||
* other than a JavaScript number.
|
* other than a JavaScript number.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(8);
|
* const buf = Buffer.allocUnsafe(8);
|
||||||
*
|
*
|
||||||
|
@ -1708,7 +1708,7 @@ export class Buffer extends Uint8Array {
|
||||||
* other than a JavaScript number.
|
* other than a JavaScript number.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(8);
|
* const buf = Buffer.allocUnsafe(8);
|
||||||
*
|
*
|
||||||
|
@ -1728,7 +1728,7 @@ export class Buffer extends Uint8Array {
|
||||||
* the entire `buf` will be filled:
|
* the entire `buf` will be filled:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* // Fill a `Buffer` with the ASCII character 'h'.
|
* // Fill a `Buffer` with the ASCII character 'h'.
|
||||||
*
|
*
|
||||||
|
@ -1746,7 +1746,7 @@ export class Buffer extends Uint8Array {
|
||||||
* then only the bytes of that character that fit into `buf` are written:
|
* then only the bytes of that character that fit into `buf` are written:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* // Fill a `Buffer` with character that takes up two bytes in UTF-8.
|
* // Fill a `Buffer` with character that takes up two bytes in UTF-8.
|
||||||
*
|
*
|
||||||
|
@ -1758,7 +1758,7 @@ export class Buffer extends Uint8Array {
|
||||||
* fill data remains, an exception is thrown:
|
* fill data remains, an exception is thrown:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.allocUnsafe(5);
|
* const buf = Buffer.allocUnsafe(5);
|
||||||
*
|
*
|
||||||
|
@ -1792,7 +1792,7 @@ export class Buffer extends Uint8Array {
|
||||||
* value between `0` and `255`.
|
* value between `0` and `255`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from('this is a buffer');
|
* const buf = Buffer.from('this is a buffer');
|
||||||
*
|
*
|
||||||
|
@ -1825,7 +1825,7 @@ export class Buffer extends Uint8Array {
|
||||||
* behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf).
|
* behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf).
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const b = Buffer.from('abcdef');
|
* const b = Buffer.from('abcdef');
|
||||||
*
|
*
|
||||||
|
@ -1860,7 +1860,7 @@ export class Buffer extends Uint8Array {
|
||||||
* rather than the first occurrence.
|
* rather than the first occurrence.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from('this buffer is a buffer');
|
* const buf = Buffer.from('this buffer is a buffer');
|
||||||
*
|
*
|
||||||
|
@ -1895,7 +1895,7 @@ export class Buffer extends Uint8Array {
|
||||||
* This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf).
|
* This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf).
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const b = Buffer.from('abcdef');
|
* const b = Buffer.from('abcdef');
|
||||||
*
|
*
|
||||||
|
@ -1932,7 +1932,7 @@ export class Buffer extends Uint8Array {
|
||||||
* of `buf`.
|
* of `buf`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* // Log the entire contents of a `Buffer`.
|
* // Log the entire contents of a `Buffer`.
|
||||||
*
|
*
|
||||||
|
@ -1956,7 +1956,7 @@ export class Buffer extends Uint8Array {
|
||||||
* Equivalent to `buf.indexOf() !== -1`.
|
* Equivalent to `buf.indexOf() !== -1`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from('this is a buffer');
|
* const buf = Buffer.from('this is a buffer');
|
||||||
*
|
*
|
||||||
|
@ -1990,7 +1990,7 @@ export class Buffer extends Uint8Array {
|
||||||
* Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices).
|
* Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices).
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from('buffer');
|
* const buf = Buffer.from('buffer');
|
||||||
*
|
*
|
||||||
|
@ -2013,7 +2013,7 @@ export class Buffer extends Uint8Array {
|
||||||
* called automatically when a `Buffer` is used in a `for..of` statement.
|
* called automatically when a `Buffer` is used in a `for..of` statement.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
|
* import { Buffer } from "internal:deno_node/internal/buffer";
|
||||||
*
|
*
|
||||||
* const buf = Buffer.from('buffer');
|
* const buf = Buffer.from('buffer');
|
||||||
*
|
*
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
// Copyright Feross Aboukhadijeh, and other contributors. All rights reserved. MIT license.
|
// Copyright Feross Aboukhadijeh, and other contributors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import { TextDecoder, TextEncoder } from "internal:deno_web/08_text_encoding.js";
|
import { TextDecoder, TextEncoder } from "internal:deno_web/08_text_encoding.js";
|
||||||
import { codes } from "internal:deno_node/polyfills/internal/error_codes.ts";
|
import { codes } from "internal:deno_node/internal/error_codes.ts";
|
||||||
import { encodings } from "internal:deno_node/polyfills/internal_binding/string_decoder.ts";
|
import { encodings } from "internal:deno_node/internal_binding/string_decoder.ts";
|
||||||
import { indexOfBuffer, indexOfNumber } from "internal:deno_node/polyfills/internal_binding/buffer.ts";
|
import { indexOfBuffer, indexOfNumber } from "internal:deno_node/internal_binding/buffer.ts";
|
||||||
import {
|
import {
|
||||||
asciiToBytes,
|
asciiToBytes,
|
||||||
base64ToBytes,
|
base64ToBytes,
|
||||||
|
@ -14,11 +14,11 @@ import {
|
||||||
bytesToUtf16le,
|
bytesToUtf16le,
|
||||||
hexToBytes,
|
hexToBytes,
|
||||||
utf16leToBytes,
|
utf16leToBytes,
|
||||||
} from "internal:deno_node/polyfills/internal_binding/_utils.ts";
|
} from "internal:deno_node/internal_binding/_utils.ts";
|
||||||
import { isAnyArrayBuffer, isArrayBufferView } from "internal:deno_node/polyfills/internal/util/types.ts";
|
import { isAnyArrayBuffer, isArrayBufferView } from "internal:deno_node/internal/util/types.ts";
|
||||||
import { normalizeEncoding } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { normalizeEncoding } from "internal:deno_node/internal/util.mjs";
|
||||||
import { validateBuffer } from "internal:deno_node/polyfills/internal/validators.mjs";
|
import { validateBuffer } from "internal:deno_node/internal/validators.mjs";
|
||||||
import { isUint8Array } from "internal:deno_node/polyfills/internal/util/types.ts";
|
import { isUint8Array } from "internal:deno_node/internal/util/types.ts";
|
||||||
import { forgivingBase64Encode, forgivingBase64UrlEncode } from "internal:deno_web/00_infra.js";
|
import { forgivingBase64Encode, forgivingBase64UrlEncode } from "internal:deno_web/00_infra.js";
|
||||||
import { atob, btoa } from "internal:deno_web/05_base64.js";
|
import { atob, btoa } from "internal:deno_web/05_base64.js";
|
||||||
import { Blob } from "internal:deno_web/09_file.js";
|
import { Blob } from "internal:deno_web/09_file.js";
|
||||||
|
|
|
@ -2,37 +2,33 @@
|
||||||
|
|
||||||
// This module implements 'child_process' module of Node.JS API.
|
// This module implements 'child_process' module of Node.JS API.
|
||||||
// ref: https://nodejs.org/api/child_process.html
|
// ref: https://nodejs.org/api/child_process.html
|
||||||
import { assert } from "internal:deno_node/polyfills/_util/asserts.ts";
|
import { assert } from "internal:deno_node/_util/asserts.ts";
|
||||||
import { EventEmitter } from "internal:deno_node/polyfills/events.ts";
|
import { EventEmitter } from "internal:deno_node/events.ts";
|
||||||
import { os } from "internal:deno_node/polyfills/internal_binding/constants.ts";
|
import { os } from "internal:deno_node/internal_binding/constants.ts";
|
||||||
import {
|
import {
|
||||||
notImplemented,
|
notImplemented,
|
||||||
warnNotImplemented,
|
warnNotImplemented,
|
||||||
} from "internal:deno_node/polyfills/_utils.ts";
|
} from "internal:deno_node/_utils.ts";
|
||||||
import {
|
import { Readable, Stream, Writable } from "internal:deno_node/stream.ts";
|
||||||
Readable,
|
import { deferred } from "internal:deno_node/_util/async.ts";
|
||||||
Stream,
|
import { isWindows } from "internal:deno_node/_util/os.ts";
|
||||||
Writable,
|
import { nextTick } from "internal:deno_node/_next_tick.ts";
|
||||||
} from "internal:deno_node/polyfills/stream.ts";
|
|
||||||
import { deferred } from "internal:deno_node/polyfills/_util/async.ts";
|
|
||||||
import { isWindows } from "internal:deno_node/polyfills/_util/os.ts";
|
|
||||||
import { nextTick } from "internal:deno_node/polyfills/_next_tick.ts";
|
|
||||||
import {
|
import {
|
||||||
AbortError,
|
AbortError,
|
||||||
ERR_INVALID_ARG_TYPE,
|
ERR_INVALID_ARG_TYPE,
|
||||||
ERR_INVALID_ARG_VALUE,
|
ERR_INVALID_ARG_VALUE,
|
||||||
ERR_UNKNOWN_SIGNAL,
|
ERR_UNKNOWN_SIGNAL,
|
||||||
} from "internal:deno_node/polyfills/internal/errors.ts";
|
} from "internal:deno_node/internal/errors.ts";
|
||||||
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
|
import { Buffer } from "internal:deno_node/buffer.ts";
|
||||||
import { errnoException } from "internal:deno_node/polyfills/internal/errors.ts";
|
import { errnoException } from "internal:deno_node/internal/errors.ts";
|
||||||
import { ErrnoException } from "internal:deno_node/polyfills/_global.d.ts";
|
import { ErrnoException } from "internal:deno_node/_global.d.ts";
|
||||||
import { codeMap } from "internal:deno_node/polyfills/internal_binding/uv.ts";
|
import { codeMap } from "internal:deno_node/internal_binding/uv.ts";
|
||||||
import {
|
import {
|
||||||
isInt32,
|
isInt32,
|
||||||
validateBoolean,
|
validateBoolean,
|
||||||
validateObject,
|
validateObject,
|
||||||
validateString,
|
validateString,
|
||||||
} from "internal:deno_node/polyfills/internal/validators.mjs";
|
} from "internal:deno_node/internal/validators.mjs";
|
||||||
import {
|
import {
|
||||||
ArrayIsArray,
|
ArrayIsArray,
|
||||||
ArrayPrototypeFilter,
|
ArrayPrototypeFilter,
|
||||||
|
@ -43,10 +39,10 @@ import {
|
||||||
ArrayPrototypeUnshift,
|
ArrayPrototypeUnshift,
|
||||||
ObjectPrototypeHasOwnProperty,
|
ObjectPrototypeHasOwnProperty,
|
||||||
StringPrototypeToUpperCase,
|
StringPrototypeToUpperCase,
|
||||||
} from "internal:deno_node/polyfills/internal/primordials.mjs";
|
} from "internal:deno_node/internal/primordials.mjs";
|
||||||
import { kEmptyObject } from "internal:deno_node/polyfills/internal/util.mjs";
|
import { kEmptyObject } from "internal:deno_node/internal/util.mjs";
|
||||||
import { getValidatedPath } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
|
import { getValidatedPath } from "internal:deno_node/internal/fs/utils.mjs";
|
||||||
import process from "internal:deno_node/polyfills/process.ts";
|
import process from "internal:deno_node/process.ts";
|
||||||
|
|
||||||
export function mapValues<T, O>(
|
export function mapValues<T, O>(
|
||||||
record: Readonly<Record<string, T>>,
|
record: Readonly<Record<string, T>>,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import { getStringWidth } from "internal:deno_node/polyfills/internal/util/inspect.mjs";
|
import { getStringWidth } from "internal:deno_node/internal/util/inspect.mjs";
|
||||||
|
|
||||||
// The use of Unicode characters below is the only non-comment use of non-ASCII
|
// The use of Unicode characters below is the only non-comment use of non-ASCII
|
||||||
// Unicode characters in Node.js built-in modules. If they are ever removed or
|
// Unicode characters in Node.js built-in modules. If they are ever removed or
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue