1
0
Fork 0
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:
Bartek Iwańczuk 2023-03-04 22:31:38 -04:00 committed by GitHub
parent 01028fcdf4
commit b40086fd7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
219 changed files with 1205 additions and 1273 deletions

View file

@ -3,9 +3,9 @@
const core = globalThis.Deno.core;
const ops = core.ops;
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 { 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";
const primordials = globalThis.__bootstrap.primordials;
const {
@ -1424,6 +1424,6 @@ internals.testing = {
enableBench,
};
import { denoNs } from "internal:runtime/js/90_deno_ns.js";
import { denoNs } from "internal:runtime/90_deno_ns.js";
denoNs.bench = bench;
denoNs.test = test;

View file

@ -1 +1 @@
await import("internal:runtime/js/01_build.js");
await import("internal:runtime/01_build.js");

View file

@ -1,4 +1,4 @@
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

View file

@ -1 +1 @@
import "internal:runtime/js/01_build.js";
import "internal:runtime/01_build.js";

View file

@ -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",
"blob",
"file",

View file

@ -5,4 +5,4 @@ error: Uncaught (in worker "") Error
at Object.action (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.
at Worker.#pollControl (internal:runtime/js/11_workers.js:[WILDCARD])
at Worker.#pollControl (internal:runtime/11_workers.js:[WILDCARD])

View file

@ -37,13 +37,13 @@ failing step in failing test ... FAILED ([WILDCARD])
nested failure => ./test/steps/failing_steps.ts:[WILDCARD]
error: Error: 1 test step failed.
at runTest (internal:cli/js/40_testing.js:[WILDCARD])
at async runTests (internal:cli/js/40_testing.js:[WILDCARD])
at runTest (internal:cli/40_testing.js:[WILDCARD])
at async runTests (internal:cli/40_testing.js:[WILDCARD])
multiple test step failures => ./test/steps/failing_steps.ts:[WILDCARD]
error: Error: 2 test steps failed.
at runTest (internal:cli/js/40_testing.js:[WILDCARD])
at async runTests (internal:cli/js/40_testing.js:[WILDCARD])
at runTest (internal:cli/40_testing.js:[WILDCARD])
at async runTests (internal:cli/40_testing.js:[WILDCARD])
failing step in failing test => ./test/steps/failing_steps.ts:[WILDCARD]
error: Error: Fail test.

View file

@ -323,7 +323,7 @@ macro_rules! include_js_files {
(dir $dir:literal, $($file:literal,)+) => {
vec![
$($crate::ExtensionFileSource {
specifier: concat!($dir, "/", $file).to_string(),
specifier: concat!($file).to_string(),
code: $crate::ExtensionFileSourceCode::IncludedInBinary(
include_str!(concat!($dir, "/", $file)
)),
@ -349,7 +349,7 @@ macro_rules! include_js_files {
(dir $dir:literal, $($file:literal,)+) => {
vec![
$($crate::ExtensionFileSource {
specifier: concat!($dir, "/", $file).to_string(),
specifier: concat!($file).to_string(),
code: $crate::ExtensionFileSourceCode::LoadedFromFsDuringSnapshot(
std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join($dir).join($file)
),

View file

@ -364,7 +364,7 @@ pub fn init_polyfill() -> Extension {
Extension::builder(env!("CARGO_PKG_NAME"))
.esm(esm_files)
.esm_entry_point("internal:deno_node/polyfills/module_all.ts")
.esm_entry_point("internal:deno_node/module_all.ts")
.ops(vec![
crypto::op_node_create_hash::decl(),
crypto::op_node_hash_update::decl(),

View file

@ -21,75 +21,75 @@ pub struct NodeModulePolyfill {
pub static SUPPORTED_BUILTIN_NODE_MODULES: &[NodeModulePolyfill] = &[
NodeModulePolyfill {
name: "assert",
specifier: "internal:deno_node/polyfills/assert.ts",
specifier: "internal:deno_node/assert.ts",
},
NodeModulePolyfill {
name: "assert/strict",
specifier: "internal:deno_node/polyfills/assert/strict.ts",
specifier: "internal:deno_node/assert/strict.ts",
},
NodeModulePolyfill {
name: "async_hooks",
specifier: "internal:deno_node/polyfills/async_hooks.ts",
specifier: "internal:deno_node/async_hooks.ts",
},
NodeModulePolyfill {
name: "buffer",
specifier: "internal:deno_node/polyfills/buffer.ts",
specifier: "internal:deno_node/buffer.ts",
},
NodeModulePolyfill {
name: "child_process",
specifier: "internal:deno_node/polyfills/child_process.ts",
specifier: "internal:deno_node/child_process.ts",
},
NodeModulePolyfill {
name: "cluster",
specifier: "internal:deno_node/polyfills/cluster.ts",
specifier: "internal:deno_node/cluster.ts",
},
NodeModulePolyfill {
name: "console",
specifier: "internal:deno_node/polyfills/console.ts",
specifier: "internal:deno_node/console.ts",
},
NodeModulePolyfill {
name: "constants",
specifier: "internal:deno_node/polyfills/constants.ts",
specifier: "internal:deno_node/constants.ts",
},
NodeModulePolyfill {
name: "crypto",
specifier: "internal:deno_node/polyfills/crypto.ts",
specifier: "internal:deno_node/crypto.ts",
},
NodeModulePolyfill {
name: "dgram",
specifier: "internal:deno_node/polyfills/dgram.ts",
specifier: "internal:deno_node/dgram.ts",
},
NodeModulePolyfill {
name: "dns",
specifier: "internal:deno_node/polyfills/dns.ts",
specifier: "internal:deno_node/dns.ts",
},
NodeModulePolyfill {
name: "dns/promises",
specifier: "internal:deno_node/polyfills/dns/promises.ts",
specifier: "internal:deno_node/dns/promises.ts",
},
NodeModulePolyfill {
name: "domain",
specifier: "internal:deno_node/polyfills/domain.ts",
specifier: "internal:deno_node/domain.ts",
},
NodeModulePolyfill {
name: "events",
specifier: "internal:deno_node/polyfills/events.ts",
specifier: "internal:deno_node/events.ts",
},
NodeModulePolyfill {
name: "fs",
specifier: "internal:deno_node/polyfills/fs.ts",
specifier: "internal:deno_node/fs.ts",
},
NodeModulePolyfill {
name: "fs/promises",
specifier: "internal:deno_node/polyfills/fs/promises.ts",
specifier: "internal:deno_node/fs/promises.ts",
},
NodeModulePolyfill {
name: "http",
specifier: "internal:deno_node/polyfills/http.ts",
specifier: "internal:deno_node/http.ts",
},
NodeModulePolyfill {
name: "https",
specifier: "internal:deno_node/polyfills/https.ts",
specifier: "internal:deno_node/https.ts",
},
NodeModulePolyfill {
name: "module",
@ -97,106 +97,106 @@ pub static SUPPORTED_BUILTIN_NODE_MODULES: &[NodeModulePolyfill] = &[
},
NodeModulePolyfill {
name: "net",
specifier: "internal:deno_node/polyfills/net.ts",
specifier: "internal:deno_node/net.ts",
},
NodeModulePolyfill {
name: "os",
specifier: "internal:deno_node/polyfills/os.ts",
specifier: "internal:deno_node/os.ts",
},
NodeModulePolyfill {
name: "path",
specifier: "internal:deno_node/polyfills/path.ts",
specifier: "internal:deno_node/path.ts",
},
NodeModulePolyfill {
name: "path/posix",
specifier: "internal:deno_node/polyfills/path/posix.ts",
specifier: "internal:deno_node/path/posix.ts",
},
NodeModulePolyfill {
name: "path/win32",
specifier: "internal:deno_node/polyfills/path/win32.ts",
specifier: "internal:deno_node/path/win32.ts",
},
NodeModulePolyfill {
name: "perf_hooks",
specifier: "internal:deno_node/polyfills/perf_hooks.ts",
specifier: "internal:deno_node/perf_hooks.ts",
},
NodeModulePolyfill {
name: "process",
specifier: "internal:deno_node/polyfills/process.ts",
specifier: "internal:deno_node/process.ts",
},
NodeModulePolyfill {
name: "querystring",
specifier: "internal:deno_node/polyfills/querystring.ts",
specifier: "internal:deno_node/querystring.ts",
},
NodeModulePolyfill {
name: "readline",
specifier: "internal:deno_node/polyfills/readline.ts",
specifier: "internal:deno_node/readline.ts",
},
NodeModulePolyfill {
name: "stream",
specifier: "internal:deno_node/polyfills/stream.ts",
specifier: "internal:deno_node/stream.ts",
},
NodeModulePolyfill {
name: "stream/consumers",
specifier: "internal:deno_node/polyfills/stream/consumers.mjs",
specifier: "internal:deno_node/stream/consumers.mjs",
},
NodeModulePolyfill {
name: "stream/promises",
specifier: "internal:deno_node/polyfills/stream/promises.mjs",
specifier: "internal:deno_node/stream/promises.mjs",
},
NodeModulePolyfill {
name: "stream/web",
specifier: "internal:deno_node/polyfills/stream/web.ts",
specifier: "internal:deno_node/stream/web.ts",
},
NodeModulePolyfill {
name: "string_decoder",
specifier: "internal:deno_node/polyfills/string_decoder.ts",
specifier: "internal:deno_node/string_decoder.ts",
},
NodeModulePolyfill {
name: "sys",
specifier: "internal:deno_node/polyfills/sys.ts",
specifier: "internal:deno_node/sys.ts",
},
NodeModulePolyfill {
name: "timers",
specifier: "internal:deno_node/polyfills/timers.ts",
specifier: "internal:deno_node/timers.ts",
},
NodeModulePolyfill {
name: "timers/promises",
specifier: "internal:deno_node/polyfills/timers/promises.ts",
specifier: "internal:deno_node/timers/promises.ts",
},
NodeModulePolyfill {
name: "tls",
specifier: "internal:deno_node/polyfills/tls.ts",
specifier: "internal:deno_node/tls.ts",
},
NodeModulePolyfill {
name: "tty",
specifier: "internal:deno_node/polyfills/tty.ts",
specifier: "internal:deno_node/tty.ts",
},
NodeModulePolyfill {
name: "url",
specifier: "internal:deno_node/polyfills/url.ts",
specifier: "internal:deno_node/url.ts",
},
NodeModulePolyfill {
name: "util",
specifier: "internal:deno_node/polyfills/util.ts",
specifier: "internal:deno_node/util.ts",
},
NodeModulePolyfill {
name: "util/types",
specifier: "internal:deno_node/polyfills/util/types.ts",
specifier: "internal:deno_node/util/types.ts",
},
NodeModulePolyfill {
name: "v8",
specifier: "internal:deno_node/polyfills/v8.ts",
specifier: "internal:deno_node/v8.ts",
},
NodeModulePolyfill {
name: "vm",
specifier: "internal:deno_node/polyfills/vm.ts",
specifier: "internal:deno_node/vm.ts",
},
NodeModulePolyfill {
name: "worker_threads",
specifier: "internal:deno_node/polyfills/worker_threads.ts",
specifier: "internal:deno_node/worker_threads.ts",
},
NodeModulePolyfill {
name: "zlib",
specifier: "internal:deno_node/polyfills/zlib.ts",
specifier: "internal:deno_node/zlib.ts",
},
];

View file

@ -24,21 +24,21 @@
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 {
AbortError,
// kEnhanceStackBeforeInspector,
ERR_INVALID_ARG_TYPE,
ERR_OUT_OF_RANGE,
ERR_UNHANDLED_ERROR,
} from "internal:deno_node/polyfills/internal/errors.ts";
} from "internal:deno_node/internal/errors.ts";
import {
validateAbortSignal,
validateBoolean,
validateFunction,
} from "internal:deno_node/polyfills/internal/validators.mjs";
import { spliceOne } from "internal:deno_node/polyfills/_utils.ts";
} from "internal:deno_node/internal/validators.mjs";
import { spliceOne } from "internal:deno_node/_utils.ts";
const kCapture = Symbol("kCapture");
const kErrorMonitor = Symbol("events.errorMonitor");

View file

@ -3,15 +3,15 @@
import {
type CallbackWithError,
makeCallback,
} from "internal:deno_node/polyfills/_fs/_fs_common.ts";
import { fs } from "internal:deno_node/polyfills/internal_binding/constants.ts";
import { codeMap } from "internal:deno_node/polyfills/internal_binding/uv.ts";
} from "internal:deno_node/_fs/_fs_common.ts";
import { fs } from "internal:deno_node/internal_binding/constants.ts";
import { codeMap } from "internal:deno_node/internal_binding/uv.ts";
import {
getValidatedPath,
getValidMode,
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
import type { Buffer } from "internal:deno_node/polyfills/buffer.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
} from "internal:deno_node/internal/fs/utils.mjs";
import type { Buffer } from "internal:deno_node/buffer.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
export function access(
path: string | Buffer | URL,

View file

@ -4,17 +4,17 @@ import {
isFd,
maybeCallback,
WriteFileOptions,
} from "internal:deno_node/polyfills/_fs/_fs_common.ts";
import { Encodings } from "internal:deno_node/polyfills/_utils.ts";
} from "internal:deno_node/_fs/_fs_common.ts";
import { Encodings } from "internal:deno_node/_utils.ts";
import {
copyObject,
getOptions,
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
} from "internal:deno_node/internal/fs/utils.mjs";
import {
writeFile,
writeFileSync,
} from "internal:deno_node/polyfills/_fs/_fs_writeFile.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
} from "internal:deno_node/_fs/_fs_writeFile.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
/**
* TODO: Also accept 'data' parameter as a Node polyfill Buffer type once these

View file

@ -1,10 +1,10 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import type { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
import { getValidatedPath } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
import * as pathModule from "internal:deno_node/polyfills/path.ts";
import { parseFileMode } from "internal:deno_node/polyfills/internal/validators.mjs";
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
import { getValidatedPath } from "internal:deno_node/internal/fs/utils.mjs";
import * as pathModule from "internal:deno_node/path.ts";
import { parseFileMode } from "internal:deno_node/internal/validators.mjs";
import { Buffer } from "internal:deno_node/buffer.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
export function chmod(
path: string | Buffer | URL,

View file

@ -2,15 +2,15 @@
import {
type CallbackWithError,
makeCallback,
} from "internal:deno_node/polyfills/_fs/_fs_common.ts";
} from "internal:deno_node/_fs/_fs_common.ts";
import {
getValidatedPath,
kMaxUserId,
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
import * as pathModule from "internal:deno_node/polyfills/path.ts";
import { validateInteger } from "internal:deno_node/polyfills/internal/validators.mjs";
import type { Buffer } from "internal:deno_node/polyfills/buffer.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
} from "internal:deno_node/internal/fs/utils.mjs";
import * as pathModule from "internal:deno_node/path.ts";
import { validateInteger } from "internal:deno_node/internal/validators.mjs";
import type { Buffer } from "internal:deno_node/buffer.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
/**
* Asynchronously changes the owner and group

View file

@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import type { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
import { getValidatedFd } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
import { getValidatedFd } from "internal:deno_node/internal/fs/utils.mjs";
export function close(fd: number, callback: CallbackWithError) {
fd = getValidatedFd(fd);

View file

@ -7,15 +7,15 @@ import {
O_RDWR,
O_TRUNC,
O_WRONLY,
} from "internal:deno_node/polyfills/_fs/_fs_constants.ts";
import { validateFunction } from "internal:deno_node/polyfills/internal/validators.mjs";
import type { ErrnoException } from "internal:deno_node/polyfills/_global.d.ts";
} from "internal:deno_node/_fs/_fs_constants.ts";
import { validateFunction } from "internal:deno_node/internal/validators.mjs";
import type { ErrnoException } from "internal:deno_node/_global.d.ts";
import {
BinaryEncodings,
Encodings,
notImplemented,
TextEncodings,
} from "internal:deno_node/polyfills/_utils.ts";
} from "internal:deno_node/_utils.ts";
export type CallbackWithError = (err: ErrnoException | null) => void;
@ -212,7 +212,7 @@ export function getOpenOptions(
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) {
validateFunction(cb, "cb");

View file

@ -1,6 +1,6 @@
// 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 {
F_OK,

View file

@ -1,14 +1,14 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import type { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
import { makeCallback } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
import { makeCallback } from "internal:deno_node/_fs/_fs_common.ts";
import { Buffer } from "internal:deno_node/buffer.ts";
import {
getValidatedPath,
getValidMode,
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
import { fs } from "internal:deno_node/polyfills/internal_binding/constants.ts";
import { codeMap } from "internal:deno_node/polyfills/internal_binding/uv.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
} from "internal:deno_node/internal/fs/utils.mjs";
import { fs } from "internal:deno_node/internal_binding/constants.ts";
import { codeMap } from "internal:deno_node/internal_binding/uv.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
export function copyFile(
src: string | Buffer | URL,

View file

@ -1,7 +1,7 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import Dirent from "internal:deno_node/polyfills/_fs/_fs_dirent.ts";
import { assert } from "internal:deno_node/polyfills/_util/asserts.ts";
import { ERR_MISSING_ARGS } from "internal:deno_node/polyfills/internal/errors.ts";
import Dirent from "internal:deno_node/_fs/_fs_dirent.ts";
import { assert } from "internal:deno_node/_util/asserts.ts";
import { ERR_MISSING_ARGS } from "internal:deno_node/internal/errors.ts";
import { TextDecoder } from "internal:deno_web/08_text_encoding.js";
export default class Dir {

View file

@ -1,5 +1,5 @@
// 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 {
constructor(private entry: Deno.DirEntry) {}

View file

@ -1,5 +1,5 @@
// 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;

View file

@ -1,5 +1,5 @@
// 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(
fd: number,

View file

@ -6,7 +6,7 @@ import {
statCallbackBigInt,
statOptions,
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(

View file

@ -1,5 +1,5 @@
// 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(
fd: number,

View file

@ -1,5 +1,5 @@
// 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(
fd: number,

View file

@ -1,6 +1,6 @@
// 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(
time: number | string | Date,

View file

@ -1,7 +1,7 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import type { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
import { fromFileUrl } from "internal:deno_node/polyfills/path.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
import { fromFileUrl } from "internal:deno_node/path.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
/**
* TODO: Also accept 'path' parameter as a Node polyfill Buffer type once these

View file

@ -6,8 +6,8 @@ import {
statCallbackBigInt,
statOptions,
Stats,
} from "internal:deno_node/polyfills/_fs/_fs_stat.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
} from "internal:deno_node/_fs/_fs_stat.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
export function lstat(path: string | URL, callback: statCallback): void;
export function lstat(

View file

@ -1,9 +1,9 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import type { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
import { denoErrorToNodeError } from "internal:deno_node/polyfills/internal/errors.ts";
import { getValidatedPath } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
import { validateBoolean } from "internal:deno_node/polyfills/internal/validators.mjs";
import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
import { denoErrorToNodeError } from "internal:deno_node/internal/errors.ts";
import { getValidatedPath } from "internal:deno_node/internal/fs/utils.mjs";
import { validateBoolean } from "internal:deno_node/internal/validators.mjs";
/**
* TODO: Also accept 'path' parameter as a Node polyfill Buffer type once these

View file

@ -5,16 +5,13 @@ import {
TextDecoder,
TextEncoder,
} from "internal:deno_web/08_text_encoding.js";
import { existsSync } from "internal:deno_node/polyfills/_fs/_fs_exists.ts";
import {
mkdir,
mkdirSync,
} from "internal:deno_node/polyfills/_fs/_fs_mkdir.ts";
import { existsSync } from "internal:deno_node/_fs/_fs_exists.ts";
import { mkdir, mkdirSync } from "internal:deno_node/_fs/_fs_mkdir.ts";
import {
ERR_INVALID_ARG_TYPE,
ERR_INVALID_OPT_VALUE_ENCODING,
} from "internal:deno_node/polyfills/internal/errors.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
} from "internal:deno_node/internal/errors.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
export type mkdtempCallback = (
err: Error | null,

View file

@ -6,13 +6,13 @@ import {
O_RDWR,
O_TRUNC,
O_WRONLY,
} from "internal:deno_node/polyfills/_fs/_fs_constants.ts";
import { getOpenOptions } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
import { parseFileMode } from "internal:deno_node/polyfills/internal/validators.mjs";
import { ERR_INVALID_ARG_TYPE } from "internal:deno_node/polyfills/internal/errors.ts";
import { getValidatedPath } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
import type { Buffer } from "internal:deno_node/polyfills/buffer.ts";
} from "internal:deno_node/_fs/_fs_constants.ts";
import { getOpenOptions } from "internal:deno_node/_fs/_fs_common.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
import { parseFileMode } from "internal:deno_node/internal/validators.mjs";
import { ERR_INVALID_ARG_TYPE } from "internal:deno_node/internal/errors.ts";
import { getValidatedPath } from "internal:deno_node/internal/fs/utils.mjs";
import type { Buffer } from "internal:deno_node/buffer.ts";
function existsSync(filePath: string | URL): boolean {
try {

View file

@ -1,17 +1,17 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import Dir from "internal:deno_node/polyfills/_fs/_fs_dir.ts";
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
import Dir from "internal:deno_node/_fs/_fs_dir.ts";
import { Buffer } from "internal:deno_node/buffer.ts";
import {
getOptions,
getValidatedPath,
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
import { denoErrorToNodeError } from "internal:deno_node/polyfills/internal/errors.ts";
} from "internal:deno_node/internal/fs/utils.mjs";
import { denoErrorToNodeError } from "internal:deno_node/internal/errors.ts";
import {
validateFunction,
validateInteger,
} from "internal:deno_node/polyfills/internal/validators.mjs";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
} from "internal:deno_node/internal/validators.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.
* However, these values are still validated.

View file

@ -1,14 +1,14 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
import { ERR_INVALID_ARG_TYPE } from "internal:deno_node/polyfills/internal/errors.ts";
import { Buffer } from "internal:deno_node/buffer.ts";
import { ERR_INVALID_ARG_TYPE } from "internal:deno_node/internal/errors.ts";
import {
validateOffsetLengthRead,
validatePosition,
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
} from "internal:deno_node/internal/fs/utils.mjs";
import {
validateBuffer,
validateInteger,
} from "internal:deno_node/polyfills/internal/validators.mjs";
} from "internal:deno_node/internal/validators.mjs";
type readOptions = {
buffer: Buffer | Uint8Array;

View file

@ -4,15 +4,15 @@ import {
FileOptionsArgument,
getEncoding,
TextOptionsArgument,
} from "internal:deno_node/polyfills/_fs/_fs_common.ts";
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
import { fromFileUrl } from "internal:deno_node/polyfills/path.ts";
} from "internal:deno_node/_fs/_fs_common.ts";
import { Buffer } from "internal:deno_node/buffer.ts";
import { fromFileUrl } from "internal:deno_node/path.ts";
import {
BinaryEncodings,
Encodings,
TextEncodings,
} from "internal:deno_node/polyfills/_utils.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
} from "internal:deno_node/_utils.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
function maybeDecode(data: Uint8Array, encoding: TextEncodings): string;
function maybeDecode(

View file

@ -4,12 +4,12 @@ import {
TextDecoder,
TextEncoder,
} from "internal:deno_web/08_text_encoding.js";
import { asyncIterableToCallback } from "internal:deno_node/polyfills/_fs/_fs_watch.ts";
import Dirent from "internal:deno_node/polyfills/_fs/_fs_dirent.ts";
import { denoErrorToNodeError } from "internal:deno_node/polyfills/internal/errors.ts";
import { getValidatedPath } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
import { asyncIterableToCallback } from "internal:deno_node/_fs/_fs_watch.ts";
import Dirent from "internal:deno_node/_fs/_fs_dirent.ts";
import { denoErrorToNodeError } from "internal:deno_node/internal/errors.ts";
import { getValidatedPath } from "internal:deno_node/internal/fs/utils.mjs";
import { Buffer } from "internal:deno_node/buffer.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
function toDirent(val: Deno.DirEntry): Dirent {
return new Dirent(val);

View file

@ -5,9 +5,9 @@ import {
intoCallbackAPIWithIntercept,
MaybeEmpty,
notImplemented,
} from "internal:deno_node/polyfills/_utils.ts";
import { fromFileUrl } from "internal:deno_node/polyfills/path.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
} from "internal:deno_node/_utils.ts";
import { fromFileUrl } from "internal:deno_node/path.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
type ReadlinkCallback = (
err: MaybeEmpty<Error>,

View file

@ -1,5 +1,5 @@
// 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 Callback = (err: Error | null, path?: string) => void;

View file

@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { fromFileUrl } from "internal:deno_node/polyfills/path.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
import { fromFileUrl } from "internal:deno_node/path.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
export function rename(
oldPath: string | URL,

View file

@ -2,9 +2,9 @@
import {
validateRmOptions,
validateRmOptionsSync,
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
import { denoErrorToNodeError } from "internal:deno_node/polyfills/internal/errors.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
} from "internal:deno_node/internal/fs/utils.mjs";
import { denoErrorToNodeError } from "internal:deno_node/internal/errors.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
type rmOptions = {
force?: boolean;

View file

@ -5,14 +5,14 @@ import {
validateRmdirOptions,
validateRmOptions,
validateRmOptionsSync,
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
import { toNamespacedPath } from "internal:deno_node/polyfills/path.ts";
} from "internal:deno_node/internal/fs/utils.mjs";
import { toNamespacedPath } from "internal:deno_node/path.ts";
import {
denoErrorToNodeError,
ERR_FS_RMDIR_ENOTDIR,
} from "internal:deno_node/polyfills/internal/errors.ts";
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
} from "internal:deno_node/internal/errors.ts";
import { Buffer } from "internal:deno_node/buffer.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
type rmdirOptions = {
maxRetries?: number;

View file

@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { denoErrorToNodeError } from "internal:deno_node/polyfills/internal/errors.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
import { denoErrorToNodeError } from "internal:deno_node/internal/errors.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
export type statOptions = {
bigint: boolean;

View file

@ -1,7 +1,7 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
import { fromFileUrl } from "internal:deno_node/polyfills/path.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
import { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
import { fromFileUrl } from "internal:deno_node/path.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
type SymlinkType = "file" | "dir";

View file

@ -1,7 +1,7 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
import { fromFileUrl } from "internal:deno_node/polyfills/path.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
import { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
import { fromFileUrl } from "internal:deno_node/path.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
export function truncate(
path: string | URL,

View file

@ -1,5 +1,5 @@
// 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) {
if (!callback) throw new Error("No callback function supplied");

View file

@ -1,8 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import type { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
import { fromFileUrl } from "internal:deno_node/polyfills/path.ts";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
import { fromFileUrl } from "internal:deno_node/path.ts";
import { promisify } from "internal:deno_node/internal/util.mjs";
function getValidTime(
time: number | string | Date,

View file

@ -1,14 +1,14 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { basename } from "internal:deno_node/polyfills/path.ts";
import { EventEmitter } from "internal:deno_node/polyfills/events.ts";
import { notImplemented } from "internal:deno_node/polyfills/_utils.ts";
import { promisify } from "internal:deno_node/polyfills/util.ts";
import { getValidatedPath } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
import { validateFunction } from "internal:deno_node/polyfills/internal/validators.mjs";
import { stat, Stats } from "internal:deno_node/polyfills/_fs/_fs_stat.ts";
import { Stats as StatsClass } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
import { delay } from "internal:deno_node/polyfills/_util/async.ts";
import { basename } from "internal:deno_node/path.ts";
import { EventEmitter } from "internal:deno_node/events.ts";
import { notImplemented } from "internal:deno_node/_utils.ts";
import { promisify } from "internal:deno_node/util.ts";
import { getValidatedPath } from "internal:deno_node/internal/fs/utils.mjs";
import { validateFunction } from "internal:deno_node/internal/validators.mjs";
import { stat, Stats } from "internal:deno_node/_fs/_fs_stat.ts";
import { Stats as StatsClass } from "internal:deno_node/internal/fs/utils.mjs";
import { Buffer } from "internal:deno_node/buffer.ts";
import { delay } from "internal:deno_node/_util/async.ts";
const statPromisified = promisify(stat);
const statAsync = async (filename: string): Promise<Stats | null> => {

View file

@ -4,7 +4,7 @@
import {
BufferEncoding,
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

View file

@ -1,15 +1,15 @@
// Copyright 2018-2023 the Deno authors. 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 { validateEncoding, validateInteger } from "internal:deno_node/polyfills/internal/validators.mjs";
import { Buffer } from "internal:deno_node/buffer.ts";
import { validateEncoding, validateInteger } from "internal:deno_node/internal/validators.mjs";
import {
getValidatedFd,
showStringCoercionDeprecation,
validateOffsetLengthWrite,
validateStringAfterArrayBufferView,
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
import { isArrayBufferView } from "internal:deno_node/polyfills/internal/util/types.ts";
import { maybeCallback } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
} from "internal:deno_node/internal/fs/utils.mjs";
import { isArrayBufferView } from "internal:deno_node/internal/util/types.ts";
import { maybeCallback } from "internal:deno_node/_fs/_fs_common.ts";
export function writeSync(fd, buffer, offset, length, position) {
fd = getValidatedFd(fd);

View file

@ -1,7 +1,7 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { Encodings } from "internal:deno_node/polyfills/_utils.ts";
import { fromFileUrl } from "internal:deno_node/polyfills/path.ts";
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
import { Encodings } from "internal:deno_node/_utils.ts";
import { fromFileUrl } from "internal:deno_node/path.ts";
import { Buffer } from "internal:deno_node/buffer.ts";
import {
CallbackWithError,
checkEncoding,
@ -9,17 +9,17 @@ import {
getOpenOptions,
isFileOptions,
WriteFileOptions,
} from "internal:deno_node/polyfills/_fs/_fs_common.ts";
import { isWindows } from "internal:deno_node/polyfills/_util/os.ts";
} from "internal:deno_node/_fs/_fs_common.ts";
import { isWindows } from "internal:deno_node/_util/os.ts";
import {
AbortError,
denoErrorToNodeError,
} from "internal:deno_node/polyfills/internal/errors.ts";
} from "internal:deno_node/internal/errors.ts";
import {
showStringCoercionDeprecation,
validateStringAfterArrayBufferView,
} from "internal:deno_node/polyfills/internal/fs/utils.mjs";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
} from "internal:deno_node/internal/fs/utils.mjs";
import { promisify } from "internal:deno_node/internal/util.mjs";
interface Writer {
write(p: Uint8Array): Promise<number>;

View file

@ -1,7 +1,7 @@
// 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
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()`.

View file

@ -1,9 +1,9 @@
// Copyright 2018-2023 the Deno authors. 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 { validateBufferArray } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
import { getValidatedFd } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
import { maybeCallback } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
import { Buffer } from "internal:deno_node/buffer.ts";
import { validateBufferArray } from "internal:deno_node/internal/fs/utils.mjs";
import { getValidatedFd } from "internal:deno_node/internal/fs/utils.mjs";
import { maybeCallback } from "internal:deno_node/_fs/_fs_common.ts";
export function writev(fd, buffers, position, callback) {
const innerWritev = async (fd, buffers, position) => {

View file

@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { EventEmitter } from "internal:deno_node/polyfills/_events.d.ts";
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
import { EventEmitter } from "internal:deno_node/_events.d.ts";
import { Buffer } from "internal:deno_node/buffer.ts";
/** One of:
* | "ascii"

View file

@ -1,23 +1,23 @@
// Copyright 2018-2023 the Deno authors. 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 EventEmitter from "internal:deno_node/polyfills/events.ts";
import { debuglog } from "internal:deno_node/polyfills/internal/util/debuglog.ts";
import * as net from "internal:deno_node/net.ts";
import EventEmitter from "internal:deno_node/events.ts";
import { debuglog } from "internal:deno_node/internal/util/debuglog.ts";
let debug = debuglog("http", (fn) => {
debug = fn;
});
import { AsyncResource } from "internal:deno_node/polyfills/async_hooks.ts";
import { symbols } from "internal:deno_node/polyfills/internal/async_hooks.ts";
import { AsyncResource } from "internal:deno_node/async_hooks.ts";
import { symbols } from "internal:deno_node/internal/async_hooks.ts";
// deno-lint-ignore camelcase
const { async_id_symbol } = symbols;
import { ERR_OUT_OF_RANGE } from "internal:deno_node/polyfills/internal/errors.ts";
import { once } from "internal:deno_node/polyfills/internal/util.mjs";
import { ERR_OUT_OF_RANGE } from "internal:deno_node/internal/errors.ts";
import { once } from "internal:deno_node/internal/util.mjs";
import {
validateNumber,
validateOneOf,
validateString,
} from "internal:deno_node/polyfills/internal/validators.mjs";
} from "internal:deno_node/internal/validators.mjs";
const kOnKeylog = Symbol("onkeylog");
const kRequestOptions = Symbol("requestOptions");

View file

@ -1,27 +1,27 @@
// Copyright 2018-2023 the Deno authors. 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 assert from "internal:deno_node/polyfills/internal/assert.mjs";
import EE from "internal:deno_node/polyfills/events.ts";
import { Stream } from "internal:deno_node/polyfills/stream.ts";
import { deprecate } from "internal:deno_node/polyfills/util.ts";
import type { Socket } from "internal:deno_node/polyfills/net.ts";
import { getDefaultHighWaterMark } from "internal:deno_node/internal/streams/state.mjs";
import assert from "internal:deno_node/internal/assert.mjs";
import EE from "internal:deno_node/events.ts";
import { Stream } from "internal:deno_node/stream.ts";
import { deprecate } from "internal:deno_node/util.ts";
import type { Socket } from "internal:deno_node/net.ts";
import {
kNeedDrain,
kOutHeaders,
utcDate,
} from "internal:deno_node/polyfills/internal/http.ts";
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
} from "internal:deno_node/internal/http.ts";
import { Buffer } from "internal:deno_node/buffer.ts";
import {
_checkInvalidHeaderChar as checkInvalidHeaderChar,
_checkIsHttpToken as checkIsHttpToken,
chunkExpression as RE_TE_CHUNKED,
} from "internal:deno_node/polyfills/_http_common.ts";
} from "internal:deno_node/_http_common.ts";
import {
defaultTriggerAsyncIdScope,
symbols,
} from "internal:deno_node/polyfills/internal/async_hooks.ts";
} from "internal:deno_node/internal/async_hooks.ts";
// deno-lint-ignore camelcase
const { async_id_symbol } = symbols;
import {
@ -39,11 +39,11 @@ import {
ERR_STREAM_NULL_VALUES,
ERR_STREAM_WRITE_AFTER_END,
hideStackFrames,
} from "internal:deno_node/polyfills/internal/errors.ts";
import { validateString } from "internal:deno_node/polyfills/internal/validators.mjs";
import { isUint8Array } from "internal:deno_node/polyfills/internal/util/types.ts";
} from "internal:deno_node/internal/errors.ts";
import { validateString } from "internal:deno_node/internal/validators.mjs";
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) => {
debug = fn;
});

View file

@ -1,10 +1,10 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// Copyright Joyent, Inc. and other Node contributors.
import { core } from "internal:deno_node/polyfills/_core.ts";
import { validateFunction } from "internal:deno_node/polyfills/internal/validators.mjs";
import { _exiting } from "internal:deno_node/polyfills/_process/exiting.ts";
import { FixedQueue } from "internal:deno_node/polyfills/internal/fixed_queue.ts";
import { core } from "internal:deno_node/_core.ts";
import { validateFunction } from "internal:deno_node/internal/validators.mjs";
import { _exiting } from "internal:deno_node/_process/exiting.ts";
import { FixedQueue } from "internal:deno_node/internal/fixed_queue.ts";
interface Tock {
callback: (...args: Array<unknown>) => void;

View file

@ -418,7 +418,7 @@ const gen_bitlen = (s, desc) => // deflate_state *s;
/* Now recompute all bit lengths, scanning in increasing frequency.
* 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
* 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--) {
n = s.bl_count[bits];

View file

@ -4,10 +4,10 @@
// 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
import { build } from "internal:runtime/js/01_build.js";
import { nextTick as _nextTick } from "internal:deno_node/polyfills/_next_tick.ts";
import { _exiting } from "internal:deno_node/polyfills/_process/exiting.ts";
import * as fs from "internal:runtime/js/30_fs.js";
import { build } from "internal:runtime/01_build.js";
import { nextTick as _nextTick } from "internal:deno_node/_next_tick.ts";
import { _exiting } from "internal:deno_node/_process/exiting.ts";
import * as fs from "internal:runtime/30_fs.js";
/** Returns the operating system CPU architecture for which the Deno binary was compiled */
export function arch(): string {

View file

@ -1,17 +1,17 @@
// Copyright 2018-2023 the Deno authors. 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 {
clearLine,
clearScreenDown,
cursorTo,
moveCursor,
} from "internal:deno_node/polyfills/internal/readline/callbacks.mjs";
import { Duplex, Readable, Writable } from "internal:deno_node/polyfills/stream.ts";
import { isWindows } from "internal:deno_node/polyfills/_util/os.ts";
import { fs as fsConstants } from "internal:deno_node/polyfills/internal_binding/constants.ts";
import * as files from "internal:runtime/js/40_files.js";
} from "internal:deno_node/internal/readline/callbacks.mjs";
import { Duplex, Readable, Writable } from "internal:deno_node/stream.ts";
import { isWindows } from "internal:deno_node/_util/os.ts";
import { fs as fsConstants } from "internal:deno_node/internal_binding/constants.ts";
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
export function createWritableStdioStream(writer, name) {

View file

@ -3,22 +3,19 @@
// Forked from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/cd61f5b4d3d143108569ec3f88adc0eb34b961c4/types/node/readline.d.ts
import {
Abortable,
EventEmitter,
} from "internal:deno_node/polyfills/_events.d.ts";
import * as promises from "internal:deno_node/polyfills/readline/promises.ts";
import { Abortable, EventEmitter } from "internal:deno_node/_events.d.ts";
import * as promises from "internal:deno_node/readline/promises.ts";
import {
ReadableStream,
WritableStream,
} from "internal:deno_node/polyfills/_global.d.ts";
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
} from "internal:deno_node/_global.d.ts";
import { Buffer } from "internal:deno_node/buffer.ts";
import type {
AsyncCompleter,
Completer,
CompleterResult,
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.

View file

@ -27,13 +27,13 @@ import {
clearScreenDown,
cursorTo,
moveCursor,
} from "internal:deno_node/polyfills/internal/readline/callbacks.mjs";
import { emitKeypressEvents } from "internal:deno_node/polyfills/internal/readline/emitKeypressEvents.mjs";
import promises from "internal:deno_node/polyfills/readline/promises.ts";
import { validateAbortSignal } from "internal:deno_node/polyfills/internal/validators.mjs";
import { promisify } from "internal:deno_node/polyfills/internal/util.mjs";
import { AbortError } from "internal:deno_node/polyfills/internal/errors.ts";
import process from "internal:deno_node/polyfills/process.ts";
} from "internal:deno_node/internal/readline/callbacks.mjs";
import { emitKeypressEvents } from "internal:deno_node/internal/readline/emitKeypressEvents.mjs";
import promises from "internal:deno_node/readline/promises.ts";
import { validateAbortSignal } from "internal:deno_node/internal/validators.mjs";
import { promisify } from "internal:deno_node/internal/util.mjs";
import { AbortError } from "internal:deno_node/internal/errors.ts";
import process from "internal:deno_node/process.ts";
import {
Interface as _Interface,
@ -71,7 +71,7 @@ import {
kWordLeft,
kWordRight,
kWriteToOutput,
} from "internal:deno_node/polyfills/internal/readline/interface.mjs";
} from "internal:deno_node/internal/readline/interface.mjs";
function Interface(input, output, completer, terminal) {
if (!(this instanceof Interface)) {

View file

@ -7,7 +7,7 @@
import type {
ReadableStream,
WritableStream,
} from "internal:deno_node/polyfills/_global.d.ts";
} from "internal:deno_node/_global.d.ts";
export type Completer = (line: string) => CompleterResult;
export type AsyncCompleter = (

View file

@ -3,11 +3,8 @@
// Forked from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/4f538975138678878fed5b2555c0672aa578ab7d/types/node/stream.d.ts
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
import {
Abortable,
EventEmitter,
} from "internal:deno_node/polyfills/_events.d.ts";
import { Buffer } from "internal:deno_node/buffer.ts";
import { Abortable, EventEmitter } from "internal:deno_node/_events.d.ts";
import {
Buffered,
BufferEncoding,
@ -15,7 +12,7 @@ import {
ReadableStream,
ReadWriteStream,
WritableStream,
} from "internal:deno_node/polyfills/_global.d.ts";
} from "internal:deno_node/_global.d.ts";
export class Stream extends EventEmitter {
pipe<T extends WritableStream>(

File diff suppressed because one or more lines are too long

View file

@ -5,25 +5,25 @@
import {
ObjectAssign,
StringPrototypeReplace,
} from "internal:deno_node/polyfills/internal/primordials.mjs";
import assert from "internal:deno_node/polyfills/internal/assert.mjs";
import * as net from "internal:deno_node/polyfills/net.ts";
import { createSecureContext } from "internal:deno_node/polyfills/_tls_common.ts";
import { kStreamBaseField } from "internal:deno_node/polyfills/internal_binding/stream_wrap.ts";
import { connResetException } from "internal:deno_node/polyfills/internal/errors.ts";
import { emitWarning } from "internal:deno_node/polyfills/process.ts";
import { debuglog } from "internal:deno_node/polyfills/internal/util/debuglog.ts";
} from "internal:deno_node/internal/primordials.mjs";
import assert from "internal:deno_node/internal/assert.mjs";
import * as net from "internal:deno_node/net.ts";
import { createSecureContext } from "internal:deno_node/_tls_common.ts";
import { kStreamBaseField } from "internal:deno_node/internal_binding/stream_wrap.ts";
import { connResetException } from "internal:deno_node/internal/errors.ts";
import { emitWarning } from "internal:deno_node/process.ts";
import { debuglog } from "internal:deno_node/internal/util/debuglog.ts";
import {
constants as TCPConstants,
TCP,
} from "internal:deno_node/polyfills/internal_binding/tcp_wrap.ts";
} from "internal:deno_node/internal_binding/tcp_wrap.ts";
import {
constants as PipeConstants,
Pipe,
} from "internal:deno_node/polyfills/internal_binding/pipe_wrap.ts";
import { EventEmitter } from "internal:deno_node/polyfills/events.ts";
import { kEmptyObject } from "internal:deno_node/polyfills/internal/util.mjs";
import { nextTick } from "internal:deno_node/polyfills/_next_tick.ts";
} from "internal:deno_node/internal_binding/pipe_wrap.ts";
import { EventEmitter } from "internal:deno_node/events.ts";
import { kEmptyObject } from "internal:deno_node/internal/util.mjs";
import { nextTick } from "internal:deno_node/_next_tick.ts";
const kConnectOptions = Symbol("connect-options");
const kIsVerified = Symbol("verified");

View file

@ -23,7 +23,7 @@
// 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 {
public reason: unknown;

View file

@ -1,12 +1,12 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// 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 {
buildMessage,
diff,
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
* make tests less flaky */

View file

@ -9,7 +9,7 @@ import {
green,
red,
white,
} from "internal:deno_node/polyfills/_util/std_fmt_colors.ts";
} from "internal:deno_node/_util/std_fmt_colors.ts";
interface FarthestPoint {
y: number;

View file

@ -4,8 +4,8 @@ import {
TextDecoder,
TextEncoder,
} from "internal:deno_web/08_text_encoding.js";
import { errorMap } from "internal:deno_node/polyfills/internal_binding/uv.ts";
import { codes } from "internal:deno_node/polyfills/internal/error_codes.ts";
import { errorMap } from "internal:deno_node/internal_binding/uv.ts";
import { codes } from "internal:deno_node/internal/error_codes.ts";
export type BinaryEncodings = "binary";

View file

@ -4,13 +4,13 @@
// deno-lint-ignore-file
import { Buffer, kMaxLength } from "internal:deno_node/polyfills/buffer.ts";
import { Transform } from "internal:deno_node/polyfills/stream.ts";
import * as binding from "internal:deno_node/polyfills/_zlib_binding.mjs";
import util from "internal:deno_node/polyfills/util.ts";
import { ok as assert } from "internal:deno_node/polyfills/assert.ts";
import { zlib as zlibConstants } from "internal:deno_node/polyfills/internal_binding/constants.ts";
import { nextTick } from "internal:deno_node/polyfills/_next_tick.ts";
import { Buffer, kMaxLength } from "internal:deno_node/buffer.ts";
import { Transform } from "internal:deno_node/stream.ts";
import * as binding from "internal:deno_node/_zlib_binding.mjs";
import util from "internal:deno_node/util.ts";
import { ok as assert } from "internal:deno_node/assert.ts";
import { zlib as zlibConstants } from "internal:deno_node/internal_binding/constants.ts";
import { nextTick } from "internal:deno_node/_next_tick.ts";
var kRangeErrorMessage = "Cannot create final Buffer. It would be larger " +
"than 0x" + kMaxLength.toString(16) + " bytes";

View file

@ -4,9 +4,9 @@
// deno-lint-ignore-file
import assert from "internal:deno_node/polyfills/assert.ts";
import { constants, zlib_deflate, zlib_inflate, Zstream } from "internal:deno_node/polyfills/_pako.mjs";
import { nextTick } from "internal:deno_node/polyfills/_next_tick.ts";
import assert from "internal:deno_node/assert.ts";
import { constants, zlib_deflate, zlib_inflate, Zstream } from "internal:deno_node/_pako.mjs";
import { nextTick } from "internal:deno_node/_next_tick.ts";
export const Z_NO_FLUSH = constants.Z_NO_FLUSH;
export const Z_PARTIAL_FLUSH = constants.Z_PARTIAL_FLUSH;

View file

@ -3,17 +3,17 @@
import {
AssertionError,
AssertionErrorConstructorOptions,
} from "internal:deno_node/polyfills/assertion_error.ts";
import * as asserts from "internal:deno_node/polyfills/_util/std_asserts.ts";
import { inspect } from "internal:deno_node/polyfills/util.ts";
} from "internal:deno_node/assertion_error.ts";
import * as asserts from "internal:deno_node/_util/std_asserts.ts";
import { inspect } from "internal:deno_node/util.ts";
import {
ERR_AMBIGUOUS_ARGUMENT,
ERR_INVALID_ARG_TYPE,
ERR_INVALID_ARG_VALUE,
ERR_INVALID_RETURN_VALUE,
ERR_MISSING_ARGS,
} from "internal:deno_node/polyfills/internal/errors.ts";
import { isDeepEqual } from "internal:deno_node/polyfills/internal/util/comparisons.ts";
} from "internal:deno_node/internal/errors.ts";
import { isDeepEqual } from "internal:deno_node/internal/util/comparisons.ts";
function innerFail(obj: {
actual?: unknown;

View file

@ -1,5 +1,5 @@
// 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 {
AssertionError,
@ -20,7 +20,7 @@ export {
rejects,
strictEqual,
throws,
} from "internal:deno_node/polyfills/assert.ts";
} from "internal:deno_node/assert.ts";
export { strict };
export default strict;

View file

@ -21,8 +21,8 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
import { inspect } from "internal:deno_node/polyfills/util.ts";
import { stripColor as removeColors } from "internal:deno_node/polyfills/_util/std_fmt_colors.ts";
import { inspect } from "internal:deno_node/util.ts";
import { stripColor as removeColors } from "internal:deno_node/_util/std_fmt_colors.ts";
function getConsoleWidth(): number {
try {
@ -44,7 +44,7 @@ const {
keys: ObjectKeys,
} = 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 green = "";

View file

@ -4,8 +4,8 @@
// This implementation is inspired by "workerd" AsyncLocalStorage implementation:
// 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 { core } from "internal:deno_node/polyfills/_core.ts";
import { validateFunction } from "internal:deno_node/internal/validators.mjs";
import { core } from "internal:deno_node/_core.ts";
function assert(cond: boolean) {
if (!cond) throw new Error("Assertion failed");

View file

@ -10,4 +10,4 @@ export {
kMaxLength,
kStringMaxLength,
SlowBuffer,
} from "internal:deno_node/polyfills/internal/buffer.mjs";
} from "internal:deno_node/internal/buffer.mjs";

View file

@ -2,7 +2,7 @@
// This module implements 'child_process' module of Node.JS API.
// 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 {
ChildProcess,
ChildProcessOptions,
@ -12,13 +12,13 @@ import {
type SpawnSyncOptions,
type SpawnSyncResult,
stdioStringToArray,
} from "internal:deno_node/polyfills/internal/child_process.ts";
} from "internal:deno_node/internal/child_process.ts";
import {
validateAbortSignal,
validateFunction,
validateObject,
validateString,
} from "internal:deno_node/polyfills/internal/validators.mjs";
} from "internal:deno_node/internal/validators.mjs";
import {
ERR_CHILD_PROCESS_IPC_REQUIRED,
ERR_CHILD_PROCESS_STDIO_MAXBUFFER,
@ -26,7 +26,7 @@ import {
ERR_INVALID_ARG_VALUE,
ERR_OUT_OF_RANGE,
genericNodeError,
} from "internal:deno_node/polyfills/internal/errors.ts";
} from "internal:deno_node/internal/errors.ts";
import {
ArrayIsArray,
ArrayPrototypeJoin,
@ -34,18 +34,15 @@ import {
ArrayPrototypeSlice,
ObjectAssign,
StringPrototypeSlice,
} from "internal:deno_node/polyfills/internal/primordials.mjs";
import {
getSystemErrorName,
promisify,
} from "internal:deno_node/polyfills/util.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";
} from "internal:deno_node/internal/primordials.mjs";
import { getSystemErrorName, promisify } from "internal:deno_node/util.ts";
import { createDeferredPromise } from "internal:deno_node/internal/util.mjs";
import process from "internal:deno_node/process.ts";
import { Buffer } from "internal:deno_node/buffer.ts";
import {
convertToValidSignal,
kEmptyObject,
} from "internal:deno_node/polyfills/internal/util.mjs";
} from "internal:deno_node/internal/util.mjs";
const MAX_BUFFER = 1024 * 1024;

View file

@ -1,7 +1,7 @@
// Copyright 2018-2023 the Deno authors. 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.
* In the primary it can be obtained using cluster.workers. In a worker it can

View file

@ -1,7 +1,7 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { Console } from "internal:deno_node/polyfills/internal/console/constructor.mjs";
import { windowOrWorkerGlobalScope } from "internal:runtime/js/98_global_scope.js";
import { Console } from "internal:deno_node/internal/console/constructor.mjs";
import { windowOrWorkerGlobalScope } from "internal:runtime/98_global_scope.js";
// Don't rely on global `console` because during bootstrapping, it is pointing
// to native `console` object provided by V8.
const console = windowOrWorkerGlobalScope.console.value;

View file

@ -2,8 +2,8 @@
// 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 osConstants } from "internal:deno_node/polyfills/os.ts";
import { constants as fsConstants } from "internal:deno_node/fs.ts";
import { constants as osConstants } from "internal:deno_node/os.ts";
export default {
...fsConstants,

View file

@ -1,14 +1,14 @@
// Copyright 2018-2023 the Deno authors. 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 { crypto as constants } from "internal:deno_node/polyfills/internal_binding/constants.ts";
import { getOptionValue } from "internal:deno_node/polyfills/internal/options.ts";
import { ERR_CRYPTO_FIPS_FORCED } from "internal:deno_node/internal/errors.ts";
import { crypto as constants } from "internal:deno_node/internal_binding/constants.ts";
import { getOptionValue } from "internal:deno_node/internal/options.ts";
import {
getFipsCrypto,
setFipsCrypto,
timingSafeEqual,
} from "internal:deno_node/polyfills/internal_binding/crypto.ts";
} from "internal:deno_node/internal_binding/crypto.ts";
import {
checkPrime,
checkPrimeSync,
@ -19,36 +19,33 @@ import {
randomFillSync,
randomInt,
randomUUID,
} from "internal:deno_node/polyfills/internal/crypto/random.ts";
} from "internal:deno_node/internal/crypto/random.ts";
import type {
CheckPrimeOptions,
GeneratePrimeOptions,
GeneratePrimeOptionsArrayBuffer,
GeneratePrimeOptionsBigInt,
LargeNumberLike,
} from "internal:deno_node/polyfills/internal/crypto/random.ts";
} from "internal:deno_node/internal/crypto/random.ts";
import {
pbkdf2,
pbkdf2Sync,
} from "internal:deno_node/polyfills/internal/crypto/pbkdf2.ts";
} from "internal:deno_node/internal/crypto/pbkdf2.ts";
import type {
Algorithms,
NormalizedAlgorithms,
} from "internal:deno_node/polyfills/internal/crypto/pbkdf2.ts";
} from "internal:deno_node/internal/crypto/pbkdf2.ts";
import {
scrypt,
scryptSync,
} from "internal:deno_node/polyfills/internal/crypto/scrypt.ts";
import {
hkdf,
hkdfSync,
} from "internal:deno_node/polyfills/internal/crypto/hkdf.ts";
} from "internal:deno_node/internal/crypto/scrypt.ts";
import { hkdf, hkdfSync } from "internal:deno_node/internal/crypto/hkdf.ts";
import {
generateKey,
generateKeyPair,
generateKeyPairSync,
generateKeySync,
} from "internal:deno_node/polyfills/internal/crypto/keygen.ts";
} from "internal:deno_node/internal/crypto/keygen.ts";
import type {
BasePrivateKeyEncodingOptions,
DSAKeyPairKeyObjectOptions,
@ -69,26 +66,26 @@ import type {
X25519KeyPairOptions,
X448KeyPairKeyObjectOptions,
X448KeyPairOptions,
} from "internal:deno_node/polyfills/internal/crypto/keygen.ts";
} from "internal:deno_node/internal/crypto/keygen.ts";
import {
createPrivateKey,
createPublicKey,
createSecretKey,
KeyObject,
} from "internal:deno_node/polyfills/internal/crypto/keys.ts";
} from "internal:deno_node/internal/crypto/keys.ts";
import type {
AsymmetricKeyDetails,
JsonWebKeyInput,
JwkKeyExportOptions,
KeyExportOptions,
KeyObjectType,
} from "internal:deno_node/polyfills/internal/crypto/keys.ts";
} from "internal:deno_node/internal/crypto/keys.ts";
import {
DiffieHellman,
diffieHellman,
DiffieHellmanGroup,
ECDH,
} from "internal:deno_node/polyfills/internal/crypto/diffiehellman.ts";
} from "internal:deno_node/internal/crypto/diffiehellman.ts";
import {
Cipheriv,
Decipheriv,
@ -97,7 +94,7 @@ import {
privateEncrypt,
publicDecrypt,
publicEncrypt,
} from "internal:deno_node/polyfills/internal/crypto/cipher.ts";
} from "internal:deno_node/internal/crypto/cipher.ts";
import type {
Cipher,
CipherCCM,
@ -114,7 +111,7 @@ import type {
DecipherCCM,
DecipherGCM,
DecipherOCB,
} from "internal:deno_node/polyfills/internal/crypto/cipher.ts";
} from "internal:deno_node/internal/crypto/cipher.ts";
import type {
BinaryLike,
BinaryToTextEncoding,
@ -127,13 +124,13 @@ import type {
LegacyCharacterEncoding,
PrivateKeyInput,
PublicKeyInput,
} from "internal:deno_node/polyfills/internal/crypto/types.ts";
} from "internal:deno_node/internal/crypto/types.ts";
import {
Sign,
signOneShot,
Verify,
verifyOneShot,
} from "internal:deno_node/polyfills/internal/crypto/sig.ts";
} from "internal:deno_node/internal/crypto/sig.ts";
import type {
DSAEncoding,
KeyLike,
@ -142,30 +139,30 @@ import type {
SignPrivateKeyInput,
VerifyKeyObjectInput,
VerifyPublicKeyInput,
} from "internal:deno_node/polyfills/internal/crypto/sig.ts";
} from "internal:deno_node/internal/crypto/sig.ts";
import {
createHash,
Hash,
Hmac,
} from "internal:deno_node/polyfills/internal/crypto/hash.ts";
import { X509Certificate } from "internal:deno_node/polyfills/internal/crypto/x509.ts";
} from "internal:deno_node/internal/crypto/hash.ts";
import { X509Certificate } from "internal:deno_node/internal/crypto/x509.ts";
import type {
PeerCertificate,
X509CheckOptions,
} from "internal:deno_node/polyfills/internal/crypto/x509.ts";
} from "internal:deno_node/internal/crypto/x509.ts";
import {
getCiphers,
getCurves,
getHashes,
secureHeapUsed,
setEngine,
} from "internal:deno_node/polyfills/internal/crypto/util.ts";
import type { SecureHeapUsage } from "internal:deno_node/polyfills/internal/crypto/util.ts";
import Certificate from "internal:deno_node/polyfills/internal/crypto/certificate.ts";
} from "internal:deno_node/internal/crypto/util.ts";
import type { SecureHeapUsage } from "internal:deno_node/internal/crypto/util.ts";
import Certificate from "internal:deno_node/internal/crypto/certificate.ts";
import type {
TransformOptions,
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";
const fipsForced = getOptionValue("--force-fips");

View file

@ -20,13 +20,13 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
import { EventEmitter } from "internal:deno_node/polyfills/events.ts";
import { lookup as defaultLookup } from "internal:deno_node/polyfills/dns.ts";
import { Buffer } from "internal:deno_node/buffer.ts";
import { EventEmitter } from "internal:deno_node/events.ts";
import { lookup as defaultLookup } from "internal:deno_node/dns.ts";
import type {
ErrnoException,
NodeSystemErrorCtx,
} from "internal:deno_node/polyfills/internal/errors.ts";
} from "internal:deno_node/internal/errors.ts";
import {
ERR_BUFFER_OUT_OF_BOUNDS,
ERR_INVALID_ARG_TYPE,
@ -40,34 +40,28 @@ import {
ERR_SOCKET_DGRAM_NOT_RUNNING,
errnoException,
exceptionWithHostPort,
} from "internal:deno_node/polyfills/internal/errors.ts";
import type { Abortable } from "internal:deno_node/polyfills/_events.d.ts";
import {
kStateSymbol,
newHandle,
} from "internal:deno_node/polyfills/internal/dgram.ts";
import type { SocketType } from "internal:deno_node/polyfills/internal/dgram.ts";
} from "internal:deno_node/internal/errors.ts";
import type { Abortable } from "internal:deno_node/_events.d.ts";
import { kStateSymbol, newHandle } from "internal:deno_node/internal/dgram.ts";
import type { SocketType } from "internal:deno_node/internal/dgram.ts";
import {
asyncIdSymbol,
defaultTriggerAsyncIdScope,
ownerSymbol,
} from "internal:deno_node/polyfills/internal/async_hooks.ts";
import {
SendWrap,
UDP,
} from "internal:deno_node/polyfills/internal_binding/udp_wrap.ts";
} from "internal:deno_node/internal/async_hooks.ts";
import { SendWrap, UDP } from "internal:deno_node/internal_binding/udp_wrap.ts";
import {
isInt32,
validateAbortSignal,
validateNumber,
validatePort,
validateString,
} from "internal:deno_node/polyfills/internal/validators.mjs";
import { guessHandleType } from "internal:deno_node/polyfills/internal_binding/util.ts";
import { os } from "internal:deno_node/polyfills/internal_binding/constants.ts";
import { nextTick } from "internal:deno_node/polyfills/process.ts";
import { channel } from "internal:deno_node/polyfills/diagnostics_channel.ts";
import { isArrayBufferView } from "internal:deno_node/polyfills/internal/util/types.ts";
} from "internal:deno_node/internal/validators.mjs";
import { guessHandleType } from "internal:deno_node/internal_binding/util.ts";
import { os } from "internal:deno_node/internal_binding/constants.ts";
import { nextTick } from "internal:deno_node/process.ts";
import { channel } from "internal:deno_node/diagnostics_channel.ts";
import { isArrayBufferView } from "internal:deno_node/internal/util/types.ts";
const { UV_UDP_REUSEADDR, UV_UDP_IPV6ONLY } = os;
@ -247,8 +241,8 @@ export class Socket extends EventEmitter {
* `EADDRINUSE` error will occur:
*
* ```js
* import cluster from "internal:deno_node/polyfills/cluster";
* import dgram from "internal:deno_node/polyfills/dgram";
* import cluster from "internal:deno_node/cluster";
* import dgram from "internal:deno_node/dgram";
*
* if (cluster.isPrimary) {
* cluster.fork(); // Works ok.
@ -349,7 +343,7 @@ export class Socket extends EventEmitter {
* Example of a UDP server listening on port 41234:
*
* ```js
* import dgram from "internal:deno_node/polyfills/dgram";
* import dgram from "internal:deno_node/dgram";
*
* 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`;
*
* ```js
* import dgram from "internal:deno_node/polyfills/dgram";
* import { Buffer } from "internal:deno_node/polyfills/buffer";
* import dgram from "internal:deno_node/dgram";
* import { Buffer } from "internal:deno_node/buffer";
*
* const message = Buffer.from('Some bytes');
* const client = dgram.createSocket('udp4');
@ -812,8 +806,8 @@ export class Socket extends EventEmitter {
* `127.0.0.1`;
*
* ```js
* import dgram from "internal:deno_node/polyfills/dgram";
* import { Buffer } from "internal:deno_node/polyfills/buffer";
* import dgram from "internal:deno_node/dgram";
* import { Buffer } from "internal:deno_node/buffer";
*
* const buf1 = Buffer.from('Some ');
* const buf2 = Buffer.from('bytes');
@ -832,8 +826,8 @@ export class Socket extends EventEmitter {
* `localhost`:
*
* ```js
* import dgram from "internal:deno_node/polyfills/dgram";
* import { Buffer } from "internal:deno_node/polyfills/buffer";
* import dgram from "internal:deno_node/dgram";
* import { Buffer } from "internal:deno_node/buffer";
*
* const message = Buffer.from('Some bytes');
* const client = dgram.createSocket('udp4');

View file

@ -1,7 +1,7 @@
// 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 { validateFunction } from "internal:deno_node/polyfills/internal/validators.mjs";
import { nextTick } from "internal:deno_node/polyfills/process.ts";
import { ERR_INVALID_ARG_TYPE } from "internal:deno_node/internal/errors.ts";
import { validateFunction } from "internal:deno_node/internal/validators.mjs";
import { nextTick } from "internal:deno_node/process.ts";
type Subscriber = (message: unknown, name?: string) => void;

View file

@ -20,16 +20,16 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
import { nextTick } from "internal:deno_node/polyfills/_next_tick.ts";
import { customPromisifyArgs } from "internal:deno_node/polyfills/internal/util.mjs";
import { nextTick } from "internal:deno_node/_next_tick.ts";
import { customPromisifyArgs } from "internal:deno_node/internal/util.mjs";
import {
validateBoolean,
validateFunction,
validateNumber,
validateOneOf,
validateString,
} from "internal:deno_node/polyfills/internal/validators.mjs";
import { isIP } from "internal:deno_node/polyfills/internal/net.ts";
} from "internal:deno_node/internal/validators.mjs";
import { isIP } from "internal:deno_node/internal/net.ts";
import {
emitInvalidHostnameWarning,
getDefaultResolver,
@ -42,7 +42,7 @@ import {
setDefaultResolver,
setDefaultResultOrder,
validateHints,
} from "internal:deno_node/polyfills/internal/dns/utils.ts";
} from "internal:deno_node/internal/dns/utils.ts";
import type {
AnyAaaaRecord,
AnyARecord,
@ -70,27 +70,27 @@ import type {
ResolveWithTtlOptions,
SoaRecord,
SrvRecord,
} from "internal:deno_node/polyfills/internal/dns/utils.ts";
import promisesBase from "internal:deno_node/polyfills/internal/dns/promises.ts";
import type { ErrnoException } from "internal:deno_node/polyfills/internal/errors.ts";
} from "internal:deno_node/internal/dns/utils.ts";
import promisesBase from "internal:deno_node/internal/dns/promises.ts";
import type { ErrnoException } from "internal:deno_node/internal/errors.ts";
import {
dnsException,
ERR_INVALID_ARG_TYPE,
ERR_INVALID_ARG_VALUE,
} from "internal:deno_node/polyfills/internal/errors.ts";
} from "internal:deno_node/internal/errors.ts";
import {
AI_ADDRCONFIG as ADDRCONFIG,
AI_ALL as ALL,
AI_V4MAPPED as V4MAPPED,
} from "internal:deno_node/polyfills/internal_binding/ares.ts";
} from "internal:deno_node/internal_binding/ares.ts";
import {
ChannelWrapQuery,
getaddrinfo,
GetAddrInfoReqWrap,
QueryReqWrap,
} from "internal:deno_node/polyfills/internal_binding/cares_wrap.ts";
import { toASCII } from "internal:deno_node/polyfills/punycode.ts";
import { notImplemented } from "internal:deno_node/polyfills/_utils.ts";
} from "internal:deno_node/internal_binding/cares_wrap.ts";
import { toASCII } from "internal:deno_node/punycode.ts";
import { notImplemented } from "internal:deno_node/_utils.ts";
function onlookup(
this: GetAddrInfoReqWrap,

View file

@ -19,7 +19,7 @@
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
import { promises } from "internal:deno_node/polyfills/dns.ts";
import { promises } from "internal:deno_node/dns.ts";
export const {
getServers,
lookup,

View file

@ -1,7 +1,7 @@
// Copyright 2018-2023 the Deno authors. 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() {
notImplemented("domain.create");

View file

@ -11,4 +11,4 @@ export {
on,
once,
setMaxListeners,
} from "internal:deno_node/polyfills/_events.mjs";
} from "internal:deno_node/_events.mjs";

View file

@ -3,178 +3,153 @@ import {
access,
accessPromise,
accessSync,
} from "internal:deno_node/polyfills/_fs/_fs_access.ts";
} from "internal:deno_node/_fs/_fs_access.ts";
import {
appendFile,
appendFilePromise,
appendFileSync,
} from "internal:deno_node/polyfills/_fs/_fs_appendFile.ts";
} from "internal:deno_node/_fs/_fs_appendFile.ts";
import {
chmod,
chmodPromise,
chmodSync,
} from "internal:deno_node/polyfills/_fs/_fs_chmod.ts";
} from "internal:deno_node/_fs/_fs_chmod.ts";
import {
chown,
chownPromise,
chownSync,
} from "internal:deno_node/polyfills/_fs/_fs_chown.ts";
import {
close,
closeSync,
} from "internal:deno_node/polyfills/_fs/_fs_close.ts";
import * as constants from "internal:deno_node/polyfills/_fs/_fs_constants.ts";
} from "internal:deno_node/_fs/_fs_chown.ts";
import { close, closeSync } from "internal:deno_node/_fs/_fs_close.ts";
import * as constants from "internal:deno_node/_fs/_fs_constants.ts";
import {
copyFile,
copyFilePromise,
copyFileSync,
} from "internal:deno_node/polyfills/_fs/_fs_copy.ts";
import Dir from "internal:deno_node/polyfills/_fs/_fs_dir.ts";
import Dirent from "internal:deno_node/polyfills/_fs/_fs_dirent.ts";
import {
exists,
existsSync,
} from "internal:deno_node/polyfills/_fs/_fs_exists.ts";
} from "internal:deno_node/_fs/_fs_copy.ts";
import Dir from "internal:deno_node/_fs/_fs_dir.ts";
import Dirent from "internal:deno_node/_fs/_fs_dirent.ts";
import { exists, existsSync } from "internal:deno_node/_fs/_fs_exists.ts";
import {
fdatasync,
fdatasyncSync,
} from "internal:deno_node/polyfills/_fs/_fs_fdatasync.ts";
import {
fstat,
fstatSync,
} from "internal:deno_node/polyfills/_fs/_fs_fstat.ts";
import {
fsync,
fsyncSync,
} from "internal:deno_node/polyfills/_fs/_fs_fsync.ts";
} from "internal:deno_node/_fs/_fs_fdatasync.ts";
import { fstat, fstatSync } from "internal:deno_node/_fs/_fs_fstat.ts";
import { fsync, fsyncSync } from "internal:deno_node/_fs/_fs_fsync.ts";
import {
ftruncate,
ftruncateSync,
} from "internal:deno_node/polyfills/_fs/_fs_ftruncate.ts";
import {
futimes,
futimesSync,
} from "internal:deno_node/polyfills/_fs/_fs_futimes.ts";
} from "internal:deno_node/_fs/_fs_ftruncate.ts";
import { futimes, futimesSync } from "internal:deno_node/_fs/_fs_futimes.ts";
import {
link,
linkPromise,
linkSync,
} from "internal:deno_node/polyfills/_fs/_fs_link.ts";
} from "internal:deno_node/_fs/_fs_link.ts";
import {
lstat,
lstatPromise,
lstatSync,
} from "internal:deno_node/polyfills/_fs/_fs_lstat.ts";
} from "internal:deno_node/_fs/_fs_lstat.ts";
import {
mkdir,
mkdirPromise,
mkdirSync,
} from "internal:deno_node/polyfills/_fs/_fs_mkdir.ts";
} from "internal:deno_node/_fs/_fs_mkdir.ts";
import {
mkdtemp,
mkdtempPromise,
mkdtempSync,
} from "internal:deno_node/polyfills/_fs/_fs_mkdtemp.ts";
} from "internal:deno_node/_fs/_fs_mkdtemp.ts";
import {
open,
openPromise,
openSync,
} from "internal:deno_node/polyfills/_fs/_fs_open.ts";
} from "internal:deno_node/_fs/_fs_open.ts";
import {
opendir,
opendirPromise,
opendirSync,
} from "internal:deno_node/polyfills/_fs/_fs_opendir.ts";
import { read, readSync } from "internal:deno_node/polyfills/_fs/_fs_read.ts";
} from "internal:deno_node/_fs/_fs_opendir.ts";
import { read, readSync } from "internal:deno_node/_fs/_fs_read.ts";
import {
readdir,
readdirPromise,
readdirSync,
} from "internal:deno_node/polyfills/_fs/_fs_readdir.ts";
} from "internal:deno_node/_fs/_fs_readdir.ts";
import {
readFile,
readFilePromise,
readFileSync,
} from "internal:deno_node/polyfills/_fs/_fs_readFile.ts";
} from "internal:deno_node/_fs/_fs_readFile.ts";
import {
readlink,
readlinkPromise,
readlinkSync,
} from "internal:deno_node/polyfills/_fs/_fs_readlink.ts";
} from "internal:deno_node/_fs/_fs_readlink.ts";
import {
realpath,
realpathPromise,
realpathSync,
} from "internal:deno_node/polyfills/_fs/_fs_realpath.ts";
} from "internal:deno_node/_fs/_fs_realpath.ts";
import {
rename,
renamePromise,
renameSync,
} from "internal:deno_node/polyfills/_fs/_fs_rename.ts";
} from "internal:deno_node/_fs/_fs_rename.ts";
import {
rmdir,
rmdirPromise,
rmdirSync,
} from "internal:deno_node/polyfills/_fs/_fs_rmdir.ts";
import {
rm,
rmPromise,
rmSync,
} from "internal:deno_node/polyfills/_fs/_fs_rm.ts";
} from "internal:deno_node/_fs/_fs_rmdir.ts";
import { rm, rmPromise, rmSync } from "internal:deno_node/_fs/_fs_rm.ts";
import {
stat,
statPromise,
statSync,
} from "internal:deno_node/polyfills/_fs/_fs_stat.ts";
} from "internal:deno_node/_fs/_fs_stat.ts";
import {
symlink,
symlinkPromise,
symlinkSync,
} from "internal:deno_node/polyfills/_fs/_fs_symlink.ts";
} from "internal:deno_node/_fs/_fs_symlink.ts";
import {
truncate,
truncatePromise,
truncateSync,
} from "internal:deno_node/polyfills/_fs/_fs_truncate.ts";
} from "internal:deno_node/_fs/_fs_truncate.ts";
import {
unlink,
unlinkPromise,
unlinkSync,
} from "internal:deno_node/polyfills/_fs/_fs_unlink.ts";
} from "internal:deno_node/_fs/_fs_unlink.ts";
import {
utimes,
utimesPromise,
utimesSync,
} from "internal:deno_node/polyfills/_fs/_fs_utimes.ts";
} from "internal:deno_node/_fs/_fs_utimes.ts";
import {
unwatchFile,
watch,
watchFile,
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"
import {
write,
writeSync,
} from "internal:deno_node/polyfills/_fs/_fs_write.mjs";
import { write, writeSync } from "internal:deno_node/_fs/_fs_write.mjs";
// @deno-types="./_fs/_fs_writev.d.ts"
import {
writev,
writevSync,
} from "internal:deno_node/polyfills/_fs/_fs_writev.mjs";
import { writev, writevSync } from "internal:deno_node/_fs/_fs_writev.mjs";
import {
writeFile,
writeFilePromise,
writeFileSync,
} from "internal:deno_node/polyfills/_fs/_fs_writeFile.ts";
import { Stats } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
} from "internal:deno_node/_fs/_fs_writeFile.ts";
import { Stats } from "internal:deno_node/internal/fs/utils.mjs";
// @deno-types="./internal/fs/streams.d.ts"
import {
createReadStream,
createWriteStream,
ReadStream,
WriteStream,
} from "internal:deno_node/polyfills/internal/fs/streams.mjs";
} from "internal:deno_node/internal/fs/streams.mjs";
const {
F_OK,

View file

@ -1,5 +1,5 @@
// 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 copyFile = fsPromises.copyFile;

View file

@ -1,14 +1,14 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// deno-lint-ignore-file no-var
import processModule from "internal:deno_node/polyfills/process.ts";
import { Buffer as bufferModule } from "internal:deno_node/polyfills/buffer.ts";
import processModule from "internal:deno_node/process.ts";
import { Buffer as bufferModule } from "internal:deno_node/buffer.ts";
import {
clearInterval,
clearTimeout,
setInterval,
setTimeout,
} from "internal:deno_node/polyfills/timers.ts";
import timers from "internal:deno_node/polyfills/timers.ts";
} from "internal:deno_node/timers.ts";
import timers from "internal:deno_node/timers.ts";
type GlobalType = {
process: typeof processModule;

View file

@ -1,32 +1,29 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { TextEncoder } from "internal:deno_web/08_text_encoding.js";
import {
type Deferred,
deferred,
} from "internal:deno_node/polyfills/_util/async.ts";
import { type Deferred, deferred } from "internal:deno_node/_util/async.ts";
import {
_normalizeArgs,
ListenOptions,
Socket,
} from "internal:deno_node/polyfills/net.ts";
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
import { ERR_SERVER_NOT_RUNNING } from "internal:deno_node/polyfills/internal/errors.ts";
import { EventEmitter } from "internal:deno_node/polyfills/events.ts";
import { nextTick } from "internal:deno_node/polyfills/_next_tick.ts";
import { validatePort } from "internal:deno_node/polyfills/internal/validators.mjs";
} from "internal:deno_node/net.ts";
import { Buffer } from "internal:deno_node/buffer.ts";
import { ERR_SERVER_NOT_RUNNING } from "internal:deno_node/internal/errors.ts";
import { EventEmitter } from "internal:deno_node/events.ts";
import { nextTick } from "internal:deno_node/_next_tick.ts";
import { validatePort } from "internal:deno_node/internal/validators.mjs";
import {
Readable as NodeReadable,
Writable as NodeWritable,
} from "internal:deno_node/polyfills/stream.ts";
import { OutgoingMessage } from "internal:deno_node/polyfills/_http_outgoing.ts";
import { Agent } from "internal:deno_node/polyfills/_http_agent.mjs";
import { chunkExpression as RE_TE_CHUNKED } from "internal:deno_node/polyfills/_http_common.ts";
import { urlToHttpOptions } from "internal:deno_node/polyfills/internal/url.ts";
} from "internal:deno_node/stream.ts";
import { OutgoingMessage } from "internal:deno_node/_http_outgoing.ts";
import { Agent } from "internal:deno_node/_http_agent.mjs";
import { chunkExpression as RE_TE_CHUNKED } from "internal:deno_node/_http_common.ts";
import { urlToHttpOptions } from "internal:deno_node/internal/url.ts";
import {
constants,
TCP,
} from "internal:deno_node/polyfills/internal_binding/tcp_wrap.ts";
} from "internal:deno_node/internal_binding/tcp_wrap.ts";
enum STATUS_CODES {
/** RFC 7231, 6.2.1 */

View file

@ -1,7 +1,7 @@
// Copyright 2018-2023 the Deno authors. 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 {
constructor() {

View file

@ -1,15 +1,15 @@
// Copyright 2018-2023 the Deno authors. 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 { urlToHttpOptions } from "internal:deno_node/polyfills/internal/url.ts";
import { notImplemented } from "internal:deno_node/_utils.ts";
import { urlToHttpOptions } from "internal:deno_node/internal/url.ts";
import {
Agent as HttpAgent,
ClientRequest,
IncomingMessageForClient as IncomingMessage,
type RequestOptions,
} from "internal:deno_node/polyfills/http.ts";
import type { Socket } from "internal:deno_node/polyfills/net.ts";
} from "internal:deno_node/http.ts";
import type { Socket } from "internal:deno_node/net.ts";
export class Agent extends HttpAgent {
}

View file

@ -1,8 +1,8 @@
// Copyright 2018-2023 the Deno authors. 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 { notImplemented } from "internal:deno_node/polyfills/_utils.ts";
import { EventEmitter } from "internal:deno_node/events.ts";
import { notImplemented } from "internal:deno_node/_utils.ts";
const connectionSymbol = Symbol("connectionProperty");
const messageCallbacksSymbol = Symbol("messageCallbacks");

View file

@ -1,5 +1,5 @@
// 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) {
if (!value) {

View file

@ -2,12 +2,12 @@
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
// deno-lint-ignore camelcase
import * as async_wrap from "internal:deno_node/polyfills/internal_binding/async_wrap.ts";
import { ERR_ASYNC_CALLBACK } from "internal:deno_node/polyfills/internal/errors.ts";
import * as async_wrap from "internal:deno_node/internal_binding/async_wrap.ts";
import { ERR_ASYNC_CALLBACK } from "internal:deno_node/internal/errors.ts";
export {
asyncIdSymbol,
ownerSymbol,
} from "internal:deno_node/polyfills/internal_binding/symbols.ts";
} from "internal:deno_node/internal_binding/symbols.ts";
interface ActiveHooks {
array: AsyncHook[];

View file

@ -35,7 +35,7 @@ type WithImplicitCoercion<T> =
* recommended to explicitly reference it via an import or require statement.
*
* ```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.
* 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.
*
* ```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'.
* 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.
*
* ```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.from('foo')); // true
@ -181,7 +181,7 @@ export class Buffer extends Uint8Array {
* or `false` otherwise.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* console.log(Buffer.isEncoding('utf8'));
* // Prints: true
@ -210,7 +210,7 @@ export class Buffer extends Uint8Array {
* string.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const str = '\u00bd + \u00bc = \u00be';
*
@ -249,7 +249,7 @@ export class Buffer extends Uint8Array {
* truncated to `totalLength`.
*
* ```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.
*
@ -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)`.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf1 = Buffer.from('1234');
* 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.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* 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)`.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.alloc(5, 'a');
*
@ -325,7 +325,7 @@ export class Buffer extends Uint8Array {
* initialized by calling `buf.fill(fill, encoding)`.
*
* ```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');
*
@ -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.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.allocUnsafe(10);
*
@ -406,7 +406,7 @@ export class Buffer extends Uint8Array {
* then copying out the relevant bits.
*
* ```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.
* const store = [];
@ -443,7 +443,7 @@ export class Buffer extends Uint8Array {
* written. However, partially encoded characters will not be written.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.alloc(256);
*
@ -484,7 +484,7 @@ export class Buffer extends Uint8Array {
* as {@link constants.MAX_STRING_LENGTH}.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* 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)`.
*
* ```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 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`.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf1 = Buffer.from('ABC');
* 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.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf1 = Buffer.from('ABC');
* 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.
*
* ```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 buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]);
@ -632,7 +632,7 @@ export class Buffer extends Uint8Array {
* different function arguments.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* // Create two `Buffer` instances.
* const buf1 = Buffer.allocUnsafe(26);
@ -653,7 +653,7 @@ export class Buffer extends Uint8Array {
* ```
*
* ```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
* // 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()`.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/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.
*
* ```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
* // from the original `Buffer`.
@ -749,7 +749,7 @@ export class Buffer extends Uint8Array {
* end of `buf` rather than the beginning.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/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.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* 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.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.allocUnsafe(8);
*
@ -818,7 +818,7 @@ export class Buffer extends Uint8Array {
* This function is also available under the `writeBigUint64BE` alias.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* 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
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.allocUnsafe(8);
*
@ -861,7 +861,7 @@ export class Buffer extends Uint8Array {
* This function is also available under the `writeUintLE` alias.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.allocUnsafe(6);
*
@ -884,7 +884,7 @@ export class Buffer extends Uint8Array {
* This function is also available under the `writeUintBE` alias.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.allocUnsafe(6);
*
@ -905,7 +905,7 @@ export class Buffer extends Uint8Array {
* when `value` is anything other than a signed integer.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.allocUnsafe(6);
*
@ -926,7 +926,7 @@ export class Buffer extends Uint8Array {
* signed integer.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.allocUnsafe(6);
*
@ -948,7 +948,7 @@ export class Buffer extends Uint8Array {
* This function is also available under the `readBigUint64BE` alias.
*
* ```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]);
*
@ -965,7 +965,7 @@ export class Buffer extends Uint8Array {
* This function is also available under the `readBigUint64LE` alias.
*
* ```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]);
*
@ -1001,7 +1001,7 @@ export class Buffer extends Uint8Array {
* This function is also available under the `readUintLE` alias.
*
* ```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]);
*
@ -1020,7 +1020,7 @@ export class Buffer extends Uint8Array {
* This function is also available under the `readUintBE` alias.
*
* ```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]);
*
@ -1039,7 +1039,7 @@ export class Buffer extends Uint8Array {
* supporting up to 48 bits of accuracy.
*
* ```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]);
*
@ -1056,7 +1056,7 @@ export class Buffer extends Uint8Array {
* supporting up to 48 bits of accuracy.
*
* ```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]);
*
@ -1078,7 +1078,7 @@ export class Buffer extends Uint8Array {
* This function is also available under the `readUint8` alias.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.from([1, -2]);
*
@ -1099,7 +1099,7 @@ export class Buffer extends Uint8Array {
* This function is also available under the `readUint16LE` alias.
*
* ```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]);
*
@ -1120,7 +1120,7 @@ export class Buffer extends Uint8Array {
* This function is also available under the `readUint16BE` alias.
*
* ```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]);
*
@ -1139,7 +1139,7 @@ export class Buffer extends Uint8Array {
* This function is also available under the `readUint32LE` alias.
*
* ```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]);
*
@ -1158,7 +1158,7 @@ export class Buffer extends Uint8Array {
* This function is also available under the `readUint32BE` alias.
*
* ```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]);
*
@ -1175,7 +1175,7 @@ export class Buffer extends Uint8Array {
* Integers read from a `Buffer` are interpreted as two's complement signed values.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* 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.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* 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.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* 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.
*
* ```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]);
*
@ -1251,7 +1251,7 @@ export class Buffer extends Uint8Array {
* Integers read from a `Buffer` are interpreted as two's complement signed values.
*
* ```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]);
*
@ -1266,7 +1266,7 @@ export class Buffer extends Uint8Array {
* Reads a 32-bit, little-endian float from `buf` at the specified `offset`.
*
* ```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]);
*
@ -1283,7 +1283,7 @@ export class Buffer extends Uint8Array {
* Reads a 32-bit, big-endian float from `buf` at the specified `offset`.
*
* ```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]);
*
@ -1298,7 +1298,7 @@ export class Buffer extends Uint8Array {
* Reads a 64-bit, little-endian double from `buf` at the specified `offset`.
*
* ```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]);
*
@ -1315,7 +1315,7 @@ export class Buffer extends Uint8Array {
* Reads a 64-bit, big-endian double from `buf` at the specified `offset`.
*
* ```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]);
*
@ -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.
*
* ```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]);
*
@ -1354,7 +1354,7 @@ export class Buffer extends Uint8Array {
* between UTF-16 little-endian and UTF-16 big-endian:
*
* ```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');
* 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.
*
* ```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]);
*
@ -1394,7 +1394,7 @@ export class Buffer extends Uint8Array {
* Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8.
*
* ```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]);
*
@ -1423,7 +1423,7 @@ export class Buffer extends Uint8Array {
* This function is also available under the `writeUint8` alias.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.allocUnsafe(4);
*
@ -1448,7 +1448,7 @@ export class Buffer extends Uint8Array {
* This function is also available under the `writeUint16LE` alias.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.allocUnsafe(4);
*
@ -1471,7 +1471,7 @@ export class Buffer extends Uint8Array {
* This function is also available under the `writeUint16BE` alias.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.allocUnsafe(4);
*
@ -1494,7 +1494,7 @@ export class Buffer extends Uint8Array {
* This function is also available under the `writeUint32LE` alias.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.allocUnsafe(4);
*
@ -1516,7 +1516,7 @@ export class Buffer extends Uint8Array {
* This function is also available under the `writeUint32BE` alias.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* 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.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* 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.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* 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.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* 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.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* 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.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.allocUnsafe(4);
*
@ -1648,7 +1648,7 @@ export class Buffer extends Uint8Array {
* undefined when `value` is anything other than a JavaScript number.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.allocUnsafe(4);
*
@ -1668,7 +1668,7 @@ export class Buffer extends Uint8Array {
* undefined when `value` is anything other than a JavaScript number.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.allocUnsafe(4);
*
@ -1688,7 +1688,7 @@ export class Buffer extends Uint8Array {
* other than a JavaScript number.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.allocUnsafe(8);
*
@ -1708,7 +1708,7 @@ export class Buffer extends Uint8Array {
* other than a JavaScript number.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.allocUnsafe(8);
*
@ -1728,7 +1728,7 @@ export class Buffer extends Uint8Array {
* the entire `buf` will be filled:
*
* ```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'.
*
@ -1746,7 +1746,7 @@ export class Buffer extends Uint8Array {
* then only the bytes of that character that fit into `buf` are written:
*
* ```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.
*
@ -1758,7 +1758,7 @@ export class Buffer extends Uint8Array {
* fill data remains, an exception is thrown:
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.allocUnsafe(5);
*
@ -1792,7 +1792,7 @@ export class Buffer extends Uint8Array {
* value between `0` and `255`.
*
* ```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');
*
@ -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).
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const b = Buffer.from('abcdef');
*
@ -1860,7 +1860,7 @@ export class Buffer extends Uint8Array {
* rather than the first occurrence.
*
* ```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');
*
@ -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).
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const b = Buffer.from('abcdef');
*
@ -1932,7 +1932,7 @@ export class Buffer extends Uint8Array {
* of `buf`.
*
* ```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`.
*
@ -1956,7 +1956,7 @@ export class Buffer extends Uint8Array {
* Equivalent to `buf.indexOf() !== -1`.
*
* ```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');
*
@ -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).
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/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.
*
* ```js
* import { Buffer } from "internal:deno_node/polyfills/internal/buffer";
* import { Buffer } from "internal:deno_node/internal/buffer";
*
* const buf = Buffer.from('buffer');
*

View file

@ -3,9 +3,9 @@
// Copyright Feross Aboukhadijeh, and other contributors. All rights reserved. MIT license.
import { TextDecoder, TextEncoder } from "internal:deno_web/08_text_encoding.js";
import { codes } from "internal:deno_node/polyfills/internal/error_codes.ts";
import { encodings } from "internal:deno_node/polyfills/internal_binding/string_decoder.ts";
import { indexOfBuffer, indexOfNumber } from "internal:deno_node/polyfills/internal_binding/buffer.ts";
import { codes } from "internal:deno_node/internal/error_codes.ts";
import { encodings } from "internal:deno_node/internal_binding/string_decoder.ts";
import { indexOfBuffer, indexOfNumber } from "internal:deno_node/internal_binding/buffer.ts";
import {
asciiToBytes,
base64ToBytes,
@ -14,11 +14,11 @@ import {
bytesToUtf16le,
hexToBytes,
utf16leToBytes,
} from "internal:deno_node/polyfills/internal_binding/_utils.ts";
import { isAnyArrayBuffer, isArrayBufferView } from "internal:deno_node/polyfills/internal/util/types.ts";
import { normalizeEncoding } from "internal:deno_node/polyfills/internal/util.mjs";
import { validateBuffer } from "internal:deno_node/polyfills/internal/validators.mjs";
import { isUint8Array } from "internal:deno_node/polyfills/internal/util/types.ts";
} from "internal:deno_node/internal_binding/_utils.ts";
import { isAnyArrayBuffer, isArrayBufferView } from "internal:deno_node/internal/util/types.ts";
import { normalizeEncoding } from "internal:deno_node/internal/util.mjs";
import { validateBuffer } from "internal:deno_node/internal/validators.mjs";
import { isUint8Array } from "internal:deno_node/internal/util/types.ts";
import { forgivingBase64Encode, forgivingBase64UrlEncode } from "internal:deno_web/00_infra.js";
import { atob, btoa } from "internal:deno_web/05_base64.js";
import { Blob } from "internal:deno_web/09_file.js";

View file

@ -2,37 +2,33 @@
// This module implements 'child_process' module of Node.JS API.
// ref: https://nodejs.org/api/child_process.html
import { assert } from "internal:deno_node/polyfills/_util/asserts.ts";
import { EventEmitter } from "internal:deno_node/polyfills/events.ts";
import { os } from "internal:deno_node/polyfills/internal_binding/constants.ts";
import { assert } from "internal:deno_node/_util/asserts.ts";
import { EventEmitter } from "internal:deno_node/events.ts";
import { os } from "internal:deno_node/internal_binding/constants.ts";
import {
notImplemented,
warnNotImplemented,
} from "internal:deno_node/polyfills/_utils.ts";
import {
Readable,
Stream,
Writable,
} 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";
} from "internal:deno_node/_utils.ts";
import { Readable, Stream, Writable } from "internal:deno_node/stream.ts";
import { deferred } from "internal:deno_node/_util/async.ts";
import { isWindows } from "internal:deno_node/_util/os.ts";
import { nextTick } from "internal:deno_node/_next_tick.ts";
import {
AbortError,
ERR_INVALID_ARG_TYPE,
ERR_INVALID_ARG_VALUE,
ERR_UNKNOWN_SIGNAL,
} from "internal:deno_node/polyfills/internal/errors.ts";
import { Buffer } from "internal:deno_node/polyfills/buffer.ts";
import { errnoException } from "internal:deno_node/polyfills/internal/errors.ts";
import { ErrnoException } from "internal:deno_node/polyfills/_global.d.ts";
import { codeMap } from "internal:deno_node/polyfills/internal_binding/uv.ts";
} from "internal:deno_node/internal/errors.ts";
import { Buffer } from "internal:deno_node/buffer.ts";
import { errnoException } from "internal:deno_node/internal/errors.ts";
import { ErrnoException } from "internal:deno_node/_global.d.ts";
import { codeMap } from "internal:deno_node/internal_binding/uv.ts";
import {
isInt32,
validateBoolean,
validateObject,
validateString,
} from "internal:deno_node/polyfills/internal/validators.mjs";
} from "internal:deno_node/internal/validators.mjs";
import {
ArrayIsArray,
ArrayPrototypeFilter,
@ -43,10 +39,10 @@ import {
ArrayPrototypeUnshift,
ObjectPrototypeHasOwnProperty,
StringPrototypeToUpperCase,
} from "internal:deno_node/polyfills/internal/primordials.mjs";
import { kEmptyObject } from "internal:deno_node/polyfills/internal/util.mjs";
import { getValidatedPath } from "internal:deno_node/polyfills/internal/fs/utils.mjs";
import process from "internal:deno_node/polyfills/process.ts";
} from "internal:deno_node/internal/primordials.mjs";
import { kEmptyObject } from "internal:deno_node/internal/util.mjs";
import { getValidatedPath } from "internal:deno_node/internal/fs/utils.mjs";
import process from "internal:deno_node/process.ts";
export function mapValues<T, O>(
record: Readonly<Record<string, T>>,

View file

@ -1,7 +1,7 @@
// Copyright 2018-2023 the Deno authors. 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
// 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