Update deps

This commit is contained in:
Anton Medvedev 2023-03-28 17:15:22 +02:00
parent eed58e3496
commit 363bb1be96
126 changed files with 5743 additions and 2737 deletions

2
node_modules/.bin/node-which generated vendored

@ -1 +1 @@
../which/bin/node-which ../which/bin/which.js

1
node_modules/.bin/webpod generated vendored Symbolic link

@ -0,0 +1 @@
../webpod/dist/index.js

92
node_modules/.package-lock.json generated vendored

@ -53,9 +53,18 @@
} }
}, },
"node_modules/@types/fs-extra": { "node_modules/@types/fs-extra": {
"version": "9.0.13", "version": "11.0.1",
"resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.13.tgz", "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.1.tgz",
"integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==", "integrity": "sha512-MxObHvNl4A69ofaTRU8DFqvgzzv8s9yRtaPPm5gud9HDNvpB3GPQFvNuTWAI59B9huVGV5jXYJwbCsmBsOGYWA==",
"dependencies": {
"@types/jsonfile": "*",
"@types/node": "*"
}
},
"node_modules/@types/jsonfile": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/@types/jsonfile/-/jsonfile-6.1.1.tgz",
"integrity": "sha512-GSgiRCVeapDN+3pqA35IkQwasaCh/0YFH5dEF6S88iDvEn901DjOeH3/QPY+XYP1DFzDZPvIvfeEgk+7br5png==",
"dependencies": { "dependencies": {
"@types/node": "*" "@types/node": "*"
} }
@ -66,9 +75,9 @@
"integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==" "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ=="
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "18.11.18", "version": "18.15.10",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.10.tgz",
"integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==" "integrity": "sha512-9avDaQJczATcXgfmMAW3MIWArOO7A+m90vuCFLr8AotWf8igO/mRoYukrk2cqZVtv38tHs33retzHEilM7FpeQ=="
}, },
"node_modules/@types/ps-tree": { "node_modules/@types/ps-tree": {
"version": "1.1.2", "version": "1.1.2",
@ -76,9 +85,9 @@
"integrity": "sha512-ZREFYlpUmPQJ0esjxoG1fMvB2HNaD3z+mjqdSosZvd3RalncI9NEur73P8ZJz4YQdL64CmV1w0RuqoRUlhQRBw==" "integrity": "sha512-ZREFYlpUmPQJ0esjxoG1fMvB2HNaD3z+mjqdSosZvd3RalncI9NEur73P8ZJz4YQdL64CmV1w0RuqoRUlhQRBw=="
}, },
"node_modules/@types/which": { "node_modules/@types/which": {
"version": "2.0.1", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/@types/which/-/which-2.0.1.tgz", "resolved": "https://registry.npmjs.org/@types/which/-/which-2.0.2.tgz",
"integrity": "sha512-Jjakcv8Roqtio6w1gr0D7y6twbhx6gGgFGF5BLwajPpnOIOxFkakFhCq+LmyyeAz7BX6ULrjBOxdKaCDy+4+dQ==" "integrity": "sha512-113D3mDkZDjo+EeUEHCFy0qniNc1ZpecGiAU7WSo7YDoSzolZIQKpYFHrPpjkB2nuyahcKfrmLXeQlh7gqJYdw=="
}, },
"node_modules/braces": { "node_modules/braces": {
"version": "3.0.2", "version": "3.0.2",
@ -213,16 +222,16 @@
"integrity": "sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g==" "integrity": "sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g=="
}, },
"node_modules/fs-extra": { "node_modules/fs-extra": {
"version": "10.1.0", "version": "11.1.1",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz",
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==",
"dependencies": { "dependencies": {
"graceful-fs": "^4.2.0", "graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1", "jsonfile": "^6.0.1",
"universalify": "^2.0.0" "universalify": "^2.0.0"
}, },
"engines": { "engines": {
"node": ">=12" "node": ">=14.14"
} }
}, },
"node_modules/glob-parent": { "node_modules/glob-parent": {
@ -255,9 +264,9 @@
} }
}, },
"node_modules/graceful-fs": { "node_modules/graceful-fs": {
"version": "4.2.10", "version": "4.2.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
}, },
"node_modules/ignore": { "node_modules/ignore": {
"version": "5.2.4", "version": "5.2.4",
@ -297,7 +306,7 @@
"node_modules/isexe": { "node_modules/isexe": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="
}, },
"node_modules/jsonfile": { "node_modules/jsonfile": {
"version": "6.1.0", "version": "6.1.0",
@ -336,9 +345,9 @@
} }
}, },
"node_modules/minimist": { "node_modules/minimist": {
"version": "1.2.7", "version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"funding": { "funding": {
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
@ -547,18 +556,26 @@
"node": ">= 8" "node": ">= 8"
} }
}, },
"node_modules/webpod": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/webpod/-/webpod-0.0.2.tgz",
"integrity": "sha512-cSwwQIeg8v4i3p4ajHhwgR7N6VyxAf+KYSSsY6Pd3aETE+xEU4vbitz7qQkB0I321xnhDdgtxuiSfk5r/FVtjg==",
"bin": {
"webpod": "dist/index.js"
}
},
"node_modules/which": { "node_modules/which": {
"version": "2.0.2", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "resolved": "https://registry.npmjs.org/which/-/which-3.0.0.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "integrity": "sha512-nla//68K9NU6yRiwDY/Q8aU6siKlSs64aEC7+IV56QoAuyQT2ovsJcgGYGyqMOmI/CGN1BOR6mM5EN0FBO+zyQ==",
"dependencies": { "dependencies": {
"isexe": "^2.0.0" "isexe": "^2.0.0"
}, },
"bin": { "bin": {
"node-which": "bin/node-which" "node-which": "bin/which.js"
}, },
"engines": { "engines": {
"node": ">= 8" "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
} }
}, },
"node_modules/yaml": { "node_modules/yaml": {
@ -570,23 +587,24 @@
} }
}, },
"node_modules/zx": { "node_modules/zx": {
"version": "7.1.1", "version": "7.2.1",
"resolved": "https://registry.npmjs.org/zx/-/zx-7.1.1.tgz", "resolved": "https://registry.npmjs.org/zx/-/zx-7.2.1.tgz",
"integrity": "sha512-5YlTO2AJ+Ku2YuZKSSSqnUKuagcM/f/j4LmHs15O84Ch80Z9gzR09ZK3gR7GV+rc8IFpz2H/XNFtFVmj31yrZA==", "integrity": "sha512-TgKwppaMLMNAXHhlhbBh7rMoOSx3/9qqnkv8frmhVlSomEuWkDijh/BCmYntkoS7ZQyemApAUyEi24jIrrS+hA==",
"dependencies": { "dependencies": {
"@types/fs-extra": "^9.0.13", "@types/fs-extra": "^11.0.1",
"@types/minimist": "^1.2.2", "@types/minimist": "^1.2.2",
"@types/node": "^18.7.20", "@types/node": "^18.14.2",
"@types/ps-tree": "^1.1.2", "@types/ps-tree": "^1.1.2",
"@types/which": "^2.0.1", "@types/which": "^2.0.2",
"chalk": "^5.0.1", "chalk": "^5.2.0",
"fs-extra": "^10.1.0", "fs-extra": "^11.1.0",
"globby": "^13.1.2", "globby": "^13.1.3",
"minimist": "^1.2.6", "minimist": "^1.2.8",
"node-fetch": "3.2.10", "node-fetch": "3.2.10",
"ps-tree": "^1.2.0", "ps-tree": "^1.2.0",
"which": "^2.0.2", "webpod": "^0",
"yaml": "^2.1.1" "which": "^3.0.0",
"yaml": "^2.2.1"
}, },
"bin": { "bin": {
"zx": "build/cli.js" "zx": "build/cli.js"

@ -8,9 +8,9 @@ This package contains type definitions for fs-extra (https://github.com/jprichar
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fs-extra. Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fs-extra.
### Additional Details ### Additional Details
* Last updated: Tue, 21 Sep 2021 19:02:14 GMT * Last updated: Tue, 10 Jan 2023 19:32:54 GMT
* Dependencies: [@types/node](https://npmjs.com/package/@types/node) * Dependencies: [@types/jsonfile](https://npmjs.com/package/@types/jsonfile), [@types/node](https://npmjs.com/package/@types/node)
* Global values: none * Global values: none
# Credits # Credits
These definitions were written by [Alan Agius](https://github.com/alan-agius4), [midknight41](https://github.com/midknight41), [Brendan Forster](https://github.com/shiftkey), [Mees van Dijk](https://github.com/mees-), [Justin Rockwood](https://github.com/jrockwood), [Sang Dang](https://github.com/sangdth), [Florian Keller](https://github.com/ffflorian), [Piotr Błażejewicz](https://github.com/peterblazejewicz), and [Tiger Oakes](https://github.com/NotWoods). These definitions were written by [Alan Agius](https://github.com/alan-agius4), [midknight41](https://github.com/midknight41), [Brendan Forster](https://github.com/shiftkey), [Mees van Dijk](https://github.com/mees-), [Justin Rockwood](https://github.com/jrockwood), [Sang Dang](https://github.com/sangdth), [Florian Keller](https://github.com/ffflorian), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Tiger Oakes](https://github.com/NotWoods), and [BendingBender](https://github.com/BendingBender).

111
node_modules/@types/fs-extra/esm.d.mts generated vendored Executable file

@ -0,0 +1,111 @@
import * as fse from './index.js';
export {
copy,
copySync,
emptyDirSync,
emptydirSync,
emptyDir,
emptydir,
createFile,
createFileSync,
ensureFile,
ensureFileSync,
createLink,
createLinkSync,
ensureLink,
ensureLinkSync,
createSymlink,
createSymlinkSync,
ensureSymlink,
ensureSymlinkSync,
readJson,
readJSON,
readJsonSync,
readJSONSync,
writeJson,
writeJSON,
writeJsonSync,
writeJSONSync,
outputJson,
outputJSON,
outputJsonSync,
outputJSONSync,
mkdirs,
mkdirsSync,
mkdirp,
mkdirpSync,
ensureDir,
ensureDirSync,
move,
moveSync,
outputFile,
outputFileSync,
pathExists,
pathExistsSync,
remove,
removeSync,
PathLike,
NoParamCallback,
NoParamCallbackWithUndefined,
SymlinkType,
CopyFilterSync,
CopyFilterAsync,
CopyOptions,
CopyOptionsSync,
EnsureDirOptions,
MoveOptions,
WriteFileOptions,
JsonReadOptions,
JsonWriteOptions,
JsonOutputOptions,
} from './index.js';
declare const fsExtra: {
copy: typeof fse.copy;
copySync: typeof fse.copySync;
emptyDirSync: typeof fse.emptyDirSync;
emptydirSync: typeof fse.emptydirSync;
emptyDir: typeof fse.emptyDir;
emptydir: typeof fse.emptydir;
createFile: typeof fse.createFile;
createFileSync: typeof fse.createFileSync;
ensureFile: typeof fse.ensureFile;
ensureFileSync: typeof fse.ensureFileSync;
createLink: typeof fse.createLink;
createLinkSync: typeof fse.createLinkSync;
ensureLink: typeof fse.ensureLink;
ensureLinkSync: typeof fse.ensureLinkSync;
createSymlink: typeof fse.createSymlink;
createSymlinkSync: typeof fse.createSymlinkSync;
ensureSymlink: typeof fse.ensureSymlink;
ensureSymlinkSync: typeof fse.ensureSymlinkSync;
readJson: typeof fse.readJson;
readJSON: typeof fse.readJSON;
readJsonSync: typeof fse.readJsonSync;
readJSONSync: typeof fse.readJSONSync;
writeJson: typeof fse.writeJson;
writeJSON: typeof fse.writeJSON;
writeJsonSync: typeof fse.writeJsonSync;
writeJSONSync: typeof fse.writeJSONSync;
outputJson: typeof fse.outputJson;
outputJSON: typeof fse.outputJSON;
outputJsonSync: typeof fse.outputJsonSync;
outputJSONSync: typeof fse.outputJSONSync;
mkdirs: typeof fse.mkdirs;
mkdirsSync: typeof fse.mkdirsSync;
mkdirp: typeof fse.mkdirp;
mkdirpSync: typeof fse.mkdirpSync;
ensureDir: typeof fse.ensureDir;
ensureDirSync: typeof fse.ensureDirSync;
move: typeof fse.move;
moveSync: typeof fse.moveSync;
outputFile: typeof fse.outputFile;
outputFileSync: typeof fse.outputFileSync;
pathExists: typeof fse.pathExists;
pathExistsSync: typeof fse.pathExistsSync;
remove: typeof fse.remove;
removeSync: typeof fse.removeSync;
};
export default fsExtra;

1438
node_modules/@types/fs-extra/index.d.ts generated vendored

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
{ {
"name": "@types/fs-extra", "name": "@types/fs-extra",
"version": "9.0.13", "version": "11.0.1",
"description": "TypeScript definitions for fs-extra", "description": "TypeScript definitions for fs-extra",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fs-extra", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fs-extra",
"license": "MIT", "license": "MIT",
@ -49,6 +49,11 @@
"name": "Tiger Oakes", "name": "Tiger Oakes",
"url": "https://github.com/NotWoods", "url": "https://github.com/NotWoods",
"githubUsername": "NotWoods" "githubUsername": "NotWoods"
},
{
"name": "BendingBender",
"url": "https://github.com/BendingBender",
"githubUsername": "BendingBender"
} }
], ],
"main": "", "main": "",
@ -60,8 +65,20 @@
}, },
"scripts": {}, "scripts": {},
"dependencies": { "dependencies": {
"@types/jsonfile": "*",
"@types/node": "*" "@types/node": "*"
}, },
"typesPublisherContentHash": "75e10d16a18d936a50e54414024604aa9484e8345b37c2027921869f254523ee", "typesPublisherContentHash": "9244941e71bf5edda5456eb8aee9bd3d796ad970d74fb7991788553ac18c5d83",
"typeScriptVersion": "3.9" "typeScriptVersion": "4.5",
"exports": {
".": {
"types": "./index.d.ts"
},
"./esm": {
"types": {
"import": "./esm.d.mts"
}
},
"./package.json": "./package.json"
}
} }

21
node_modules/@types/jsonfile/LICENSE generated vendored Executable file

@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

16
node_modules/@types/jsonfile/README.md generated vendored Executable file

@ -0,0 +1,16 @@
# Installation
> `npm install --save @types/jsonfile`
# Summary
This package contains type definitions for jsonfile (https://github.com/jprichardson/node-jsonfile#readme).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsonfile.
### Additional Details
* Last updated: Mon, 09 Jan 2023 00:02:44 GMT
* Dependencies: [@types/node](https://npmjs.com/package/@types/node)
* Global values: none
# Credits
These definitions were written by [Daniel Bowring](https://github.com/dbowring), [BendingBender](https://github.com/BendingBender), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).

78
node_modules/@types/jsonfile/index.d.ts generated vendored Executable file

@ -0,0 +1,78 @@
// Type definitions for jsonfile 6.1
// Project: https://github.com/jprichardson/node-jsonfile#readme
// Definitions by: Daniel Bowring <https://github.com/dbowring>
// BendingBender <https://github.com/BendingBender>
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node"/>
import { Url } from 'url';
import {
PathLike,
readFile as fsReadFile,
readFileSync as fsReadFileSync,
writeFile as fsWriteFile,
writeFileSync as fsWriteFileSync,
} from 'fs';
export type Path = PathLike | Url;
export interface FS {
readFile: typeof fsReadFile;
readFileSync: typeof fsReadFileSync;
writeFile: typeof fsWriteFile;
writeFileSync: typeof fsWriteFileSync;
}
export type JFReadOptions =
| {
encoding?: string | null | undefined;
flag?: string | undefined;
throws?: boolean | undefined;
fs?: FS | undefined;
reviver?: ((key: any, value: any) => any) | undefined;
}
| string
| null
| undefined;
export type JFWriteOptions =
| {
encoding?: string | null | undefined;
mode?: string | number | undefined;
flag?: string | undefined;
fs?: FS | undefined;
EOL?: string | undefined;
spaces?: string | number | undefined;
replacer?: ((key: string, value: any) => any) | undefined;
}
| string
| null;
export type ReadCallback = (err: NodeJS.ErrnoException | null, data: any) => void;
export type WriteCallback = (err: NodeJS.ErrnoException | null) => void;
/**
* @see {@link https://github.com/jprichardson/node-jsonfile#readfilefilename-options-callback}
*/
export function readFile(file: Path, options: JFReadOptions, callback: ReadCallback): void;
export function readFile(file: Path, callback: ReadCallback): void;
export function readFile(file: Path, options?: JFReadOptions): Promise<any>;
/**
* @see {@link https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options}
*/
export function readFileSync(file: Path, options?: JFReadOptions): any;
/**
* @see {@link https://github.com/jprichardson/node-jsonfile#writefilefilename-obj-options-callback}
*/
export function writeFile(file: Path, obj: any, options: JFWriteOptions, callback: WriteCallback): void;
export function writeFile(file: Path, obj: any, callback: WriteCallback): void;
export function writeFile(file: Path, obj: any, options?: JFWriteOptions): Promise<void>;
/**
* @see {@link https://github.com/jprichardson/node-jsonfile#writefilesyncfilename-obj-options}
*/
export function writeFileSync(file: Path, obj: any, options?: JFWriteOptions): void;

37
node_modules/@types/jsonfile/package.json generated vendored Executable file

@ -0,0 +1,37 @@
{
"name": "@types/jsonfile",
"version": "6.1.1",
"description": "TypeScript definitions for jsonfile",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsonfile",
"license": "MIT",
"contributors": [
{
"name": "Daniel Bowring",
"url": "https://github.com/dbowring",
"githubUsername": "dbowring"
},
{
"name": "BendingBender",
"url": "https://github.com/BendingBender",
"githubUsername": "BendingBender"
},
{
"name": "Piotr Błażejewicz",
"url": "https://github.com/peterblazejewicz",
"githubUsername": "peterblazejewicz"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/jsonfile"
},
"scripts": {},
"dependencies": {
"@types/node": "*"
},
"typesPublisherContentHash": "c1cbc44e364fab01fba30bb4617cea593123234baa610c3e5ad34decb6bb6799",
"typeScriptVersion": "4.2"
}

9
node_modules/@types/jsonfile/utils.d.ts generated vendored Executable file

@ -0,0 +1,9 @@
export function stringify(obj: any, options?: StringifyOptions): string;
export function stripBom(content: string): string;
export interface StringifyOptions {
EOL?: string | undefined;
finalEOL?: boolean | undefined;
replacer?: ((key: string, value: any) => any) | undefined;
spaces?: string | number | undefined;
}

2
node_modules/@types/node/README.md generated vendored

@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
### Additional Details ### Additional Details
* Last updated: Mon, 26 Dec 2022 17:32:37 GMT * Last updated: Sat, 25 Mar 2023 22:33:05 GMT
* Dependencies: none * Dependencies: none
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone` * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`

@ -319,6 +319,16 @@ declare module 'async_hooks' {
*/ */
triggerAsyncId(): number; triggerAsyncId(): number;
} }
interface AsyncLocalStorageOptions<T> {
/**
* Optional callback invoked before a store is propagated to a new async resource.
* Returning `true` allows propagation, returning `false` avoids it. Default is to propagate always.
* @param type The type of async event.
* @param store The current store.
* @since v18.13.0
*/
onPropagate?: ((type: string, store: T) => boolean) | undefined;
}
/** /**
* This class creates stores that stay coherent through asynchronous operations. * This class creates stores that stay coherent through asynchronous operations.
* *
@ -368,6 +378,8 @@ declare module 'async_hooks' {
* @since v13.10.0, v12.17.0 * @since v13.10.0, v12.17.0
*/ */
class AsyncLocalStorage<T> { class AsyncLocalStorage<T> {
constructor(options?: AsyncLocalStorageOptions<T>);
/** /**
* Disables the instance of `AsyncLocalStorage`. All subsequent calls * Disables the instance of `AsyncLocalStorage`. All subsequent calls
* to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. * to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again.

68
node_modules/@types/node/buffer.d.ts generated vendored

@ -46,6 +46,8 @@
declare module 'buffer' { declare module 'buffer' {
import { BinaryLike } from 'node:crypto'; import { BinaryLike } from 'node:crypto';
import { ReadableStream as WebReadableStream } from 'node:stream/web'; import { ReadableStream as WebReadableStream } from 'node:stream/web';
export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
export function isAscii(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
export const INSPECT_MAX_BYTES: number; export const INSPECT_MAX_BYTES: number;
export const kMaxLength: number; export const kMaxLength: number;
export const kStringMaxLength: number; export const kStringMaxLength: number;
@ -163,17 +165,56 @@ declare module 'buffer' {
*/ */
stream(): WebReadableStream; stream(): WebReadableStream;
} }
export interface FileOptions {
/**
* One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be
* converted to the platform native line-ending as specified by `require('node:os').EOL`.
*/
endings?: 'native' | 'transparent';
/** The File content-type. */
type?: string;
/** The last modified date of the file. `Default`: Date.now(). */
lastModified?: number;
}
/**
* A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files.
* @experimental
* @since v18.13.0
*/
export class File extends Blob {
constructor(sources: Array<BinaryLike | Blob>, fileName: string, options?: FileOptions);
/**
* The name of the `File`.
* @since v18.13.0
*/
readonly name: string;
/**
* The last modified date of the `File`.
* @since v18.13.0
*/
readonly lastModified: number;
}
export import atob = globalThis.atob; export import atob = globalThis.atob;
export import btoa = globalThis.btoa; export import btoa = globalThis.btoa;
import { Blob as NodeBlob } from 'buffer'; import { Blob as NodeBlob } from 'buffer';
// This conditional type will be the existing global Blob in a browser, or // This conditional type will be the existing global Blob in a browser, or
// the copy below in a Node environment. // the copy below in a Node environment.
type __Blob = typeof globalThis extends { onmessage: any, Blob: infer T } type __Blob = typeof globalThis extends { onmessage: any; Blob: infer T } ? T : NodeBlob;
? T : NodeBlob;
global { global {
// Buffer class // Buffer class
type BufferEncoding = 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex'; type BufferEncoding =
| 'ascii'
| 'utf8'
| 'utf-8'
| 'utf16le'
| 'ucs2'
| 'ucs-2'
| 'base64'
| 'base64url'
| 'latin1'
| 'binary'
| 'hex';
type WithImplicitCoercion<T> = type WithImplicitCoercion<T> =
| T | T
| { | {
@ -247,7 +288,11 @@ declare module 'buffer' {
* `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does. * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does.
* @since v5.10.0 * @since v5.10.0
*/ */
from(arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>, byteOffset?: number, length?: number): Buffer; from(
arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>,
byteOffset?: number,
length?: number,
): Buffer;
/** /**
* Creates a new Buffer using the passed {data} * Creates a new Buffer using the passed {data}
* @param data data to create a new Buffer * @param data data to create a new Buffer
@ -265,7 +310,7 @@ declare module 'buffer' {
| { | {
[Symbol.toPrimitive](hint: 'string'): string; [Symbol.toPrimitive](hint: 'string'): string;
}, },
encoding?: BufferEncoding encoding?: BufferEncoding,
): Buffer; ): Buffer;
/** /**
* Creates a new Buffer using the passed {data} * Creates a new Buffer using the passed {data}
@ -339,7 +384,10 @@ declare module 'buffer' {
* @param [encoding='utf8'] If `string` is a string, this is its encoding. * @param [encoding='utf8'] If `string` is a string, this is its encoding.
* @return The number of bytes contained within `string`. * @return The number of bytes contained within `string`.
*/ */
byteLength(string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, encoding?: BufferEncoding): number; byteLength(
string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
encoding?: BufferEncoding,
): number;
/** /**
* Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together. * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together.
* *
@ -710,7 +758,13 @@ declare module 'buffer' {
* @param [sourceStart=0] The offset within `buf` at which to begin comparison. * @param [sourceStart=0] The offset within `buf` at which to begin comparison.
* @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive). * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive).
*/ */
compare(target: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): -1 | 0 | 1; compare(
target: Uint8Array,
targetStart?: number,
targetEnd?: number,
sourceStart?: number,
sourceEnd?: number,
): -1 | 0 | 1;
/** /**
* Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`. * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`.
* *

21
node_modules/@types/node/crypto.d.ts generated vendored

@ -1190,11 +1190,13 @@ declare module 'crypto' {
format?: KeyFormat | undefined; format?: KeyFormat | undefined;
type?: 'pkcs1' | 'pkcs8' | 'sec1' | undefined; type?: 'pkcs1' | 'pkcs8' | 'sec1' | undefined;
passphrase?: string | Buffer | undefined; passphrase?: string | Buffer | undefined;
encoding?: string | undefined;
} }
interface PublicKeyInput { interface PublicKeyInput {
key: string | Buffer; key: string | Buffer;
format?: KeyFormat | undefined; format?: KeyFormat | undefined;
type?: 'pkcs1' | 'spki' | undefined; type?: 'pkcs1' | 'spki' | undefined;
encoding?: string | undefined;
} }
/** /**
* Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. * Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`.
@ -1305,6 +1307,7 @@ declare module 'crypto' {
interface VerifyKeyObjectInput extends SigningOptions { interface VerifyKeyObjectInput extends SigningOptions {
key: KeyObject; key: KeyObject;
} }
interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
type KeyLike = string | Buffer | KeyObject; type KeyLike = string | Buffer | KeyObject;
/** /**
* The `Sign` class is a utility for generating signatures. It can be used in one * The `Sign` class is a utility for generating signatures. It can be used in one
@ -1459,8 +1462,8 @@ declare module 'crypto' {
* be passed instead of a public key. * be passed instead of a public key.
* @since v0.1.92 * @since v0.1.92
*/ */
verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean; verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, signature: NodeJS.ArrayBufferView): boolean;
verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: string, signature_format?: BinaryToTextEncoding): boolean; verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, signature: string, signature_format?: BinaryToTextEncoding): boolean;
} }
/** /**
* Creates a `DiffieHellman` key exchange object using the supplied `prime` and an * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an
@ -2968,11 +2971,16 @@ declare module 'crypto' {
* If the `callback` function is provided this function uses libuv's threadpool. * If the `callback` function is provided this function uses libuv's threadpool.
* @since v12.0.0 * @since v12.0.0
*/ */
function verify(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean;
function verify( function verify(
algorithm: string | null | undefined, algorithm: string | null | undefined,
data: NodeJS.ArrayBufferView, data: NodeJS.ArrayBufferView,
key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
signature: NodeJS.ArrayBufferView
): boolean;
function verify(
algorithm: string | null | undefined,
data: NodeJS.ArrayBufferView,
key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
signature: NodeJS.ArrayBufferView, signature: NodeJS.ArrayBufferView,
callback: (error: Error | null, result: boolean) => void callback: (error: Error | null, result: boolean) => void
): void; ): void;
@ -3121,12 +3129,13 @@ declare module 'crypto' {
*/ */
disableEntropyCache?: boolean | undefined; disableEntropyCache?: boolean | undefined;
} }
type UUID = `${string}-${string}-${string}-${string}-${string}`;
/** /**
* Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a
* cryptographic pseudorandom number generator. * cryptographic pseudorandom number generator.
* @since v15.6.0, v14.17.0 * @since v15.6.0, v14.17.0
*/ */
function randomUUID(options?: RandomUUIDOptions): string; function randomUUID(options?: RandomUUIDOptions): UUID;
interface X509CheckOptions { interface X509CheckOptions {
/** /**
* @default 'always' * @default 'always'
@ -3638,7 +3647,7 @@ declare module 'crypto' {
* The UUID is generated using a cryptographic pseudorandom number generator. * The UUID is generated using a cryptographic pseudorandom number generator.
* @since v16.7.0 * @since v16.7.0
*/ */
randomUUID(): string; randomUUID(): UUID;
CryptoKey: CryptoKeyConstructor; CryptoKey: CryptoKeyConstructor;
} }
// This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable. // This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable.

@ -58,6 +58,45 @@ declare module 'diagnostics_channel' {
*/ */
function channel(name: string | symbol): Channel; function channel(name: string | symbol): Channel;
type ChannelListener = (message: unknown, name: string | symbol) => void; type ChannelListener = (message: unknown, name: string | symbol) => void;
/**
* Register a message handler to subscribe to this channel. This message handler will be run synchronously
* whenever a message is published to the channel. Any errors thrown in the message handler will
* trigger an 'uncaughtException'.
*
* ```js
* import diagnostics_channel from 'diagnostics_channel';
*
* diagnostics_channel.subscribe('my-channel', (message, name) => {
* // Received data
* });
* ```
*
* @since v18.7.0, v16.17.0
* @param name The channel name
* @param onMessage The handler to receive channel messages
*/
function subscribe(name: string | symbol, onMessage: ChannelListener): void;
/**
* Remove a message handler previously registered to this channel with diagnostics_channel.subscribe(name, onMessage).
*
* ```js
* import diagnostics_channel from 'diagnostics_channel';
*
* function onMessage(message, name) {
* // Received data
* }
*
* diagnostics_channel.subscribe('my-channel', onMessage);
*
* diagnostics_channel.unsubscribe('my-channel', onMessage);
* ```
*
* @since v18.7.0, v16.17.0
* @param name The channel name
* @param onMessage The previous subscribed handler to remove
* @returns `true` if the handler was found, `false` otherwise
*/
function unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean;
/** /**
* The class `Channel` represents an individual named channel within the data * The class `Channel` represents an individual named channel within the data
* pipeline. It is use to track subscribers and to publish messages when there * pipeline. It is use to track subscribers and to publish messages when there

2
node_modules/@types/node/dns.d.ts generated vendored

@ -174,7 +174,7 @@ declare module 'dns' {
type: 'AAAA'; type: 'AAAA';
} }
export interface CaaRecord { export interface CaaRecord {
critial: number; critical: number;
issue?: string | undefined; issue?: string | undefined;
issuewild?: string | undefined; issuewild?: string | undefined;
iodef?: string | undefined; iodef?: string | undefined;

100
node_modules/@types/node/fs.d.ts generated vendored

@ -131,6 +131,42 @@ declare module 'fs' {
* @since v0.1.21 * @since v0.1.21
*/ */
export class Stats {} export class Stats {}
export interface StatsFsBase<T> {
/** Type of file system. */
type: T;
/** Optimal transfer block size. */
bsize: T;
/** Total data blocks in file system. */
blocks: T;
/** Free blocks in file system. */
bfree: T;
/** Available blocks for unprivileged users */
bavail: T;
/** Total file nodes in file system. */
files: T;
/** Free file nodes in file system. */
ffree: T;
}
export interface StatsFs extends StatsFsBase<number> {}
/**
* Provides information about a mounted file system
*
* Objects returned from {@link statfs} and {@link statfsSync} are of this type.
* If `bigint` in the `options` passed to those methods is true, the numeric values
* will be `bigint` instead of `number`.
* @since v18.15.0
*/
export class StatsFs {}
export interface BigIntStatsFs extends StatsFsBase<bigint> {}
export interface StatFsOptions {
bigint?: boolean | undefined;
}
/** /**
* A representation of a directory entry, which can be a file or a subdirectory * A representation of a directory entry, which can be a file or a subdirectory
* within the directory, as returned by reading from an `fs.Dir`. The * within the directory, as returned by reading from an `fs.Dir`. The
@ -1081,6 +1117,70 @@ declare module 'fs' {
): Promise<BigIntStats>; ): Promise<BigIntStats>;
function __promisify__(path: PathLike, options?: StatOptions): Promise<Stats | BigIntStats>; function __promisify__(path: PathLike, options?: StatOptions): Promise<Stats | BigIntStats>;
} }
/**
* Asynchronous statfs(2). Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an <fs.StatFs> object.
* In case of an error, the err.code will be one of Common System Errors.
* @param path A path to an existing file or directory on the file system to be queried.
* @param callback
*/
export function statfs(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void): void;
export function statfs(
path: PathLike,
options:
| (StatFsOptions & {
bigint?: false | undefined;
})
| undefined,
callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void
): void;
export function statfs(
path: PathLike,
options: StatFsOptions & {
bigint: true;
},
callback: (err: NodeJS.ErrnoException | null, stats: BigIntStatsFs) => void
): void;
export function statfs(path: PathLike, options: StatFsOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs | BigIntStatsFs) => void): void;
export namespace statfs {
/**
* Asynchronous statfs(2) - Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an <fs.StatFs> object.
* @param path A path to an existing file or directory on the file system to be queried.
*/
function __promisify__(
path: PathLike,
options?: StatFsOptions & {
bigint?: false | undefined;
}
): Promise<StatsFs>;
function __promisify__(
path: PathLike,
options: StatFsOptions & {
bigint: true;
}
): Promise<BigIntStatsFs>;
function __promisify__(path: PathLike, options?: StatFsOptions): Promise<StatsFs | BigIntStatsFs>;
}
/**
* Synchronous statfs(2). Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an <fs.StatFs> object.
* In case of an error, the err.code will be one of Common System Errors.
* @param path A path to an existing file or directory on the file system to be queried.
* @param callback
*/
export function statfsSync(
path: PathLike,
options?: StatFsOptions & {
bigint?: false | undefined;
}
): StatsFs;
export function statfsSync(
path: PathLike,
options: StatFsOptions & {
bigint: true;
}
): BigIntStatsFs;
export function statfsSync(path: PathLike, options?: StatFsOptions): StatsFs | BigIntStatsFs;
/** /**
* Synchronous lstat(2) - Get file status. Does not dereference symbolic links. * Synchronous lstat(2) - Get file status. Does not dereference symbolic links.
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.

@ -14,6 +14,7 @@ declare module 'fs/promises' {
import { ReadableStream } from 'node:stream/web'; import { ReadableStream } from 'node:stream/web';
import { import {
BigIntStats, BigIntStats,
BigIntStatsFs,
BufferEncodingOption, BufferEncodingOption,
constants as fsConstants, constants as fsConstants,
CopyOptions, CopyOptions,
@ -30,7 +31,9 @@ declare module 'fs/promises' {
RmDirOptions, RmDirOptions,
RmOptions, RmOptions,
StatOptions, StatOptions,
StatFsOptions,
Stats, Stats,
StatsFs,
TimeLike, TimeLike,
WatchEventType, WatchEventType,
WatchOptions, WatchOptions,
@ -745,6 +748,24 @@ declare module 'fs/promises' {
} }
): Promise<BigIntStats>; ): Promise<BigIntStats>;
function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>; function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
/**
* @since v18.15.0
* @return Fulfills with an {fs.StatFs} for the file system.
*/
function statfs(
path: PathLike,
opts?: StatFsOptions & {
bigint?: false | undefined;
}
): Promise<StatsFs>;
function statfs(
path: PathLike,
opts: StatFsOptions & {
bigint: true;
}
): Promise<BigIntStatsFs>;
function statfs(path: PathLike, opts?: StatFsOptions): Promise<StatsFs | BigIntStatsFs>;
/** /**
* Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail.
* @since v10.0.0 * @since v10.0.0

@ -53,7 +53,7 @@ interface AbortController {
/** /**
* Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
*/ */
abort(): void; abort(reason?: any): void;
} }
/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ /** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */

7
node_modules/@types/node/http.d.ts generated vendored

@ -144,6 +144,7 @@ declare module 'http' {
socketPath?: string | undefined; socketPath?: string | undefined;
timeout?: number | undefined; timeout?: number | undefined;
uniqueHeaders?: Array<string | string[]> | undefined; uniqueHeaders?: Array<string | string[]> | undefined;
joinDuplicateHeaders?: boolean;
} }
interface ServerOptions< interface ServerOptions<
Request extends typeof IncomingMessage = typeof IncomingMessage, Request extends typeof IncomingMessage = typeof IncomingMessage,
@ -164,6 +165,12 @@ declare module 'http' {
* @since v18.0.0 * @since v18.0.0
*/ */
requestTimeout?: number | undefined; requestTimeout?: number | undefined;
/**
* It joins the field line values of multiple headers in a request with `, ` instead of discarding the duplicates.
* @default false
* @since v18.14.0
*/
joinDuplicateHeaders?: boolean;
/** /**
* The number of milliseconds of inactivity a server needs to wait for additional incoming data, * The number of milliseconds of inactivity a server needs to wait for additional incoming data,
* after it has finished writing the last response, before a socket will be destroyed. * after it has finished writing the last response, before a socket will be destroyed.

@ -1053,7 +1053,6 @@ declare module 'http2' {
*/ */
unknownProtocolTimeout?: number | undefined; unknownProtocolTimeout?: number | undefined;
selectPadding?(frameLen: number, maxFrameLen: number): number; selectPadding?(frameLen: number, maxFrameLen: number): number;
createConnection?(authority: url.URL, option: SessionOptions): stream.Duplex;
} }
export interface ClientSessionOptions extends SessionOptions { export interface ClientSessionOptions extends SessionOptions {
maxReservedRemoteStreams?: number | undefined; maxReservedRemoteStreams?: number | undefined;

@ -1,4 +1,4 @@
// Type definitions for non-npm package Node.js 18.11 // Type definitions for non-npm package Node.js 18.15
// Project: https://nodejs.org/ // Project: https://nodejs.org/
// Definitions by: Microsoft TypeScript <https://github.com/Microsoft> // Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
// DefinitelyTyped <https://github.com/DefinitelyTyped> // DefinitelyTyped <https://github.com/DefinitelyTyped>

@ -85,6 +85,7 @@ declare module 'module' {
static wrap(code: string): string; static wrap(code: string): string;
static createRequire(path: string | URL): NodeRequire; static createRequire(path: string | URL): NodeRequire;
static builtinModules: string[]; static builtinModules: string[];
static isBuiltin(moduleName: string): boolean;
static Module: typeof Module; static Module: typeof Module;
constructor(id: string, parent?: Module); constructor(id: string, parent?: Module);
} }

14
node_modules/@types/node/net.d.ts generated vendored

@ -57,6 +57,14 @@ declare module 'net' {
noDelay?: boolean | undefined; noDelay?: boolean | undefined;
keepAlive?: boolean | undefined; keepAlive?: boolean | undefined;
keepAliveInitialDelay?: number | undefined; keepAliveInitialDelay?: number | undefined;
/**
* @since v18.13.0
*/
autoSelectFamily?: boolean | undefined;
/**
* @since v18.13.0
*/
autoSelectFamilyAttemptTimeout?: number | undefined;
} }
interface IpcSocketConnectOpts extends ConnectOpts { interface IpcSocketConnectOpts extends ConnectOpts {
path: string; path: string;
@ -261,6 +269,12 @@ declare module 'net' {
* @since v6.1.0 * @since v6.1.0
*/ */
readonly connecting: boolean; readonly connecting: boolean;
/**
* This is `true` if the socket is not connected yet, either because `.connect()`
* has not yet been called or because it is still in the process of connecting (see `socket.connecting`).
* @since v10.16.0
*/
readonly pending: boolean;
/** /**
* See `writable.destroyed` for further details. * See `writable.destroyed` for further details.
*/ */

7
node_modules/@types/node/os.d.ts generated vendored

@ -132,6 +132,13 @@ declare module 'os' {
* @since v0.3.3 * @since v0.3.3
*/ */
function cpus(): CpuInfo[]; function cpus(): CpuInfo[];
/**
* Returns an estimate of the default amount of parallelism a program should use. Always returns a value greater than zero.
*
* This function is a small wrapper about libuv's [`uv_available_parallelism()`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_available_parallelism).
* @since 18.4.0
*/
function availableParallelism(): number;
/** /**
* Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it
* returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows.

@ -1,6 +1,6 @@
{ {
"name": "@types/node", "name": "@types/node",
"version": "18.11.18", "version": "18.15.10",
"description": "TypeScript definitions for Node.js", "description": "TypeScript definitions for Node.js",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
"license": "MIT", "license": "MIT",
@ -232,6 +232,6 @@
}, },
"scripts": {}, "scripts": {},
"dependencies": {}, "dependencies": {},
"typesPublisherContentHash": "540ec74ad976942ed4b12e09fd57842adfd77a63a4ea099f15f0602ad707835c", "typesPublisherContentHash": "d968764271bc711c7d024195dad3ccfa3e82756092d060a8df0f5a57a517c842",
"typeScriptVersion": "4.2" "typeScriptVersion": "4.3"
} }

@ -1089,6 +1089,12 @@ declare module 'process' {
*/ */
mainModule?: Module | undefined; mainModule?: Module | undefined;
memoryUsage: MemoryUsageFn; memoryUsage: MemoryUsageFn;
/**
* Gets the amount of memory available to the process (in bytes) based on
* limits imposed by the OS. If there is no such constraint, or the constraint
* is unknown, `undefined` is returned.
*/
constrainedMemory(): number | undefined;
/** /**
* The `process.cpuUsage()` method returns the user and system CPU time usage of * The `process.cpuUsage()` method returns the user and system CPU time usage of
* the current process, in an object with properties `user` and `system`, whose * the current process, in an object with properties `user` and `system`, whose

99
node_modules/@types/node/stream.d.ts generated vendored

@ -912,6 +912,105 @@ declare module 'stream' {
end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this; end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this;
cork(): void; cork(): void;
uncork(): void; uncork(): void;
/**
* Event emitter
* The defined events on documents including:
* 1. close
* 2. data
* 3. drain
* 4. end
* 5. error
* 6. finish
* 7. pause
* 8. pipe
* 9. readable
* 10. resume
* 11. unpipe
*/
addListener(event: 'close', listener: () => void): this;
addListener(event: 'data', listener: (chunk: any) => void): this;
addListener(event: 'drain', listener: () => void): this;
addListener(event: 'end', listener: () => void): this;
addListener(event: 'error', listener: (err: Error) => void): this;
addListener(event: 'finish', listener: () => void): this;
addListener(event: 'pause', listener: () => void): this;
addListener(event: 'pipe', listener: (src: Readable) => void): this;
addListener(event: 'readable', listener: () => void): this;
addListener(event: 'resume', listener: () => void): this;
addListener(event: 'unpipe', listener: (src: Readable) => void): this;
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
emit(event: 'close'): boolean;
emit(event: 'data', chunk: any): boolean;
emit(event: 'drain'): boolean;
emit(event: 'end'): boolean;
emit(event: 'error', err: Error): boolean;
emit(event: 'finish'): boolean;
emit(event: 'pause'): boolean;
emit(event: 'pipe', src: Readable): boolean;
emit(event: 'readable'): boolean;
emit(event: 'resume'): boolean;
emit(event: 'unpipe', src: Readable): boolean;
emit(event: string | symbol, ...args: any[]): boolean;
on(event: 'close', listener: () => void): this;
on(event: 'data', listener: (chunk: any) => void): this;
on(event: 'drain', listener: () => void): this;
on(event: 'end', listener: () => void): this;
on(event: 'error', listener: (err: Error) => void): this;
on(event: 'finish', listener: () => void): this;
on(event: 'pause', listener: () => void): this;
on(event: 'pipe', listener: (src: Readable) => void): this;
on(event: 'readable', listener: () => void): this;
on(event: 'resume', listener: () => void): this;
on(event: 'unpipe', listener: (src: Readable) => void): this;
on(event: string | symbol, listener: (...args: any[]) => void): this;
once(event: 'close', listener: () => void): this;
once(event: 'data', listener: (chunk: any) => void): this;
once(event: 'drain', listener: () => void): this;
once(event: 'end', listener: () => void): this;
once(event: 'error', listener: (err: Error) => void): this;
once(event: 'finish', listener: () => void): this;
once(event: 'pause', listener: () => void): this;
once(event: 'pipe', listener: (src: Readable) => void): this;
once(event: 'readable', listener: () => void): this;
once(event: 'resume', listener: () => void): this;
once(event: 'unpipe', listener: (src: Readable) => void): this;
once(event: string | symbol, listener: (...args: any[]) => void): this;
prependListener(event: 'close', listener: () => void): this;
prependListener(event: 'data', listener: (chunk: any) => void): this;
prependListener(event: 'drain', listener: () => void): this;
prependListener(event: 'end', listener: () => void): this;
prependListener(event: 'error', listener: (err: Error) => void): this;
prependListener(event: 'finish', listener: () => void): this;
prependListener(event: 'pause', listener: () => void): this;
prependListener(event: 'pipe', listener: (src: Readable) => void): this;
prependListener(event: 'readable', listener: () => void): this;
prependListener(event: 'resume', listener: () => void): this;
prependListener(event: 'unpipe', listener: (src: Readable) => void): this;
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'close', listener: () => void): this;
prependOnceListener(event: 'data', listener: (chunk: any) => void): this;
prependOnceListener(event: 'drain', listener: () => void): this;
prependOnceListener(event: 'end', listener: () => void): this;
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
prependOnceListener(event: 'finish', listener: () => void): this;
prependOnceListener(event: 'pause', listener: () => void): this;
prependOnceListener(event: 'pipe', listener: (src: Readable) => void): this;
prependOnceListener(event: 'readable', listener: () => void): this;
prependOnceListener(event: 'resume', listener: () => void): this;
prependOnceListener(event: 'unpipe', listener: (src: Readable) => void): this;
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
removeListener(event: 'close', listener: () => void): this;
removeListener(event: 'data', listener: (chunk: any) => void): this;
removeListener(event: 'drain', listener: () => void): this;
removeListener(event: 'end', listener: () => void): this;
removeListener(event: 'error', listener: (err: Error) => void): this;
removeListener(event: 'finish', listener: () => void): this;
removeListener(event: 'pause', listener: () => void): this;
removeListener(event: 'pipe', listener: (src: Readable) => void): this;
removeListener(event: 'readable', listener: () => void): this;
removeListener(event: 'resume', listener: () => void): this;
removeListener(event: 'unpipe', listener: (src: Readable) => void): this;
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
} }
type TransformCallback = (error?: Error | null, data?: any) => void; type TransformCallback = (error?: Error | null, data?: any) => void;
interface TransformOptions extends DuplexOptions { interface TransformOptions extends DuplexOptions {

380
node_modules/@types/node/test.d.ts generated vendored

@ -7,16 +7,16 @@ declare module 'node:test' {
* Programmatically start the test runner. * Programmatically start the test runner.
* @since v18.9.0 * @since v18.9.0
* @param options Configuration options for running tests. * @param options Configuration options for running tests.
* @returns A {@link TapStream} that emits events about the test execution. * @returns A {@link TestsStream} that emits events about the test execution.
*/ */
function run(options?: RunOptions): TapStream; function run(options?: RunOptions): TestsStream;
/** /**
* The `test()` function is the value imported from the test module. Each invocation of this * The `test()` function is the value imported from the test module. Each invocation of this
* function results in the creation of a test point in the TAP output. * function results in reporting the test to the {@link TestsStream}.
* *
* The {@link TestContext} object passed to the fn argument can be used to perform actions * The {@link TestContext} object passed to the fn argument can be used to perform actions
* related to the current test. Examples include skipping the test, adding additional TAP * related to the current test. Examples include skipping the test, adding additional
* diagnostic information, or creating subtests. * diagnostic information, or creating subtests.
* *
* `test()` returns a {@link Promise} that resolves once the test completes. The return value * `test()` returns a {@link Promise} that resolves once the test completes. The return value
@ -158,54 +158,88 @@ declare module 'node:test' {
} }
/** /**
* A successful call of the `run()` method will return a new `TapStream` object, * A successful call of the `run()` method will return a new `TestsStream` object,
* streaming a [TAP](https://testanything.org/) output. * streaming a series of events representing the execution of the tests.
* `TapStream` will emit events in the order of the tests' definitions. * `TestsStream` will emit events in the order of the tests' definitions.
* @since v18.9.0 * @since v18.9.0
*/ */
interface TapStream extends NodeJS.ReadableStream { interface TestsStream extends NodeJS.ReadableStream {
addListener(event: 'test:diagnostic', listener: (message: string) => void): this; addListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
addListener(event: 'test:fail', listener: (data: TestFail) => void): this; addListener(event: 'test:fail', listener: (data: TestFail) => void): this;
addListener(event: 'test:pass', listener: (data: TestPass) => void): this; addListener(event: 'test:pass', listener: (data: TestPass) => void): this;
addListener(event: 'test:plan', listener: (data: TestPlan) => void): this;
addListener(event: 'test:start', listener: (data: TestStart) => void): this;
addListener(event: string, listener: (...args: any[]) => void): this; addListener(event: string, listener: (...args: any[]) => void): this;
emit(event: 'test:diagnostic', message: string): boolean; emit(event: 'test:diagnostic', data: DiagnosticData): boolean;
emit(event: 'test:fail', data: TestFail): boolean; emit(event: 'test:fail', data: TestFail): boolean;
emit(event: 'test:pass', data: TestPass): boolean; emit(event: 'test:pass', data: TestPass): boolean;
emit(event: 'test:plan', data: TestPlan): boolean;
emit(event: 'test:start', data: TestStart): boolean;
emit(event: string | symbol, ...args: any[]): boolean; emit(event: string | symbol, ...args: any[]): boolean;
on(event: 'test:diagnostic', listener: (message: string) => void): this; on(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
on(event: 'test:fail', listener: (data: TestFail) => void): this; on(event: 'test:fail', listener: (data: TestFail) => void): this;
on(event: 'test:pass', listener: (data: TestPass) => void): this; on(event: 'test:pass', listener: (data: TestPass) => void): this;
on(event: 'test:plan', listener: (data: TestPlan) => void): this;
on(event: 'test:start', listener: (data: TestStart) => void): this;
on(event: string, listener: (...args: any[]) => void): this; on(event: string, listener: (...args: any[]) => void): this;
once(event: 'test:diagnostic', listener: (message: string) => void): this; once(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
once(event: 'test:fail', listener: (data: TestFail) => void): this; once(event: 'test:fail', listener: (data: TestFail) => void): this;
once(event: 'test:pass', listener: (data: TestPass) => void): this; once(event: 'test:pass', listener: (data: TestPass) => void): this;
once(event: 'test:plan', listener: (data: TestPlan) => void): this;
once(event: 'test:start', listener: (data: TestStart) => void): this;
once(event: string, listener: (...args: any[]) => void): this; once(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'test:diagnostic', listener: (message: string) => void): this; prependListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
prependListener(event: 'test:fail', listener: (data: TestFail) => void): this; prependListener(event: 'test:fail', listener: (data: TestFail) => void): this;
prependListener(event: 'test:pass', listener: (data: TestPass) => void): this; prependListener(event: 'test:pass', listener: (data: TestPass) => void): this;
prependListener(event: 'test:plan', listener: (data: TestPlan) => void): this;
prependListener(event: 'test:start', listener: (data: TestStart) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this; prependListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'test:diagnostic', listener: (message: string) => void): this; prependOnceListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
prependOnceListener(event: 'test:fail', listener: (data: TestFail) => void): this; prependOnceListener(event: 'test:fail', listener: (data: TestFail) => void): this;
prependOnceListener(event: 'test:pass', listener: (data: TestPass) => void): this; prependOnceListener(event: 'test:pass', listener: (data: TestPass) => void): this;
prependOnceListener(event: 'test:plan', listener: (data: TestPlan) => void): this;
prependOnceListener(event: 'test:start', listener: (data: TestStart) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this; prependOnceListener(event: string, listener: (...args: any[]) => void): this;
} }
interface DiagnosticData {
/**
* The diagnostic message.
*/
message: string;
/**
* The nesting level of the test.
*/
nesting: number;
}
interface TestFail { interface TestFail {
/** /**
* The test duration. * Additional execution metadata.
*/ */
duration: number; details: {
/**
* The duration of the test in milliseconds.
*/
duration: number;
/** /**
* The failure casing test to fail. * The error thrown by the test.
*/ */
error: Error; error: Error;
};
/** /**
* The test name. * The test name.
*/ */
name: string; name: string;
/**
* The nesting level of the test.
*/
nesting: number;
/** /**
* The ordinal number of the test. * The ordinal number of the test.
*/ */
@ -214,25 +248,35 @@ declare module 'node:test' {
/** /**
* Present if `context.todo` is called. * Present if `context.todo` is called.
*/ */
todo?: string; todo?: string | boolean;
/** /**
* Present if `context.skip` is called. * Present if `context.skip` is called.
*/ */
skip?: string; skip?: string | boolean;
} }
interface TestPass { interface TestPass {
/** /**
* The test duration. * Additional execution metadata.
*/ */
duration: number; details: {
/**
* The duration of the test in milliseconds.
*/
duration: number;
};
/** /**
* The test name. * The test name.
*/ */
name: string; name: string;
/**
* The nesting level of the test.
*/
nesting: number;
/** /**
* The ordinal number of the test. * The ordinal number of the test.
*/ */
@ -241,12 +285,36 @@ declare module 'node:test' {
/** /**
* Present if `context.todo` is called. * Present if `context.todo` is called.
*/ */
todo?: string; todo?: string | boolean;
/** /**
* Present if `context.skip` is called. * Present if `context.skip` is called.
*/ */
skip?: string; skip?: string | boolean;
}
interface TestPlan {
/**
* The nesting level of the test.
*/
nesting: number;
/**
* The number of subtests that have ran.
*/
count: number;
}
interface TestStart {
/**
* The test name.
*/
name: string;
/**
* The nesting level of the test.
*/
nesting: number;
} }
/** /**
@ -264,6 +332,15 @@ declare module 'node:test' {
*/ */
beforeEach: typeof beforeEach; beforeEach: typeof beforeEach;
/**
* This function is used to create a hook that runs after the current test finishes.
* @param fn The hook function. If the hook uses callbacks, the callback function is passed as
* the second argument. Default: A no-op function.
* @param options Configuration options for the hook.
* @since v18.13.0
*/
after: typeof after;
/** /**
* This function is used to create a hook running after each subtest of the current test. * This function is used to create a hook running after each subtest of the current test.
* @param fn The hook function. If the hook uses callbacks, the callback function is passed as * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
@ -274,9 +351,9 @@ declare module 'node:test' {
afterEach: typeof afterEach; afterEach: typeof afterEach;
/** /**
* This function is used to write TAP diagnostics to the output. Any diagnostic information is * This function is used to write diagnostics to the output. Any diagnostic information is
* included at the end of the test's results. This function does not return a value. * included at the end of the test's results. This function does not return a value.
* @param message Message to be displayed as a TAP diagnostic. * @param message Message to be reported.
* @since v18.0.0 * @since v18.0.0
*/ */
diagnostic(message: string): void; diagnostic(message: string): void;
@ -304,18 +381,18 @@ declare module 'node:test' {
/** /**
* This function causes the test's output to indicate the test as skipped. If `message` is * This function causes the test's output to indicate the test as skipped. If `message` is
* provided, it is included in the TAP output. Calling `skip()` does not terminate execution of * provided, it is included in the output. Calling `skip()` does not terminate execution of
* the test function. This function does not return a value. * the test function. This function does not return a value.
* @param message Optional skip message to be displayed in TAP output. * @param message Optional skip message.
* @since v18.0.0 * @since v18.0.0
*/ */
skip(message?: string): void; skip(message?: string): void;
/** /**
* This function adds a `TODO` directive to the test's output. If `message` is provided, it is * This function adds a `TODO` directive to the test's output. If `message` is provided, it is
* included in the TAP output. Calling `todo()` does not terminate execution of the test * included in the output. Calling `todo()` does not terminate execution of the test
* function. This function does not return a value. * function. This function does not return a value.
* @param message Optional `TODO` message to be displayed in TAP output. * @param message Optional `TODO` message.
* @since v18.0.0 * @since v18.0.0
*/ */
todo(message?: string): void; todo(message?: string): void;
@ -333,6 +410,10 @@ declare module 'node:test' {
* @returns A {@link Promise} resolved with `undefined` once the test completes. * @returns A {@link Promise} resolved with `undefined` once the test completes.
*/ */
test: typeof test; test: typeof test;
/**
* Each test provides its own MockTracker instance.
*/
readonly mock: MockTracker;
} }
interface TestOptions { interface TestOptions {
@ -442,5 +523,238 @@ declare module 'node:test' {
timeout?: number | undefined; timeout?: number | undefined;
} }
export { test as default, run, test, describe, it, before, after, beforeEach, afterEach }; interface MockFunctionOptions {
/**
* The number of times that the mock will use the behavior of `implementation`.
* Once the mock function has been called `times` times,
* it will automatically restore the behavior of `original`.
* This value must be an integer greater than zero.
* @default Infinity
*/
times?: number | undefined;
}
interface MockMethodOptions extends MockFunctionOptions {
/**
* If `true`, `object[methodName]` is treated as a getter.
* This option cannot be used with the `setter` option.
*/
getter?: boolean | undefined;
/**
* If `true`, `object[methodName]` is treated as a setter.
* This option cannot be used with the `getter` option.
*/
setter?: boolean | undefined;
}
type Mock<F extends Function> = F & {
mock: MockFunctionContext<F>;
};
type NoOpFunction = (...args: any[]) => undefined;
type FunctionPropertyNames<T> = {
[K in keyof T]: T[K] extends Function ? K : never;
}[keyof T];
interface MockTracker {
/**
* This function is used to create a mock function.
* @param original An optional function to create a mock on.
* @param implementation An optional function used as the mock implementation for `original`.
* This is useful for creating mocks that exhibit one behavior for a specified number of calls and then restore the behavior of `original`.
* @param options Optional configuration options for the mock function.
*/
fn<F extends Function = NoOpFunction>(original?: F, options?: MockFunctionOptions): Mock<F>;
fn<F extends Function = NoOpFunction, Implementation extends Function = F>(original?: F, implementation?: Implementation, options?: MockFunctionOptions): Mock<F | Implementation>;
/**
* This function is used to create a mock on an existing object method.
* @param object The object whose method is being mocked.
* @param methodName The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown.
* @param implementation An optional function used as the mock implementation for `object[methodName]`.
* @param options Optional configuration options for the mock method.
*/
method<
MockedObject extends object,
MethodName extends FunctionPropertyNames<MockedObject>,
>(
object: MockedObject,
methodName: MethodName,
options?: MockFunctionOptions,
): MockedObject[MethodName] extends Function
? Mock<MockedObject[MethodName]>
: never;
method<
MockedObject extends object,
MethodName extends FunctionPropertyNames<MockedObject>,
Implementation extends Function,
>(
object: MockedObject,
methodName: MethodName,
implementation: Implementation,
options?: MockFunctionOptions,
): MockedObject[MethodName] extends Function
? Mock<MockedObject[MethodName] | Implementation>
: never;
method<MockedObject extends object>(
object: MockedObject,
methodName: keyof MockedObject,
options: MockMethodOptions,
): Mock<Function>;
method<MockedObject extends object>(
object: MockedObject,
methodName: keyof MockedObject,
implementation: Function,
options: MockMethodOptions,
): Mock<Function>;
/**
* This function is syntax sugar for {@link MockTracker.method} with `options.getter` set to `true`.
*/
getter<
MockedObject extends object,
MethodName extends keyof MockedObject,
>(
object: MockedObject,
methodName: MethodName,
options?: MockFunctionOptions,
): Mock<() => MockedObject[MethodName]>;
getter<
MockedObject extends object,
MethodName extends keyof MockedObject,
Implementation extends Function,
>(
object: MockedObject,
methodName: MethodName,
implementation?: Implementation,
options?: MockFunctionOptions,
): Mock<(() => MockedObject[MethodName]) | Implementation>;
/**
* This function is syntax sugar for {@link MockTracker.method} with `options.setter` set to `true`.
*/
setter<
MockedObject extends object,
MethodName extends keyof MockedObject,
>(
object: MockedObject,
methodName: MethodName,
options?: MockFunctionOptions,
): Mock<(value: MockedObject[MethodName]) => void>;
setter<
MockedObject extends object,
MethodName extends keyof MockedObject,
Implementation extends Function,
>(
object: MockedObject,
methodName: MethodName,
implementation?: Implementation,
options?: MockFunctionOptions,
): Mock<((value: MockedObject[MethodName]) => void) | Implementation>;
/**
* This function restores the default behavior of all mocks that were previously created by this `MockTracker`
* and disassociates the mocks from the `MockTracker` instance. Once disassociated, the mocks can still be used,
* but the `MockTracker` instance can no longer be used to reset their behavior or otherwise interact with them.
*
* After each test completes, this function is called on the test context's `MockTracker`.
* If the global `MockTracker` is used extensively, calling this function manually is recommended.
*/
reset(): void;
/**
* This function restores the default behavior of all mocks that were previously created by this `MockTracker`.
* Unlike `mock.reset()`, `mock.restoreAll()` does not disassociate the mocks from the `MockTracker` instance.
*/
restoreAll(): void;
}
const mock: MockTracker;
interface MockFunctionCall<
F extends Function,
ReturnType = F extends (...args: any) => infer T
? T
: F extends abstract new (...args: any) => infer T
? T
: unknown,
Args = F extends (...args: infer Y) => any
? Y
: F extends abstract new (...args: infer Y) => any
? Y
: unknown[],
> {
/**
* An array of the arguments passed to the mock function.
*/
arguments: Args;
/**
* If the mocked function threw then this property contains the thrown value.
*/
error: unknown | undefined;
/**
* The value returned by the mocked function.
*
* If the mocked function threw, it will be `undefined`.
*/
result: ReturnType | undefined;
/**
* An `Error` object whose stack can be used to determine the callsite of the mocked function invocation.
*/
stack: Error;
/**
* If the mocked function is a constructor, this field contains the class being constructed.
* Otherwise this will be `undefined`.
*/
target: F extends abstract new (...args: any) => any ? F : undefined;
/**
* The mocked function's `this` value.
*/
this: unknown;
}
interface MockFunctionContext<F extends Function> {
/**
* A getter that returns a copy of the internal array used to track calls to the mock.
*/
readonly calls: Array<MockFunctionCall<F>>;
/**
* This function returns the number of times that this mock has been invoked.
* This function is more efficient than checking `ctx.calls.length`
* because `ctx.calls` is a getter that creates a copy of the internal call tracking array.
*/
callCount(): number;
/**
* This function is used to change the behavior of an existing mock.
* @param implementation The function to be used as the mock's new implementation.
*/
mockImplementation(implementation: Function): void;
/**
* This function is used to change the behavior of an existing mock for a single invocation.
* Once invocation `onCall` has occurred, the mock will revert to whatever behavior
* it would have used had `mockImplementationOnce()` not been called.
* @param implementation The function to be used as the mock's implementation for the invocation number specified by `onCall`.
* @param onCall The invocation number that will use `implementation`.
* If the specified invocation has already occurred then an exception is thrown.
*/
mockImplementationOnce(implementation: Function, onCall?: number): void;
/**
* Resets the call history of the mock function.
*/
resetCalls(): void;
/**
* Resets the implementation of the mock function to its original behavior.
* The mock can still be used after calling this function.
*/
restore(): void;
}
export { test as default, run, test, describe, it, before, after, beforeEach, afterEach, mock };
} }

@ -62,6 +62,13 @@ declare module 'timers' {
[Symbol.toPrimitive](): number; [Symbol.toPrimitive](): number;
} }
} }
/**
* Schedules execution of a one-time `callback` after `delay` milliseconds. The `callback` will likely not be invoked in precisely `delay` milliseconds.
* Node.js makes no guarantees about the exact timing of when callbacks will fire, nor of their ordering. The callback will be called as close as possible to the time specified.
* When `delay` is larger than `2147483647` or less than `1`, the `delay` will be set to `1`. Non-integer delays are truncated to an integer.
* If `callback` is not a function, a [TypeError](https://nodejs.org/api/errors.html#class-typeerror) will be thrown.
* @since v0.0.1
*/
function setTimeout<TArgs extends any[]>(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timeout; function setTimeout<TArgs extends any[]>(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timeout;
// util.promisify no rest args compability // util.promisify no rest args compability
// tslint:disable-next-line void-return // tslint:disable-next-line void-return

103
node_modules/@types/node/tls.d.ts generated vendored

@ -41,21 +41,100 @@ declare module 'tls' {
CN: string; CN: string;
} }
interface PeerCertificate { interface PeerCertificate {
subject: Certificate; /**
issuer: Certificate; * `true` if a Certificate Authority (CA), `false` otherwise.
subjectaltname: string; * @since v18.13.0
infoAccess: NodeJS.Dict<string[]>; */
modulus: string; ca: boolean;
exponent: string; /**
valid_from: string; * The DER encoded X.509 certificate data.
valid_to: string; */
fingerprint: string;
fingerprint256: string;
ext_key_usage: string[];
serialNumber: string;
raw: Buffer; raw: Buffer;
/**
* The certificate subject.
*/
subject: Certificate;
/**
* The certificate issuer, described in the same terms as the `subject`.
*/
issuer: Certificate;
/**
* The date-time the certificate is valid from.
*/
valid_from: string;
/**
* The date-time the certificate is valid to.
*/
valid_to: string;
/**
* The certificate serial number, as a hex string.
*/
serialNumber: string;
/**
* The SHA-1 digest of the DER encoded certificate.
* It is returned as a `:` separated hexadecimal string.
*/
fingerprint: string;
/**
* The SHA-256 digest of the DER encoded certificate.
* It is returned as a `:` separated hexadecimal string.
*/
fingerprint256: string;
/**
* The SHA-512 digest of the DER encoded certificate.
* It is returned as a `:` separated hexadecimal string.
*/
fingerprint512: string;
/**
* The extended key usage, a set of OIDs.
*/
ext_key_usage?: string[];
/**
* A string containing concatenated names for the subject,
* an alternative to the `subject` names.
*/
subjectaltname?: string;
/**
* An array describing the AuthorityInfoAccess, used with OCSP.
*/
infoAccess?: NodeJS.Dict<string[]>;
/**
* For RSA keys: The RSA bit size.
*
* For EC keys: The key size in bits.
*/
bits?: number;
/**
* The RSA exponent, as a string in hexadecimal number notation.
*/
exponent?: string;
/**
* The RSA modulus, as a hexadecimal string.
*/
modulus?: string;
/**
* The public key.
*/
pubkey?: Buffer;
/**
* The ASN.1 name of the OID of the elliptic curve.
* Well-known curves are identified by an OID.
* While it is unusual, it is possible that the curve
* is identified by its mathematical properties,
* in which case it will not have an OID.
*/
asn1Curve?: string;
/**
* The NIST name for the elliptic curve,if it has one
* (not all well-known curves have been assigned names by NIST).
*/
nistCurve?: string;
} }
interface DetailedPeerCertificate extends PeerCertificate { interface DetailedPeerCertificate extends PeerCertificate {
/**
* The issuer certificate object.
* For self-signed certificates, this may be a circular reference.
*/
issuerCertificate: DetailedPeerCertificate; issuerCertificate: DetailedPeerCertificate;
} }
interface CipherNameAndProtocol { interface CipherNameAndProtocol {

@ -319,6 +319,16 @@ declare module 'async_hooks' {
*/ */
triggerAsyncId(): number; triggerAsyncId(): number;
} }
interface AsyncLocalStorageOptions<T> {
/**
* Optional callback invoked before a store is propagated to a new async resource.
* Returning `true` allows propagation, returning `false` avoids it. Default is to propagate always.
* @param type The type of async event.
* @param store The current store.
* @since v18.13.0
*/
onPropagate?: ((type: string, store: T) => boolean) | undefined;
}
/** /**
* This class creates stores that stay coherent through asynchronous operations. * This class creates stores that stay coherent through asynchronous operations.
* *
@ -368,6 +378,8 @@ declare module 'async_hooks' {
* @since v13.10.0, v12.17.0 * @since v13.10.0, v12.17.0
*/ */
class AsyncLocalStorage<T> { class AsyncLocalStorage<T> {
constructor(options?: AsyncLocalStorageOptions<T>);
/** /**
* Disables the instance of `AsyncLocalStorage`. All subsequent calls * Disables the instance of `AsyncLocalStorage`. All subsequent calls
* to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. * to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again.

@ -46,6 +46,8 @@
declare module 'buffer' { declare module 'buffer' {
import { BinaryLike } from 'node:crypto'; import { BinaryLike } from 'node:crypto';
import { ReadableStream as WebReadableStream } from 'node:stream/web'; import { ReadableStream as WebReadableStream } from 'node:stream/web';
export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
export function isAscii(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
export const INSPECT_MAX_BYTES: number; export const INSPECT_MAX_BYTES: number;
export const kMaxLength: number; export const kMaxLength: number;
export const kStringMaxLength: number; export const kStringMaxLength: number;
@ -163,18 +165,57 @@ declare module 'buffer' {
*/ */
stream(): WebReadableStream; stream(): WebReadableStream;
} }
export interface FileOptions {
/**
* One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be
* converted to the platform native line-ending as specified by `require('node:os').EOL`.
*/
endings?: 'native' | 'transparent';
/** The File content-type. */
type?: string;
/** The last modified date of the file. `Default`: Date.now(). */
lastModified?: number;
}
/**
* A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files.
* @experimental
* @since v18.13.0
*/
export class File extends Blob {
constructor(sources: Array<BinaryLike | Blob>, fileName: string, options?: FileOptions);
/**
* The name of the `File`.
* @since v18.13.0
*/
readonly name: string;
/**
* The last modified date of the `File`.
* @since v18.13.0
*/
readonly lastModified: number;
}
export import atob = globalThis.atob; export import atob = globalThis.atob;
export import btoa = globalThis.btoa; export import btoa = globalThis.btoa;
import { Blob as NodeBlob } from 'buffer'; import { Blob as NodeBlob } from 'buffer';
// This conditional type will be the existing global Blob in a browser, or // This conditional type will be the existing global Blob in a browser, or
// the copy below in a Node environment. // the copy below in a Node environment.
type __Blob = typeof globalThis extends { onmessage: any, Blob: any } type __Blob = typeof globalThis extends { onmessage: any; Blob: any } ? {} : NodeBlob;
? {} : NodeBlob;
global { global {
// Buffer class // Buffer class
type BufferEncoding = 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex'; type BufferEncoding =
| 'ascii'
| 'utf8'
| 'utf-8'
| 'utf16le'
| 'ucs2'
| 'ucs-2'
| 'base64'
| 'base64url'
| 'latin1'
| 'binary'
| 'hex';
type WithImplicitCoercion<T> = type WithImplicitCoercion<T> =
| T | T
| { | {
@ -248,7 +289,11 @@ declare module 'buffer' {
* `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does. * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does.
* @since v5.10.0 * @since v5.10.0
*/ */
from(arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>, byteOffset?: number, length?: number): Buffer; from(
arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>,
byteOffset?: number,
length?: number,
): Buffer;
/** /**
* Creates a new Buffer using the passed {data} * Creates a new Buffer using the passed {data}
* @param data data to create a new Buffer * @param data data to create a new Buffer
@ -266,7 +311,7 @@ declare module 'buffer' {
| { | {
[Symbol.toPrimitive](hint: 'string'): string; [Symbol.toPrimitive](hint: 'string'): string;
}, },
encoding?: BufferEncoding encoding?: BufferEncoding,
): Buffer; ): Buffer;
/** /**
* Creates a new Buffer using the passed {data} * Creates a new Buffer using the passed {data}
@ -340,7 +385,10 @@ declare module 'buffer' {
* @param [encoding='utf8'] If `string` is a string, this is its encoding. * @param [encoding='utf8'] If `string` is a string, this is its encoding.
* @return The number of bytes contained within `string`. * @return The number of bytes contained within `string`.
*/ */
byteLength(string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, encoding?: BufferEncoding): number; byteLength(
string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
encoding?: BufferEncoding,
): number;
/** /**
* Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together. * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together.
* *
@ -711,7 +759,13 @@ declare module 'buffer' {
* @param [sourceStart=0] The offset within `buf` at which to begin comparison. * @param [sourceStart=0] The offset within `buf` at which to begin comparison.
* @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive). * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive).
*/ */
compare(target: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): -1 | 0 | 1; compare(
target: Uint8Array,
targetStart?: number,
targetEnd?: number,
sourceStart?: number,
sourceEnd?: number,
): -1 | 0 | 1;
/** /**
* Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`. * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`.
* *

@ -1190,11 +1190,13 @@ declare module 'crypto' {
format?: KeyFormat | undefined; format?: KeyFormat | undefined;
type?: 'pkcs1' | 'pkcs8' | 'sec1' | undefined; type?: 'pkcs1' | 'pkcs8' | 'sec1' | undefined;
passphrase?: string | Buffer | undefined; passphrase?: string | Buffer | undefined;
encoding?: string | undefined;
} }
interface PublicKeyInput { interface PublicKeyInput {
key: string | Buffer; key: string | Buffer;
format?: KeyFormat | undefined; format?: KeyFormat | undefined;
type?: 'pkcs1' | 'spki' | undefined; type?: 'pkcs1' | 'spki' | undefined;
encoding?: string | undefined;
} }
/** /**
* Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. * Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`.
@ -1305,6 +1307,7 @@ declare module 'crypto' {
interface VerifyKeyObjectInput extends SigningOptions { interface VerifyKeyObjectInput extends SigningOptions {
key: KeyObject; key: KeyObject;
} }
interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
type KeyLike = string | Buffer | KeyObject; type KeyLike = string | Buffer | KeyObject;
/** /**
* The `Sign` class is a utility for generating signatures. It can be used in one * The `Sign` class is a utility for generating signatures. It can be used in one
@ -1459,8 +1462,8 @@ declare module 'crypto' {
* be passed instead of a public key. * be passed instead of a public key.
* @since v0.1.92 * @since v0.1.92
*/ */
verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean; verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, signature: NodeJS.ArrayBufferView): boolean;
verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: string, signature_format?: BinaryToTextEncoding): boolean; verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, signature: string, signature_format?: BinaryToTextEncoding): boolean;
} }
/** /**
* Creates a `DiffieHellman` key exchange object using the supplied `prime` and an * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an
@ -2968,11 +2971,16 @@ declare module 'crypto' {
* If the `callback` function is provided this function uses libuv's threadpool. * If the `callback` function is provided this function uses libuv's threadpool.
* @since v12.0.0 * @since v12.0.0
*/ */
function verify(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean;
function verify( function verify(
algorithm: string | null | undefined, algorithm: string | null | undefined,
data: NodeJS.ArrayBufferView, data: NodeJS.ArrayBufferView,
key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
signature: NodeJS.ArrayBufferView
): boolean;
function verify(
algorithm: string | null | undefined,
data: NodeJS.ArrayBufferView,
key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
signature: NodeJS.ArrayBufferView, signature: NodeJS.ArrayBufferView,
callback: (error: Error | null, result: boolean) => void callback: (error: Error | null, result: boolean) => void
): void; ): void;

@ -20,7 +20,7 @@
* should generally include the module name to avoid collisions with data from * should generally include the module name to avoid collisions with data from
* other modules. * other modules.
* @experimental * @experimental
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/diagnostics_channel.js) * @see [source](https://github.com/nodejs/node/blob/v18.7.0/lib/diagnostics_channel.js)
*/ */
declare module 'diagnostics_channel' { declare module 'diagnostics_channel' {
/** /**
@ -58,6 +58,45 @@ declare module 'diagnostics_channel' {
*/ */
function channel(name: string | symbol): Channel; function channel(name: string | symbol): Channel;
type ChannelListener = (message: unknown, name: string | symbol) => void; type ChannelListener = (message: unknown, name: string | symbol) => void;
/**
* Register a message handler to subscribe to this channel. This message handler will be run synchronously
* whenever a message is published to the channel. Any errors thrown in the message handler will
* trigger an 'uncaughtException'.
*
* ```js
* import diagnostics_channel from 'diagnostics_channel';
*
* diagnostics_channel.subscribe('my-channel', (message, name) => {
* // Received data
* });
* ```
*
* @since v18.7.0, v16.17.0
* @param name The channel name
* @param onMessage The handler to receive channel messages
*/
function subscribe(name: string | symbol, onMessage: ChannelListener): void;
/**
* Remove a message handler previously registered to this channel with diagnostics_channel.subscribe(name, onMessage).
*
* ```js
* import diagnostics_channel from 'diagnostics_channel';
*
* function onMessage(message, name) {
* // Received data
* }
*
* diagnostics_channel.subscribe('my-channel', onMessage);
*
* diagnostics_channel.unsubscribe('my-channel', onMessage);
* ```
*
* @since v18.7.0, v16.17.0
* @param name The channel name
* @param onMessage The previous subscribed handler to remove
* @returns `true` if the handler was found, `false` otherwise
*/
function unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean;
/** /**
* The class `Channel` represents an individual named channel within the data * The class `Channel` represents an individual named channel within the data
* pipeline. It is use to track subscribers and to publish messages when there * pipeline. It is use to track subscribers and to publish messages when there

@ -174,7 +174,7 @@ declare module 'dns' {
type: 'AAAA'; type: 'AAAA';
} }
export interface CaaRecord { export interface CaaRecord {
critial: number; critical: number;
issue?: string | undefined; issue?: string | undefined;
issuewild?: string | undefined; issuewild?: string | undefined;
iodef?: string | undefined; iodef?: string | undefined;

@ -53,7 +53,7 @@ interface AbortController {
/** /**
* Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
*/ */
abort(): void; abort(reason?: any): void;
} }
/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ /** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */

@ -1053,7 +1053,6 @@ declare module 'http2' {
*/ */
unknownProtocolTimeout?: number | undefined; unknownProtocolTimeout?: number | undefined;
selectPadding?(frameLen: number, maxFrameLen: number): number; selectPadding?(frameLen: number, maxFrameLen: number): number;
createConnection?(authority: url.URL, option: SessionOptions): stream.Duplex;
} }
export interface ClientSessionOptions extends SessionOptions { export interface ClientSessionOptions extends SessionOptions {
maxReservedRemoteStreams?: number | undefined; maxReservedRemoteStreams?: number | undefined;

@ -85,6 +85,7 @@ declare module 'module' {
static wrap(code: string): string; static wrap(code: string): string;
static createRequire(path: string | URL): NodeRequire; static createRequire(path: string | URL): NodeRequire;
static builtinModules: string[]; static builtinModules: string[];
static isBuiltin(moduleName: string): boolean;
static Module: typeof Module; static Module: typeof Module;
constructor(id: string, parent?: Module); constructor(id: string, parent?: Module);
} }

@ -57,6 +57,14 @@ declare module 'net' {
noDelay?: boolean | undefined; noDelay?: boolean | undefined;
keepAlive?: boolean | undefined; keepAlive?: boolean | undefined;
keepAliveInitialDelay?: number | undefined; keepAliveInitialDelay?: number | undefined;
/**
* @since v18.13.0
*/
autoSelectFamily?: boolean | undefined;
/**
* @since v18.13.0
*/
autoSelectFamilyAttemptTimeout?: number | undefined;
} }
interface IpcSocketConnectOpts extends ConnectOpts { interface IpcSocketConnectOpts extends ConnectOpts {
path: string; path: string;
@ -281,7 +289,13 @@ declare module 'net' {
* The string representation of the local IP family. `'IPv4'` or `'IPv6'`. * The string representation of the local IP family. `'IPv4'` or `'IPv6'`.
* @since v18.8.0 * @since v18.8.0
*/ */
readonly localFamily?: string; readonly localFamily?: string;
/**
* This is `true` if the socket is not connected yet, either because `.connect()`
* has not yet been called or because it is still in the process of connecting (see `socket.connecting`).
* @since v10.16.0
*/
readonly pending: boolean;
/** /**
* This property represents the state of the connection as a string. * This property represents the state of the connection as a string.
* @see {https://nodejs.org/api/net.html#socketreadystate} * @see {https://nodejs.org/api/net.html#socketreadystate}

@ -132,6 +132,13 @@ declare module 'os' {
* @since v0.3.3 * @since v0.3.3
*/ */
function cpus(): CpuInfo[]; function cpus(): CpuInfo[];
/**
* Returns an estimate of the default amount of parallelism a program should use. Always returns a value greater than zero.
*
* This function is a small wrapper about libuv's [`uv_available_parallelism()`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_available_parallelism).
* @since 18.4.0
*/
function availableParallelism(): number;
/** /**
* Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it
* returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows.

@ -1089,6 +1089,12 @@ declare module 'process' {
*/ */
mainModule?: Module | undefined; mainModule?: Module | undefined;
memoryUsage: MemoryUsageFn; memoryUsage: MemoryUsageFn;
/**
* Gets the amount of memory available to the process (in bytes) based on
* limits imposed by the OS. If there is no such constraint, or the constraint
* is unknown, `undefined` is returned.
*/
constrainedMemory(): number | undefined;
/** /**
* The `process.cpuUsage()` method returns the user and system CPU time usage of * The `process.cpuUsage()` method returns the user and system CPU time usage of
* the current process, in an object with properties `user` and `system`, whose * the current process, in an object with properties `user` and `system`, whose

@ -912,6 +912,105 @@ declare module 'stream' {
end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this; end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this;
cork(): void; cork(): void;
uncork(): void; uncork(): void;
/**
* Event emitter
* The defined events on documents including:
* 1. close
* 2. data
* 3. drain
* 4. end
* 5. error
* 6. finish
* 7. pause
* 8. pipe
* 9. readable
* 10. resume
* 11. unpipe
*/
addListener(event: 'close', listener: () => void): this;
addListener(event: 'data', listener: (chunk: any) => void): this;
addListener(event: 'drain', listener: () => void): this;
addListener(event: 'end', listener: () => void): this;
addListener(event: 'error', listener: (err: Error) => void): this;
addListener(event: 'finish', listener: () => void): this;
addListener(event: 'pause', listener: () => void): this;
addListener(event: 'pipe', listener: (src: Readable) => void): this;
addListener(event: 'readable', listener: () => void): this;
addListener(event: 'resume', listener: () => void): this;
addListener(event: 'unpipe', listener: (src: Readable) => void): this;
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
emit(event: 'close'): boolean;
emit(event: 'data', chunk: any): boolean;
emit(event: 'drain'): boolean;
emit(event: 'end'): boolean;
emit(event: 'error', err: Error): boolean;
emit(event: 'finish'): boolean;
emit(event: 'pause'): boolean;
emit(event: 'pipe', src: Readable): boolean;
emit(event: 'readable'): boolean;
emit(event: 'resume'): boolean;
emit(event: 'unpipe', src: Readable): boolean;
emit(event: string | symbol, ...args: any[]): boolean;
on(event: 'close', listener: () => void): this;
on(event: 'data', listener: (chunk: any) => void): this;
on(event: 'drain', listener: () => void): this;
on(event: 'end', listener: () => void): this;
on(event: 'error', listener: (err: Error) => void): this;
on(event: 'finish', listener: () => void): this;
on(event: 'pause', listener: () => void): this;
on(event: 'pipe', listener: (src: Readable) => void): this;
on(event: 'readable', listener: () => void): this;
on(event: 'resume', listener: () => void): this;
on(event: 'unpipe', listener: (src: Readable) => void): this;
on(event: string | symbol, listener: (...args: any[]) => void): this;
once(event: 'close', listener: () => void): this;
once(event: 'data', listener: (chunk: any) => void): this;
once(event: 'drain', listener: () => void): this;
once(event: 'end', listener: () => void): this;
once(event: 'error', listener: (err: Error) => void): this;
once(event: 'finish', listener: () => void): this;
once(event: 'pause', listener: () => void): this;
once(event: 'pipe', listener: (src: Readable) => void): this;
once(event: 'readable', listener: () => void): this;
once(event: 'resume', listener: () => void): this;
once(event: 'unpipe', listener: (src: Readable) => void): this;
once(event: string | symbol, listener: (...args: any[]) => void): this;
prependListener(event: 'close', listener: () => void): this;
prependListener(event: 'data', listener: (chunk: any) => void): this;
prependListener(event: 'drain', listener: () => void): this;
prependListener(event: 'end', listener: () => void): this;
prependListener(event: 'error', listener: (err: Error) => void): this;
prependListener(event: 'finish', listener: () => void): this;
prependListener(event: 'pause', listener: () => void): this;
prependListener(event: 'pipe', listener: (src: Readable) => void): this;
prependListener(event: 'readable', listener: () => void): this;
prependListener(event: 'resume', listener: () => void): this;
prependListener(event: 'unpipe', listener: (src: Readable) => void): this;
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'close', listener: () => void): this;
prependOnceListener(event: 'data', listener: (chunk: any) => void): this;
prependOnceListener(event: 'drain', listener: () => void): this;
prependOnceListener(event: 'end', listener: () => void): this;
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
prependOnceListener(event: 'finish', listener: () => void): this;
prependOnceListener(event: 'pause', listener: () => void): this;
prependOnceListener(event: 'pipe', listener: (src: Readable) => void): this;
prependOnceListener(event: 'readable', listener: () => void): this;
prependOnceListener(event: 'resume', listener: () => void): this;
prependOnceListener(event: 'unpipe', listener: (src: Readable) => void): this;
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
removeListener(event: 'close', listener: () => void): this;
removeListener(event: 'data', listener: (chunk: any) => void): this;
removeListener(event: 'drain', listener: () => void): this;
removeListener(event: 'end', listener: () => void): this;
removeListener(event: 'error', listener: (err: Error) => void): this;
removeListener(event: 'finish', listener: () => void): this;
removeListener(event: 'pause', listener: () => void): this;
removeListener(event: 'pipe', listener: (src: Readable) => void): this;
removeListener(event: 'readable', listener: () => void): this;
removeListener(event: 'resume', listener: () => void): this;
removeListener(event: 'unpipe', listener: (src: Readable) => void): this;
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
} }
type TransformCallback = (error?: Error | null, data?: any) => void; type TransformCallback = (error?: Error | null, data?: any) => void;
interface TransformOptions extends DuplexOptions { interface TransformOptions extends DuplexOptions {

@ -7,16 +7,16 @@ declare module 'node:test' {
* Programmatically start the test runner. * Programmatically start the test runner.
* @since v18.9.0 * @since v18.9.0
* @param options Configuration options for running tests. * @param options Configuration options for running tests.
* @returns A {@link TapStream} that emits events about the test execution. * @returns A {@link TestsStream} that emits events about the test execution.
*/ */
function run(options?: RunOptions): TapStream; function run(options?: RunOptions): TestsStream;
/** /**
* The `test()` function is the value imported from the test module. Each invocation of this * The `test()` function is the value imported from the test module. Each invocation of this
* function results in the creation of a test point in the TAP output. * function results in reporting the test to the {@link TestsStream}.
* *
* The {@link TestContext} object passed to the fn argument can be used to perform actions * The {@link TestContext} object passed to the fn argument can be used to perform actions
* related to the current test. Examples include skipping the test, adding additional TAP * related to the current test. Examples include skipping the test, adding additional
* diagnostic information, or creating subtests. * diagnostic information, or creating subtests.
* *
* `test()` returns a {@link Promise} that resolves once the test completes. The return value * `test()` returns a {@link Promise} that resolves once the test completes. The return value
@ -158,54 +158,88 @@ declare module 'node:test' {
} }
/** /**
* A successful call of the `run()` method will return a new `TapStream` object, * A successful call of the `run()` method will return a new `TestsStream` object,
* streaming a [TAP](https://testanything.org/) output. * streaming a series of events representing the execution of the tests.
* `TapStream` will emit events in the order of the tests' definitions. * `TestsStream` will emit events in the order of the tests' definitions.
* @since v18.9.0 * @since v18.9.0
*/ */
interface TapStream extends NodeJS.ReadableStream { interface TestsStream extends NodeJS.ReadableStream {
addListener(event: 'test:diagnostic', listener: (message: string) => void): this; addListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
addListener(event: 'test:fail', listener: (data: TestFail) => void): this; addListener(event: 'test:fail', listener: (data: TestFail) => void): this;
addListener(event: 'test:pass', listener: (data: TestPass) => void): this; addListener(event: 'test:pass', listener: (data: TestPass) => void): this;
addListener(event: 'test:plan', listener: (data: TestPlan) => void): this;
addListener(event: 'test:start', listener: (data: TestStart) => void): this;
addListener(event: string, listener: (...args: any[]) => void): this; addListener(event: string, listener: (...args: any[]) => void): this;
emit(event: 'test:diagnostic', message: string): boolean; emit(event: 'test:diagnostic', data: DiagnosticData): boolean;
emit(event: 'test:fail', data: TestFail): boolean; emit(event: 'test:fail', data: TestFail): boolean;
emit(event: 'test:pass', data: TestPass): boolean; emit(event: 'test:pass', data: TestPass): boolean;
emit(event: 'test:plan', data: TestPlan): boolean;
emit(event: 'test:start', data: TestStart): boolean;
emit(event: string | symbol, ...args: any[]): boolean; emit(event: string | symbol, ...args: any[]): boolean;
on(event: 'test:diagnostic', listener: (message: string) => void): this; on(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
on(event: 'test:fail', listener: (data: TestFail) => void): this; on(event: 'test:fail', listener: (data: TestFail) => void): this;
on(event: 'test:pass', listener: (data: TestPass) => void): this; on(event: 'test:pass', listener: (data: TestPass) => void): this;
on(event: 'test:plan', listener: (data: TestPlan) => void): this;
on(event: 'test:start', listener: (data: TestStart) => void): this;
on(event: string, listener: (...args: any[]) => void): this; on(event: string, listener: (...args: any[]) => void): this;
once(event: 'test:diagnostic', listener: (message: string) => void): this; once(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
once(event: 'test:fail', listener: (data: TestFail) => void): this; once(event: 'test:fail', listener: (data: TestFail) => void): this;
once(event: 'test:pass', listener: (data: TestPass) => void): this; once(event: 'test:pass', listener: (data: TestPass) => void): this;
once(event: 'test:plan', listener: (data: TestPlan) => void): this;
once(event: 'test:start', listener: (data: TestStart) => void): this;
once(event: string, listener: (...args: any[]) => void): this; once(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'test:diagnostic', listener: (message: string) => void): this; prependListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
prependListener(event: 'test:fail', listener: (data: TestFail) => void): this; prependListener(event: 'test:fail', listener: (data: TestFail) => void): this;
prependListener(event: 'test:pass', listener: (data: TestPass) => void): this; prependListener(event: 'test:pass', listener: (data: TestPass) => void): this;
prependListener(event: 'test:plan', listener: (data: TestPlan) => void): this;
prependListener(event: 'test:start', listener: (data: TestStart) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this; prependListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'test:diagnostic', listener: (message: string) => void): this; prependOnceListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
prependOnceListener(event: 'test:fail', listener: (data: TestFail) => void): this; prependOnceListener(event: 'test:fail', listener: (data: TestFail) => void): this;
prependOnceListener(event: 'test:pass', listener: (data: TestPass) => void): this; prependOnceListener(event: 'test:pass', listener: (data: TestPass) => void): this;
prependOnceListener(event: 'test:plan', listener: (data: TestPlan) => void): this;
prependOnceListener(event: 'test:start', listener: (data: TestStart) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this; prependOnceListener(event: string, listener: (...args: any[]) => void): this;
} }
interface DiagnosticData {
/**
* The diagnostic message.
*/
message: string;
/**
* The nesting level of the test.
*/
nesting: number;
}
interface TestFail { interface TestFail {
/** /**
* The test duration. * Additional execution metadata.
*/ */
duration: number; details: {
/**
* The duration of the test in milliseconds.
*/
duration: number;
/** /**
* The failure casing test to fail. * The error thrown by the test.
*/ */
error: Error; error: Error;
};
/** /**
* The test name. * The test name.
*/ */
name: string; name: string;
/**
* The nesting level of the test.
*/
nesting: number;
/** /**
* The ordinal number of the test. * The ordinal number of the test.
*/ */
@ -214,25 +248,35 @@ declare module 'node:test' {
/** /**
* Present if `context.todo` is called. * Present if `context.todo` is called.
*/ */
todo?: string; todo?: string | boolean;
/** /**
* Present if `context.skip` is called. * Present if `context.skip` is called.
*/ */
skip?: string; skip?: string | boolean;
} }
interface TestPass { interface TestPass {
/** /**
* The test duration. * Additional execution metadata.
*/ */
duration: number; details: {
/**
* The duration of the test in milliseconds.
*/
duration: number;
};
/** /**
* The test name. * The test name.
*/ */
name: string; name: string;
/**
* The nesting level of the test.
*/
nesting: number;
/** /**
* The ordinal number of the test. * The ordinal number of the test.
*/ */
@ -241,12 +285,36 @@ declare module 'node:test' {
/** /**
* Present if `context.todo` is called. * Present if `context.todo` is called.
*/ */
todo?: string; todo?: string | boolean;
/** /**
* Present if `context.skip` is called. * Present if `context.skip` is called.
*/ */
skip?: string; skip?: string | boolean;
}
interface TestPlan {
/**
* The nesting level of the test.
*/
nesting: number;
/**
* The number of subtests that have ran.
*/
count: number;
}
interface TestStart {
/**
* The test name.
*/
name: string;
/**
* The nesting level of the test.
*/
nesting: number;
} }
/** /**
@ -264,6 +332,15 @@ declare module 'node:test' {
*/ */
beforeEach: typeof beforeEach; beforeEach: typeof beforeEach;
/**
* This function is used to create a hook that runs after the current test finishes.
* @param fn The hook function. If the hook uses callbacks, the callback function is passed as
* the second argument. Default: A no-op function.
* @param options Configuration options for the hook.
* @since v18.13.0
*/
after: typeof after;
/** /**
* This function is used to create a hook running after each subtest of the current test. * This function is used to create a hook running after each subtest of the current test.
* @param fn The hook function. If the hook uses callbacks, the callback function is passed as * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
@ -274,9 +351,9 @@ declare module 'node:test' {
afterEach: typeof afterEach; afterEach: typeof afterEach;
/** /**
* This function is used to write TAP diagnostics to the output. Any diagnostic information is * This function is used to write diagnostics to the output. Any diagnostic information is
* included at the end of the test's results. This function does not return a value. * included at the end of the test's results. This function does not return a value.
* @param message Message to be displayed as a TAP diagnostic. * @param message Message to be reported.
* @since v18.0.0 * @since v18.0.0
*/ */
diagnostic(message: string): void; diagnostic(message: string): void;
@ -304,18 +381,18 @@ declare module 'node:test' {
/** /**
* This function causes the test's output to indicate the test as skipped. If `message` is * This function causes the test's output to indicate the test as skipped. If `message` is
* provided, it is included in the TAP output. Calling `skip()` does not terminate execution of * provided, it is included in the output. Calling `skip()` does not terminate execution of
* the test function. This function does not return a value. * the test function. This function does not return a value.
* @param message Optional skip message to be displayed in TAP output. * @param message Optional skip message.
* @since v18.0.0 * @since v18.0.0
*/ */
skip(message?: string): void; skip(message?: string): void;
/** /**
* This function adds a `TODO` directive to the test's output. If `message` is provided, it is * This function adds a `TODO` directive to the test's output. If `message` is provided, it is
* included in the TAP output. Calling `todo()` does not terminate execution of the test * included in the output. Calling `todo()` does not terminate execution of the test
* function. This function does not return a value. * function. This function does not return a value.
* @param message Optional `TODO` message to be displayed in TAP output. * @param message Optional `TODO` message.
* @since v18.0.0 * @since v18.0.0
*/ */
todo(message?: string): void; todo(message?: string): void;
@ -333,6 +410,10 @@ declare module 'node:test' {
* @returns A {@link Promise} resolved with `undefined` once the test completes. * @returns A {@link Promise} resolved with `undefined` once the test completes.
*/ */
test: typeof test; test: typeof test;
/**
* Each test provides its own MockTracker instance.
*/
readonly mock: MockTracker;
} }
interface TestOptions { interface TestOptions {
@ -442,5 +523,238 @@ declare module 'node:test' {
timeout?: number | undefined; timeout?: number | undefined;
} }
export { test as default, run, test, describe, it, before, after, beforeEach, afterEach }; interface MockFunctionOptions {
/**
* The number of times that the mock will use the behavior of `implementation`.
* Once the mock function has been called `times` times,
* it will automatically restore the behavior of `original`.
* This value must be an integer greater than zero.
* @default Infinity
*/
times?: number | undefined;
}
interface MockMethodOptions extends MockFunctionOptions {
/**
* If `true`, `object[methodName]` is treated as a getter.
* This option cannot be used with the `setter` option.
*/
getter?: boolean | undefined;
/**
* If `true`, `object[methodName]` is treated as a setter.
* This option cannot be used with the `getter` option.
*/
setter?: boolean | undefined;
}
type Mock<F extends Function> = F & {
mock: MockFunctionContext<F>;
};
type NoOpFunction = (...args: any[]) => undefined;
type FunctionPropertyNames<T> = {
[K in keyof T]: T[K] extends Function ? K : never;
}[keyof T];
interface MockTracker {
/**
* This function is used to create a mock function.
* @param original An optional function to create a mock on.
* @param implementation An optional function used as the mock implementation for `original`.
* This is useful for creating mocks that exhibit one behavior for a specified number of calls and then restore the behavior of `original`.
* @param options Optional configuration options for the mock function.
*/
fn<F extends Function = NoOpFunction>(original?: F, options?: MockFunctionOptions): Mock<F>;
fn<F extends Function = NoOpFunction, Implementation extends Function = F>(original?: F, implementation?: Implementation, options?: MockFunctionOptions): Mock<F | Implementation>;
/**
* This function is used to create a mock on an existing object method.
* @param object The object whose method is being mocked.
* @param methodName The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown.
* @param implementation An optional function used as the mock implementation for `object[methodName]`.
* @param options Optional configuration options for the mock method.
*/
method<
MockedObject extends object,
MethodName extends FunctionPropertyNames<MockedObject>,
>(
object: MockedObject,
methodName: MethodName,
options?: MockFunctionOptions,
): MockedObject[MethodName] extends Function
? Mock<MockedObject[MethodName]>
: never;
method<
MockedObject extends object,
MethodName extends FunctionPropertyNames<MockedObject>,
Implementation extends Function,
>(
object: MockedObject,
methodName: MethodName,
implementation: Implementation,
options?: MockFunctionOptions,
): MockedObject[MethodName] extends Function
? Mock<MockedObject[MethodName] | Implementation>
: never;
method<MockedObject extends object>(
object: MockedObject,
methodName: keyof MockedObject,
options: MockMethodOptions,
): Mock<Function>;
method<MockedObject extends object>(
object: MockedObject,
methodName: keyof MockedObject,
implementation: Function,
options: MockMethodOptions,
): Mock<Function>;
/**
* This function is syntax sugar for {@link MockTracker.method} with `options.getter` set to `true`.
*/
getter<
MockedObject extends object,
MethodName extends keyof MockedObject,
>(
object: MockedObject,
methodName: MethodName,
options?: MockFunctionOptions,
): Mock<() => MockedObject[MethodName]>;
getter<
MockedObject extends object,
MethodName extends keyof MockedObject,
Implementation extends Function,
>(
object: MockedObject,
methodName: MethodName,
implementation?: Implementation,
options?: MockFunctionOptions,
): Mock<(() => MockedObject[MethodName]) | Implementation>;
/**
* This function is syntax sugar for {@link MockTracker.method} with `options.setter` set to `true`.
*/
setter<
MockedObject extends object,
MethodName extends keyof MockedObject,
>(
object: MockedObject,
methodName: MethodName,
options?: MockFunctionOptions,
): Mock<(value: MockedObject[MethodName]) => void>;
setter<
MockedObject extends object,
MethodName extends keyof MockedObject,
Implementation extends Function,
>(
object: MockedObject,
methodName: MethodName,
implementation?: Implementation,
options?: MockFunctionOptions,
): Mock<((value: MockedObject[MethodName]) => void) | Implementation>;
/**
* This function restores the default behavior of all mocks that were previously created by this `MockTracker`
* and disassociates the mocks from the `MockTracker` instance. Once disassociated, the mocks can still be used,
* but the `MockTracker` instance can no longer be used to reset their behavior or otherwise interact with them.
*
* After each test completes, this function is called on the test context's `MockTracker`.
* If the global `MockTracker` is used extensively, calling this function manually is recommended.
*/
reset(): void;
/**
* This function restores the default behavior of all mocks that were previously created by this `MockTracker`.
* Unlike `mock.reset()`, `mock.restoreAll()` does not disassociate the mocks from the `MockTracker` instance.
*/
restoreAll(): void;
}
const mock: MockTracker;
interface MockFunctionCall<
F extends Function,
ReturnType = F extends (...args: any) => infer T
? T
: F extends abstract new (...args: any) => infer T
? T
: unknown,
Args = F extends (...args: infer Y) => any
? Y
: F extends abstract new (...args: infer Y) => any
? Y
: unknown[],
> {
/**
* An array of the arguments passed to the mock function.
*/
arguments: Args;
/**
* If the mocked function threw then this property contains the thrown value.
*/
error: unknown | undefined;
/**
* The value returned by the mocked function.
*
* If the mocked function threw, it will be `undefined`.
*/
result: ReturnType | undefined;
/**
* An `Error` object whose stack can be used to determine the callsite of the mocked function invocation.
*/
stack: Error;
/**
* If the mocked function is a constructor, this field contains the class being constructed.
* Otherwise this will be `undefined`.
*/
target: F extends abstract new (...args: any) => any ? F : undefined;
/**
* The mocked function's `this` value.
*/
this: unknown;
}
interface MockFunctionContext<F extends Function> {
/**
* A getter that returns a copy of the internal array used to track calls to the mock.
*/
readonly calls: Array<MockFunctionCall<F>>;
/**
* This function returns the number of times that this mock has been invoked.
* This function is more efficient than checking `ctx.calls.length`
* because `ctx.calls` is a getter that creates a copy of the internal call tracking array.
*/
callCount(): number;
/**
* This function is used to change the behavior of an existing mock.
* @param implementation The function to be used as the mock's new implementation.
*/
mockImplementation(implementation: Function): void;
/**
* This function is used to change the behavior of an existing mock for a single invocation.
* Once invocation `onCall` has occurred, the mock will revert to whatever behavior
* it would have used had `mockImplementationOnce()` not been called.
* @param implementation The function to be used as the mock's implementation for the invocation number specified by `onCall`.
* @param onCall The invocation number that will use `implementation`.
* If the specified invocation has already occurred then an exception is thrown.
*/
mockImplementationOnce(implementation: Function, onCall?: number): void;
/**
* Resets the call history of the mock function.
*/
resetCalls(): void;
/**
* Resets the implementation of the mock function to its original behavior.
* The mock can still be used after calling this function.
*/
restore(): void;
}
export { test as default, run, test, describe, it, before, after, beforeEach, afterEach, mock };
} }

@ -41,21 +41,100 @@ declare module 'tls' {
CN: string; CN: string;
} }
interface PeerCertificate { interface PeerCertificate {
subject: Certificate; /**
issuer: Certificate; * `true` if a Certificate Authority (CA), `false` otherwise.
subjectaltname: string; * @since v18.13.0
infoAccess: NodeJS.Dict<string[]>; */
modulus: string; ca: boolean;
exponent: string; /**
valid_from: string; * The DER encoded X.509 certificate data.
valid_to: string; */
fingerprint: string;
fingerprint256: string;
ext_key_usage: string[];
serialNumber: string;
raw: Buffer; raw: Buffer;
/**
* The certificate subject.
*/
subject: Certificate;
/**
* The certificate issuer, described in the same terms as the `subject`.
*/
issuer: Certificate;
/**
* The date-time the certificate is valid from.
*/
valid_from: string;
/**
* The date-time the certificate is valid to.
*/
valid_to: string;
/**
* The certificate serial number, as a hex string.
*/
serialNumber: string;
/**
* The SHA-1 digest of the DER encoded certificate.
* It is returned as a `:` separated hexadecimal string.
*/
fingerprint: string;
/**
* The SHA-256 digest of the DER encoded certificate.
* It is returned as a `:` separated hexadecimal string.
*/
fingerprint256: string;
/**
* The SHA-512 digest of the DER encoded certificate.
* It is returned as a `:` separated hexadecimal string.
*/
fingerprint512: string;
/**
* The extended key usage, a set of OIDs.
*/
ext_key_usage?: string[];
/**
* A string containing concatenated names for the subject,
* an alternative to the `subject` names.
*/
subjectaltname?: string;
/**
* An array describing the AuthorityInfoAccess, used with OCSP.
*/
infoAccess?: NodeJS.Dict<string[]>;
/**
* For RSA keys: The RSA bit size.
*
* For EC keys: The key size in bits.
*/
bits?: number;
/**
* The RSA exponent, as a string in hexadecimal number notation.
*/
exponent?: string;
/**
* The RSA modulus, as a hexadecimal string.
*/
modulus?: string;
/**
* The public key.
*/
pubkey?: Buffer;
/**
* The ASN.1 name of the OID of the elliptic curve.
* Well-known curves are identified by an OID.
* While it is unusual, it is possible that the curve
* is identified by its mathematical properties,
* in which case it will not have an OID.
*/
asn1Curve?: string;
/**
* The NIST name for the elliptic curve,if it has one
* (not all well-known curves have been assigned names by NIST).
*/
nistCurve?: string;
} }
interface DetailedPeerCertificate extends PeerCertificate { interface DetailedPeerCertificate extends PeerCertificate {
/**
* The issuer certificate object.
* For self-signed certificates, this may be a circular reference.
*/
issuerCertificate: DetailedPeerCertificate; issuerCertificate: DetailedPeerCertificate;
} }
interface CipherNameAndProtocol { interface CipherNameAndProtocol {

@ -1426,6 +1426,91 @@ declare module 'util' {
tokens?: Token[]; tokens?: Token[];
} }
: PreciseParsedResults<T>; : PreciseParsedResults<T>;
/**
* @since v18.13.0
*/
export class MIMEType {
/**
* Creates a new MIMEType object by parsing the input.
*
* A `TypeError` will be thrown if the `input` is not a valid MIME.
* Note that an effort will be made to coerce the given values into strings.
* @param input The input MIME to parse.
*/
constructor(input: string | { toString: () => string });
/**
* Gets and sets the type portion of the MIME.
*/
type: string;
/**
* Gets and sets the subtype portion of the MIME.
*/
subtype: string;
/**
* Gets the essence of the MIME.
*
* Use `mime.type` or `mime.subtype` to alter the MIME.
*/
readonly essence: string;
/**
* Gets the `MIMEParams` object representing the parameters of the MIME.
*/
readonly params: MIMEParams;
/**
* Returns the serialized MIME.
*
* Because of the need for standard compliance, this method
* does not allow users to customize the serialization process of the MIME.
*/
toString(): string;
}
/**
* @since v18.13.0
*/
export class MIMEParams {
/**
* Remove all name-value pairs whose name is `name`.
*/
delete(name: string): void;
/**
* Returns an iterator over each of the name-value pairs in the parameters.
*/
entries(): IterableIterator<[string, string]>;
/**
* Returns the value of the first name-value pair whose name is `name`.
* If there are no such pairs, `null` is returned.
*/
get(name: string): string | null;
/**
* Returns `true` if there is at least one name-value pair whose name is `name`.
*/
has(name: string): boolean;
/**
* Returns an iterator over the names of each name-value pair.
*/
keys(): IterableIterator<string>;
/**
* Sets the value in the `MIMEParams` object associated with `name` to `value`.
* If there are any pre-existing name-value pairs whose names are `name`,
* set the first such pair's value to `value`.
*/
set(name: string, value: string): void;
/**
* Returns an iterator over the values of each name-value pair.
*/
values(): IterableIterator<string>;
/**
* Returns an iterator over each of the name-value pairs in the parameters.
*/
[Symbol.iterator]: typeof MIMEParams.prototype.entries;
}
} }
declare module 'util/types' { declare module 'util/types' {
export * from 'util/types'; export * from 'util/types';

@ -390,6 +390,57 @@ declare module 'v8' {
* @since v15.1.0, v14.18.0, v12.22.0 * @since v15.1.0, v14.18.0, v12.22.0
*/ */
function stopCoverage(): void; function stopCoverage(): void;
/**
* This API collects GC data in current thread.
*/
class GCProfiler {
/**
* Start collecting GC data.
*/
start(): void;
/**
* Stop collecting GC data and return a object.
*/
stop(): GCProfilerResult;
}
interface GCProfilerResult {
version: number;
startTime: number;
endTime: number;
statistics: Array<{
gcType: string;
cost: number;
beforeGC: {
heapStatistics: HeapStatistics;
heapSpaceStatistics: HeapSpaceStatistics[];
};
afterGC: {
heapStatistics: HeapStatistics;
heapSpaceStatistics: HeapSpaceStatistics[];
};
}>;
}
interface HeapStatistics {
totalHeapSize: number;
totalHeapSizeExecutable: number;
totalPhysicalSize: number;
totalAvailableSize: number;
totalGlobalHandlesSize: number;
usedGlobalHandlesSize: number;
usedHeapSize: number;
heapSizeLimit: number;
mallocedMemory: number;
externalMemory: number;
peakMallocedMemory: number;
}
interface HeapSpaceStatistics {
spaceName: string;
spaceSize: number;
spaceUsedSize: number;
spaceAvailableSize: number;
physicalSpaceSize: number;
}
} }
declare module 'node:v8' { declare module 'node:v8' {
export * from 'v8'; export * from 'v8';

@ -56,11 +56,17 @@ declare module 'vm' {
columnOffset?: number | undefined; columnOffset?: number | undefined;
} }
interface ScriptOptions extends BaseOptions { interface ScriptOptions extends BaseOptions {
displayErrors?: boolean | undefined; /**
timeout?: number | undefined; * V8's code cache data for the supplied source.
cachedData?: Buffer | undefined; */
cachedData?: Buffer | NodeJS.ArrayBufferView | undefined;
/** @deprecated in favor of `script.createCachedData()` */ /** @deprecated in favor of `script.createCachedData()` */
produceCachedData?: boolean | undefined; produceCachedData?: boolean | undefined;
/**
* Called during evaluation of this module when `import()` is called.
* If this option is not specified, calls to `import()` will reject with `ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`.
*/
importModuleDynamically?: ((specifier: string, script: Script, importAssertions: Object) => Module) | undefined;
} }
interface RunningScriptOptions extends BaseOptions { interface RunningScriptOptions extends BaseOptions {
/** /**
@ -80,10 +86,31 @@ declare module 'vm' {
* Default: `false`. * Default: `false`.
*/ */
breakOnSigint?: boolean | undefined; breakOnSigint?: boolean | undefined;
}
interface RunningScriptInNewContextOptions extends RunningScriptOptions {
/**
* Human-readable name of the newly created context.
*/
contextName?: CreateContextOptions['name'];
/**
* Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL,
* but with only the scheme, host, and port (if necessary), like the value of the `url.origin` property of a `URL` object.
* Most notably, this string should omit the trailing slash, as that denotes a path.
*/
contextOrigin?: CreateContextOptions['origin'];
contextCodeGeneration?: CreateContextOptions['codeGeneration'];
/** /**
* If set to `afterEvaluate`, microtasks will be run immediately after the script has run. * If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
*/ */
microtaskMode?: 'afterEvaluate' | undefined; microtaskMode?: CreateContextOptions['microtaskMode'];
}
interface RunningCodeOptions extends RunningScriptOptions {
cachedData?: ScriptOptions['cachedData'];
importModuleDynamically?: ScriptOptions['importModuleDynamically'];
}
interface RunningCodeInNewContextOptions extends RunningScriptInNewContextOptions {
cachedData?: ScriptOptions['cachedData'];
importModuleDynamically?: ScriptOptions['importModuleDynamically'];
} }
interface CompileFunctionOptions extends BaseOptions { interface CompileFunctionOptions extends BaseOptions {
/** /**
@ -144,7 +171,10 @@ declare module 'vm' {
* @default 'summary' * @default 'summary'
*/ */
mode?: MeasureMemoryMode | undefined; mode?: MeasureMemoryMode | undefined;
context?: Context | undefined; /**
* @default 'default'
*/
execution?: 'default' | 'eager' | undefined;
} }
interface MemoryMeasurement { interface MemoryMeasurement {
total: { total: {
@ -158,7 +188,7 @@ declare module 'vm' {
* @since v0.3.1 * @since v0.3.1
*/ */
class Script { class Script {
constructor(code: string, options?: ScriptOptions); constructor(code: string, options?: ScriptOptions | string);
/** /**
* Runs the compiled code contained by the `vm.Script` object within the given`contextifiedObject` and returns the result. Running code does not have access * Runs the compiled code contained by the `vm.Script` object within the given`contextifiedObject` and returns the result. Running code does not have access
* to local scope. * to local scope.
@ -220,7 +250,7 @@ declare module 'vm' {
* @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created. * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created.
* @return the result of the very last statement executed in the script. * @return the result of the very last statement executed in the script.
*/ */
runInNewContext(contextObject?: Context, options?: RunningScriptOptions): any; runInNewContext(contextObject?: Context, options?: RunningScriptInNewContextOptions): any;
/** /**
* Runs the compiled code contained by the `vm.Script` within the context of the * Runs the compiled code contained by the `vm.Script` within the context of the
* current `global` object. Running code does not have access to local scope, but _does_ have access to the current `global` object. * current `global` object. Running code does not have access to local scope, but _does_ have access to the current `global` object.
@ -273,6 +303,10 @@ declare module 'vm' {
cachedDataProduced?: boolean | undefined; cachedDataProduced?: boolean | undefined;
cachedDataRejected?: boolean | undefined; cachedDataRejected?: boolean | undefined;
cachedData?: Buffer | undefined; cachedData?: Buffer | undefined;
/**
* When the script is compiled from a source that contains a source map magic comment, this property will be set to the URL of the source map.
*/
sourceMapURL?: string | undefined;
} }
/** /**
* If given a `contextObject`, the `vm.createContext()` method will `prepare * If given a `contextObject`, the `vm.createContext()` method will `prepare
@ -345,7 +379,7 @@ declare module 'vm' {
* @param contextifiedObject The `contextified` object that will be used as the `global` when the `code` is compiled and run. * @param contextifiedObject The `contextified` object that will be used as the `global` when the `code` is compiled and run.
* @return the result of the very last statement executed in the script. * @return the result of the very last statement executed in the script.
*/ */
function runInContext(code: string, contextifiedObject: Context, options?: RunningScriptOptions | string): any; function runInContext(code: string, contextifiedObject: Context, options?: RunningCodeOptions | string): any;
/** /**
* The `vm.runInNewContext()` first contextifies the given `contextObject` (or * The `vm.runInNewContext()` first contextifies the given `contextObject` (or
* creates a new `contextObject` if passed as `undefined`), compiles the `code`, * creates a new `contextObject` if passed as `undefined`), compiles the `code`,
@ -374,7 +408,7 @@ declare module 'vm' {
* @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created. * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created.
* @return the result of the very last statement executed in the script. * @return the result of the very last statement executed in the script.
*/ */
function runInNewContext(code: string, contextObject?: Context, options?: RunningScriptOptions | string): any; function runInNewContext(code: string, contextObject?: Context, options?: RunningCodeInNewContextOptions | string): any;
/** /**
* `vm.runInThisContext()` compiles `code`, runs it within the context of the * `vm.runInThisContext()` compiles `code`, runs it within the context of the
* current `global` and returns the result. Running code does not have access to * current `global` and returns the result. Running code does not have access to
@ -437,7 +471,7 @@ declare module 'vm' {
* @param code The JavaScript code to compile and run. * @param code The JavaScript code to compile and run.
* @return the result of the very last statement executed in the script. * @return the result of the very last statement executed in the script.
*/ */
function runInThisContext(code: string, options?: RunningScriptOptions | string): any; function runInThisContext(code: string, options?: RunningCodeOptions | string): any;
/** /**
* Compiles the given code into the provided context (if no context is * Compiles the given code into the provided context (if no context is
* supplied, the current context is used), and returns it wrapped inside a * supplied, the current context is used), and returns it wrapped inside a
@ -446,7 +480,11 @@ declare module 'vm' {
* @param code The body of the function to compile. * @param code The body of the function to compile.
* @param params An array of strings containing all parameters for the function. * @param params An array of strings containing all parameters for the function.
*/ */
function compileFunction(code: string, params?: ReadonlyArray<string>, options?: CompileFunctionOptions): Function; function compileFunction(code: string, params?: ReadonlyArray<string>, options?: CompileFunctionOptions): Function & {
cachedData?: Script['cachedData'] | undefined;
cachedDataProduced?: Script['cachedDataProduced'] | undefined;
cachedDataRejected?: Script['cachedDataRejected'] | undefined;
};
/** /**
* Measure the memory known to V8 and used by all contexts known to the * Measure the memory known to V8 and used by all contexts known to the
* current V8 isolate, or the main context. * current V8 isolate, or the main context.
@ -503,6 +541,103 @@ declare module 'vm' {
* @experimental * @experimental
*/ */
function measureMemory(options?: MeasureMemoryOptions): Promise<MemoryMeasurement>; function measureMemory(options?: MeasureMemoryOptions): Promise<MemoryMeasurement>;
interface ModuleEvaluateOptions {
timeout?: RunningScriptOptions['timeout'] | undefined;
breakOnSigint?: RunningScriptOptions['breakOnSigint'] | undefined;
}
type ModuleLinker = (specifier: string, referencingModule: Module, extra: { assert: Object }) => Module | Promise<Module>;
type ModuleStatus = 'unlinked' | 'linking' | 'linked' | 'evaluating' | 'evaluated' | 'errored';
class Module {
/**
* The specifiers of all dependencies of this module.
*/
dependencySpecifiers: readonly string[];
/**
* If the `module.status` is `'errored'`, this property contains the exception thrown by the module during evaluation.
* If the status is anything else, accessing this property will result in a thrown exception.
*/
error: any;
/**
* The identifier of the current module, as set in the constructor.
*/
identifier: string;
context: Context;
/**
* The namespace object of the module. This is only available after linking (`module.link()`) has completed.
*/
namespace: Object;
/**
* The current status of the module.
*/
status: ModuleStatus;
/**
* Evaluate the module.
*
* This must be called after the module has been linked; otherwise it will reject
* It could be called also when the module has already been evaluated, in which case it will either do nothing
* if the initial evaluation ended in success (`module.status` is `'evaluated'`) or it will re-throw the exception
* that the initial evaluation resulted in (`module.status` is `'errored'`).
*
* This method cannot be called while the module is being evaluated (`module.status` is `'evaluating'`).
*/
evaluate(options?: ModuleEvaluateOptions): Promise<void>;
/**
* Link module dependencies. This method must be called before evaluation, and can only be called once per module.
*/
link(linker: ModuleLinker): Promise<void>;
}
interface SourceTextModuleOptions {
/**
* String used in stack traces.
* @default 'vm:module(i)' where i is a context-specific ascending index.
*/
identifier?: string | undefined;
cachedData?: ScriptOptions['cachedData'] | undefined;
context?: Context | undefined;
lineOffset?: BaseOptions['lineOffset'] | undefined;
columnOffset?: BaseOptions['columnOffset'] | undefined;
/**
* Called during evaluation of this module to initialize the `import.meta`.
*/
initializeImportMeta?: ((meta: ImportMeta, module: SourceTextModule) => void) | undefined;
importModuleDynamically?: ScriptOptions['importModuleDynamically'] | undefined;
}
class SourceTextModule extends Module {
/**
* Creates a new `SourceTextModule` instance.
* @param code JavaScript Module code to parse
*/
constructor(code: string, options?: SourceTextModuleOptions);
}
interface SyntheticModuleOptions {
/**
* String used in stack traces.
* @default 'vm:module(i)' where i is a context-specific ascending index.
*/
identifier?: string | undefined;
/**
* The contextified object as returned by the `vm.createContext()` method, to compile and evaluate this module in.
*/
context?: Context | undefined;
}
class SyntheticModule extends Module {
/**
* Creates a new `SyntheticModule` instance.
* @param exportNames Array of names that will be exported from the module.
* @param evaluateCallback Called when the module is evaluated.
*/
constructor(exportNames: string[], evaluateCallback: (this: SyntheticModule) => void, options?: SyntheticModuleOptions);
/**
* This method is used after the module is linked to set the values of exports.
* If it is called before the module is linked, an `ERR_VM_MODULE_STATUS` error will be thrown.
* @param name
* @param value
*/
setExport(name: string, value: any): void;
}
} }
declare module 'node:vm' { declare module 'node:vm' {
export * from 'vm'; export * from 'vm';

85
node_modules/@types/node/util.d.ts generated vendored

@ -1426,6 +1426,91 @@ declare module 'util' {
tokens?: Token[]; tokens?: Token[];
} }
: PreciseParsedResults<T>; : PreciseParsedResults<T>;
/**
* @since v18.13.0
*/
export class MIMEType {
/**
* Creates a new MIMEType object by parsing the input.
*
* A `TypeError` will be thrown if the `input` is not a valid MIME.
* Note that an effort will be made to coerce the given values into strings.
* @param input The input MIME to parse.
*/
constructor(input: string | { toString: () => string });
/**
* Gets and sets the type portion of the MIME.
*/
type: string;
/**
* Gets and sets the subtype portion of the MIME.
*/
subtype: string;
/**
* Gets the essence of the MIME.
*
* Use `mime.type` or `mime.subtype` to alter the MIME.
*/
readonly essence: string;
/**
* Gets the `MIMEParams` object representing the parameters of the MIME.
*/
readonly params: MIMEParams;
/**
* Returns the serialized MIME.
*
* Because of the need for standard compliance, this method
* does not allow users to customize the serialization process of the MIME.
*/
toString(): string;
}
/**
* @since v18.13.0
*/
export class MIMEParams {
/**
* Remove all name-value pairs whose name is `name`.
*/
delete(name: string): void;
/**
* Returns an iterator over each of the name-value pairs in the parameters.
*/
entries(): IterableIterator<[name: string, value: string]>;
/**
* Returns the value of the first name-value pair whose name is `name`.
* If there are no such pairs, `null` is returned.
*/
get(name: string): string | null;
/**
* Returns `true` if there is at least one name-value pair whose name is `name`.
*/
has(name: string): boolean;
/**
* Returns an iterator over the names of each name-value pair.
*/
keys(): IterableIterator<string>;
/**
* Sets the value in the `MIMEParams` object associated with `name` to `value`.
* If there are any pre-existing name-value pairs whose names are `name`,
* set the first such pair's value to `value`.
*/
set(name: string, value: string): void;
/**
* Returns an iterator over the values of each name-value pair.
*/
values(): IterableIterator<string>;
/**
* Returns an iterator over each of the name-value pairs in the parameters.
*/
[Symbol.iterator]: typeof MIMEParams.prototype.entries;
}
} }
declare module 'util/types' { declare module 'util/types' {
export * from 'util/types'; export * from 'util/types';

51
node_modules/@types/node/v8.d.ts generated vendored

@ -390,6 +390,57 @@ declare module 'v8' {
* @since v15.1.0, v14.18.0, v12.22.0 * @since v15.1.0, v14.18.0, v12.22.0
*/ */
function stopCoverage(): void; function stopCoverage(): void;
/**
* This API collects GC data in current thread.
*/
class GCProfiler {
/**
* Start collecting GC data.
*/
start(): void;
/**
* Stop collecting GC data and return a object.
*/
stop(): GCProfilerResult;
}
interface GCProfilerResult {
version: number;
startTime: number;
endTime: number;
statistics: Array<{
gcType: string;
cost: number;
beforeGC: {
heapStatistics: HeapStatistics;
heapSpaceStatistics: HeapSpaceStatistics[];
};
afterGC: {
heapStatistics: HeapStatistics;
heapSpaceStatistics: HeapSpaceStatistics[];
};
}>;
}
interface HeapStatistics {
totalHeapSize: number;
totalHeapSizeExecutable: number;
totalPhysicalSize: number;
totalAvailableSize: number;
totalGlobalHandlesSize: number;
usedGlobalHandlesSize: number;
usedHeapSize: number;
heapSizeLimit: number;
mallocedMemory: number;
externalMemory: number;
peakMallocedMemory: number;
}
interface HeapSpaceStatistics {
spaceName: string;
spaceSize: number;
spaceUsedSize: number;
spaceAvailableSize: number;
physicalSpaceSize: number;
}
} }
declare module 'node:v8' { declare module 'node:v8' {
export * from 'v8'; export * from 'v8';

157
node_modules/@types/node/vm.d.ts generated vendored

@ -56,11 +56,17 @@ declare module 'vm' {
columnOffset?: number | undefined; columnOffset?: number | undefined;
} }
interface ScriptOptions extends BaseOptions { interface ScriptOptions extends BaseOptions {
displayErrors?: boolean | undefined; /**
timeout?: number | undefined; * V8's code cache data for the supplied source.
cachedData?: Buffer | undefined; */
cachedData?: Buffer | NodeJS.ArrayBufferView | undefined;
/** @deprecated in favor of `script.createCachedData()` */ /** @deprecated in favor of `script.createCachedData()` */
produceCachedData?: boolean | undefined; produceCachedData?: boolean | undefined;
/**
* Called during evaluation of this module when `import()` is called.
* If this option is not specified, calls to `import()` will reject with `ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`.
*/
importModuleDynamically?: ((specifier: string, script: Script, importAssertions: Object) => Module) | undefined;
} }
interface RunningScriptOptions extends BaseOptions { interface RunningScriptOptions extends BaseOptions {
/** /**
@ -80,10 +86,31 @@ declare module 'vm' {
* Default: `false`. * Default: `false`.
*/ */
breakOnSigint?: boolean | undefined; breakOnSigint?: boolean | undefined;
}
interface RunningScriptInNewContextOptions extends RunningScriptOptions {
/**
* Human-readable name of the newly created context.
*/
contextName?: CreateContextOptions['name'];
/**
* Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL,
* but with only the scheme, host, and port (if necessary), like the value of the `url.origin` property of a `URL` object.
* Most notably, this string should omit the trailing slash, as that denotes a path.
*/
contextOrigin?: CreateContextOptions['origin'];
contextCodeGeneration?: CreateContextOptions['codeGeneration'];
/** /**
* If set to `afterEvaluate`, microtasks will be run immediately after the script has run. * If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
*/ */
microtaskMode?: 'afterEvaluate' | undefined; microtaskMode?: CreateContextOptions['microtaskMode'];
}
interface RunningCodeOptions extends RunningScriptOptions {
cachedData?: ScriptOptions['cachedData'];
importModuleDynamically?: ScriptOptions['importModuleDynamically'];
}
interface RunningCodeInNewContextOptions extends RunningScriptInNewContextOptions {
cachedData?: ScriptOptions['cachedData'];
importModuleDynamically?: ScriptOptions['importModuleDynamically'];
} }
interface CompileFunctionOptions extends BaseOptions { interface CompileFunctionOptions extends BaseOptions {
/** /**
@ -144,7 +171,10 @@ declare module 'vm' {
* @default 'summary' * @default 'summary'
*/ */
mode?: MeasureMemoryMode | undefined; mode?: MeasureMemoryMode | undefined;
context?: Context | undefined; /**
* @default 'default'
*/
execution?: 'default' | 'eager' | undefined;
} }
interface MemoryMeasurement { interface MemoryMeasurement {
total: { total: {
@ -158,7 +188,7 @@ declare module 'vm' {
* @since v0.3.1 * @since v0.3.1
*/ */
class Script { class Script {
constructor(code: string, options?: ScriptOptions); constructor(code: string, options?: ScriptOptions | string);
/** /**
* Runs the compiled code contained by the `vm.Script` object within the given`contextifiedObject` and returns the result. Running code does not have access * Runs the compiled code contained by the `vm.Script` object within the given`contextifiedObject` and returns the result. Running code does not have access
* to local scope. * to local scope.
@ -220,7 +250,7 @@ declare module 'vm' {
* @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created. * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created.
* @return the result of the very last statement executed in the script. * @return the result of the very last statement executed in the script.
*/ */
runInNewContext(contextObject?: Context, options?: RunningScriptOptions): any; runInNewContext(contextObject?: Context, options?: RunningScriptInNewContextOptions): any;
/** /**
* Runs the compiled code contained by the `vm.Script` within the context of the * Runs the compiled code contained by the `vm.Script` within the context of the
* current `global` object. Running code does not have access to local scope, but _does_ have access to the current `global` object. * current `global` object. Running code does not have access to local scope, but _does_ have access to the current `global` object.
@ -273,6 +303,10 @@ declare module 'vm' {
cachedDataProduced?: boolean | undefined; cachedDataProduced?: boolean | undefined;
cachedDataRejected?: boolean | undefined; cachedDataRejected?: boolean | undefined;
cachedData?: Buffer | undefined; cachedData?: Buffer | undefined;
/**
* When the script is compiled from a source that contains a source map magic comment, this property will be set to the URL of the source map.
*/
sourceMapURL?: string | undefined;
} }
/** /**
* If given a `contextObject`, the `vm.createContext()` method will `prepare * If given a `contextObject`, the `vm.createContext()` method will `prepare
@ -345,7 +379,7 @@ declare module 'vm' {
* @param contextifiedObject The `contextified` object that will be used as the `global` when the `code` is compiled and run. * @param contextifiedObject The `contextified` object that will be used as the `global` when the `code` is compiled and run.
* @return the result of the very last statement executed in the script. * @return the result of the very last statement executed in the script.
*/ */
function runInContext(code: string, contextifiedObject: Context, options?: RunningScriptOptions | string): any; function runInContext(code: string, contextifiedObject: Context, options?: RunningCodeOptions | string): any;
/** /**
* The `vm.runInNewContext()` first contextifies the given `contextObject` (or * The `vm.runInNewContext()` first contextifies the given `contextObject` (or
* creates a new `contextObject` if passed as `undefined`), compiles the `code`, * creates a new `contextObject` if passed as `undefined`), compiles the `code`,
@ -374,7 +408,7 @@ declare module 'vm' {
* @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created. * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created.
* @return the result of the very last statement executed in the script. * @return the result of the very last statement executed in the script.
*/ */
function runInNewContext(code: string, contextObject?: Context, options?: RunningScriptOptions | string): any; function runInNewContext(code: string, contextObject?: Context, options?: RunningCodeInNewContextOptions | string): any;
/** /**
* `vm.runInThisContext()` compiles `code`, runs it within the context of the * `vm.runInThisContext()` compiles `code`, runs it within the context of the
* current `global` and returns the result. Running code does not have access to * current `global` and returns the result. Running code does not have access to
@ -437,7 +471,7 @@ declare module 'vm' {
* @param code The JavaScript code to compile and run. * @param code The JavaScript code to compile and run.
* @return the result of the very last statement executed in the script. * @return the result of the very last statement executed in the script.
*/ */
function runInThisContext(code: string, options?: RunningScriptOptions | string): any; function runInThisContext(code: string, options?: RunningCodeOptions | string): any;
/** /**
* Compiles the given code into the provided context (if no context is * Compiles the given code into the provided context (if no context is
* supplied, the current context is used), and returns it wrapped inside a * supplied, the current context is used), and returns it wrapped inside a
@ -446,7 +480,11 @@ declare module 'vm' {
* @param code The body of the function to compile. * @param code The body of the function to compile.
* @param params An array of strings containing all parameters for the function. * @param params An array of strings containing all parameters for the function.
*/ */
function compileFunction(code: string, params?: ReadonlyArray<string>, options?: CompileFunctionOptions): Function; function compileFunction(code: string, params?: ReadonlyArray<string>, options?: CompileFunctionOptions): Function & {
cachedData?: Script['cachedData'] | undefined;
cachedDataProduced?: Script['cachedDataProduced'] | undefined;
cachedDataRejected?: Script['cachedDataRejected'] | undefined;
};
/** /**
* Measure the memory known to V8 and used by all contexts known to the * Measure the memory known to V8 and used by all contexts known to the
* current V8 isolate, or the main context. * current V8 isolate, or the main context.
@ -503,6 +541,103 @@ declare module 'vm' {
* @experimental * @experimental
*/ */
function measureMemory(options?: MeasureMemoryOptions): Promise<MemoryMeasurement>; function measureMemory(options?: MeasureMemoryOptions): Promise<MemoryMeasurement>;
interface ModuleEvaluateOptions {
timeout?: RunningScriptOptions['timeout'] | undefined;
breakOnSigint?: RunningScriptOptions['breakOnSigint'] | undefined;
}
type ModuleLinker = (specifier: string, referencingModule: Module, extra: { assert: Object }) => Module | Promise<Module>;
type ModuleStatus = 'unlinked' | 'linking' | 'linked' | 'evaluating' | 'evaluated' | 'errored';
class Module {
/**
* The specifiers of all dependencies of this module.
*/
dependencySpecifiers: readonly string[];
/**
* If the `module.status` is `'errored'`, this property contains the exception thrown by the module during evaluation.
* If the status is anything else, accessing this property will result in a thrown exception.
*/
error: any;
/**
* The identifier of the current module, as set in the constructor.
*/
identifier: string;
context: Context;
/**
* The namespace object of the module. This is only available after linking (`module.link()`) has completed.
*/
namespace: Object;
/**
* The current status of the module.
*/
status: ModuleStatus;
/**
* Evaluate the module.
*
* This must be called after the module has been linked; otherwise it will reject
* It could be called also when the module has already been evaluated, in which case it will either do nothing
* if the initial evaluation ended in success (`module.status` is `'evaluated'`) or it will re-throw the exception
* that the initial evaluation resulted in (`module.status` is `'errored'`).
*
* This method cannot be called while the module is being evaluated (`module.status` is `'evaluating'`).
*/
evaluate(options?: ModuleEvaluateOptions): Promise<void>;
/**
* Link module dependencies. This method must be called before evaluation, and can only be called once per module.
*/
link(linker: ModuleLinker): Promise<void>;
}
interface SourceTextModuleOptions {
/**
* String used in stack traces.
* @default 'vm:module(i)' where i is a context-specific ascending index.
*/
identifier?: string | undefined;
cachedData?: ScriptOptions['cachedData'] | undefined;
context?: Context | undefined;
lineOffset?: BaseOptions['lineOffset'] | undefined;
columnOffset?: BaseOptions['columnOffset'] | undefined;
/**
* Called during evaluation of this module to initialize the `import.meta`.
*/
initializeImportMeta?: ((meta: ImportMeta, module: SourceTextModule) => void) | undefined;
importModuleDynamically?: ScriptOptions['importModuleDynamically'] | undefined;
}
class SourceTextModule extends Module {
/**
* Creates a new `SourceTextModule` instance.
* @param code JavaScript Module code to parse
*/
constructor(code: string, options?: SourceTextModuleOptions);
}
interface SyntheticModuleOptions {
/**
* String used in stack traces.
* @default 'vm:module(i)' where i is a context-specific ascending index.
*/
identifier?: string | undefined;
/**
* The contextified object as returned by the `vm.createContext()` method, to compile and evaluate this module in.
*/
context?: Context | undefined;
}
class SyntheticModule extends Module {
/**
* Creates a new `SyntheticModule` instance.
* @param exportNames Array of names that will be exported from the module.
* @param evaluateCallback Called when the module is evaluated.
*/
constructor(exportNames: string[], evaluateCallback: (this: SyntheticModule) => void, options?: SyntheticModuleOptions);
/**
* This method is used after the module is linked to set the values of exports.
* If it is called before the module is linked, an `ERR_VM_MODULE_STATUS` error will be thrown.
* @param name
* @param value
*/
setExport(name: string, value: any): void;
}
} }
declare module 'node:vm' { declare module 'node:vm' {
export * from 'vm'; export * from 'vm';

@ -8,7 +8,7 @@ This package contains type definitions for which (https://github.com/isaacs/node
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/which. Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/which.
### Additional Details ### Additional Details
* Last updated: Fri, 02 Jul 2021 18:05:37 GMT * Last updated: Tue, 14 Feb 2023 10:32:35 GMT
* Dependencies: none * Dependencies: none
* Global values: none * Global values: none

10
node_modules/@types/which/index.d.ts generated vendored

@ -8,22 +8,22 @@
/** Finds all instances of a specified executable in the PATH environment variable */ /** Finds all instances of a specified executable in the PATH environment variable */
declare function which( declare function which(
cmd: string, cmd: string,
options: which.AsyncOptions & which.OptionsAll, options: which.Options & which.AsyncOptions & which.OptionsAll,
cb: (err: Error | null, paths: ReadonlyArray<string> | undefined) => void, cb: (err: Error | null, paths: ReadonlyArray<string> | undefined) => void,
): void; ): void;
declare function which( declare function which(
cmd: string, cmd: string,
options: which.AsyncOptions & which.OptionsFirst, options: which.Options & which.AsyncOptions & which.OptionsFirst,
cb: (err: Error | null, path: string | undefined) => void, cb: (err: Error | null, path: string | undefined) => void,
): void; ): void;
declare function which( declare function which(
cmd: string, cmd: string,
options: which.AsyncOptions, options: which.Options & which.AsyncOptions,
cb: (err: Error | null, path: string | ReadonlyArray<string> | undefined) => void, cb: (err: Error | null, path: string | ReadonlyArray<string> | undefined) => void,
): void; ): void;
declare function which(cmd: string, cb: (err: Error | null, path: string | undefined) => void): void; declare function which(cmd: string, cb: (err: Error | null, path: string | undefined) => void): void;
declare function which(cmd: string, options: which.AsyncOptions & which.OptionsAll): Promise<string[]>; declare function which(cmd: string, options: which.Options & which.AsyncOptions & which.OptionsAll): Promise<string[]>;
declare function which(cmd: string, options?: which.AsyncOptions & which.OptionsFirst): Promise<string>; declare function which(cmd: string, options?: which.Options & which.AsyncOptions & which.OptionsFirst): Promise<string>;
declare namespace which { declare namespace which {
/** Finds all instances of a specified executable in the PATH environment variable */ /** Finds all instances of a specified executable in the PATH environment variable */

@ -1,6 +1,6 @@
{ {
"name": "@types/which", "name": "@types/which",
"version": "2.0.1", "version": "2.0.2",
"description": "TypeScript definitions for which", "description": "TypeScript definitions for which",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/which", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/which",
"license": "MIT", "license": "MIT",
@ -30,6 +30,6 @@
}, },
"scripts": {}, "scripts": {},
"dependencies": {}, "dependencies": {},
"typesPublisherContentHash": "b70db9efe60b94c4178ccefc342ca6a90ad08c44cb5a3bd77922b2768a452c52", "typesPublisherContentHash": "bb030e810883f6391704f6dba53e9fc0bb1b782bdbd6ba24719d196e92745b1e",
"typeScriptVersion": "3.6" "typeScriptVersion": "4.2"
} }

34
node_modules/fs-extra/README.md generated vendored

@ -5,7 +5,7 @@ Node.js: fs-extra
[![npm Package](https://img.shields.io/npm/v/fs-extra.svg)](https://www.npmjs.org/package/fs-extra) [![npm Package](https://img.shields.io/npm/v/fs-extra.svg)](https://www.npmjs.org/package/fs-extra)
[![License](https://img.shields.io/npm/l/fs-extra.svg)](https://github.com/jprichardson/node-fs-extra/blob/master/LICENSE) [![License](https://img.shields.io/npm/l/fs-extra.svg)](https://github.com/jprichardson/node-fs-extra/blob/master/LICENSE)
[![build status](https://img.shields.io/github/workflow/status/jprichardson/node-fs-extra/Node.js%20CI/master)](https://github.com/jprichardson/node-fs-extra/actions/workflows/ci.yml?query=branch%3Amaster) [![build status](https://img.shields.io/github/actions/workflow/status/jprichardson/node-fs-extra/ci.yml?branch=master)](https://github.com/jprichardson/node-fs-extra/actions/workflows/ci.yml?query=branch%3Amaster)
[![downloads per month](http://img.shields.io/npm/dm/fs-extra.svg)](https://www.npmjs.org/package/fs-extra) [![downloads per month](http://img.shields.io/npm/dm/fs-extra.svg)](https://www.npmjs.org/package/fs-extra)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
@ -27,6 +27,8 @@ Installation
Usage Usage
----- -----
### CommonJS
`fs-extra` is a drop in replacement for native `fs`. All methods in `fs` are attached to `fs-extra`. All `fs` methods return promises if the callback isn't passed. `fs-extra` is a drop in replacement for native `fs`. All methods in `fs` are attached to `fs-extra`. All `fs` methods return promises if the callback isn't passed.
You don't ever need to include the original `fs` module again: You don't ever need to include the original `fs` module again:
@ -55,6 +57,31 @@ const fs = require('fs')
const fse = require('fs-extra') const fse = require('fs-extra')
``` ```
### ESM
There is also an `fs-extra/esm` import, that supports both default and named exports. However, note that `fs` methods are not included in `fs-extra/esm`; you still need to import `fs` and/or `fs/promises` seperately:
```js
import { readFileSync } from 'fs'
import { readFile } from 'fs/promises'
import { outputFile, outputFileSync } from 'fs-extra/esm'
```
Default exports are supported:
```js
import fs from 'fs'
import fse from 'fs-extra/esm'
// fse.readFileSync is not a function; must use fs.readFileSync
```
but you probably want to just use regular `fs-extra` instead of `fs-extra/esm` for default exports:
```js
import fs from 'fs-extra'
// both fs and fs-extra methods are defined
```
Sync vs Async vs Async/Await Sync vs Async vs Async/Await
------------- -------------
Most methods are async by default. All async methods will return a promise if the callback isn't passed. Most methods are async by default. All async methods will return a promise if the callback isn't passed.
@ -197,7 +224,10 @@ fs-extra contains hundreds of tests.
- `npm run lint`: runs the linter ([standard](http://standardjs.com/)) - `npm run lint`: runs the linter ([standard](http://standardjs.com/))
- `npm run unit`: runs the unit tests - `npm run unit`: runs the unit tests
- `npm test`: runs both the linter and the tests - `npm run unit-esm`: runs tests for `fs-extra/esm` exports
- `npm test`: runs the linter and all tests
When running unit tests, set the environment variable `CROSS_DEVICE_PATH` to the absolute path of an empty directory on another device (like a thumb drive) to enable cross-device move tests.
### Windows ### Windows

@ -26,21 +26,12 @@ function copySync (src, dest, opts) {
const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts) const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts)
stat.checkParentPathsSync(src, srcStat, dest, 'copy') stat.checkParentPathsSync(src, srcStat, dest, 'copy')
return handleFilterAndCopy(destStat, src, dest, opts)
}
function handleFilterAndCopy (destStat, src, dest, opts) {
if (opts.filter && !opts.filter(src, dest)) return if (opts.filter && !opts.filter(src, dest)) return
const destParent = path.dirname(dest) const destParent = path.dirname(dest)
if (!fs.existsSync(destParent)) mkdirsSync(destParent) if (!fs.existsSync(destParent)) mkdirsSync(destParent)
return getStats(destStat, src, dest, opts) return getStats(destStat, src, dest, opts)
} }
function startCopy (destStat, src, dest, opts) {
if (opts.filter && !opts.filter(src, dest)) return
return getStats(destStat, src, dest, opts)
}
function getStats (destStat, src, dest, opts) { function getStats (destStat, src, dest, opts) {
const statSync = opts.dereference ? fs.statSync : fs.lstatSync const statSync = opts.dereference ? fs.statSync : fs.lstatSync
const srcStat = statSync(src) const srcStat = statSync(src)
@ -121,8 +112,9 @@ function copyDir (src, dest, opts) {
function copyDirItem (item, src, dest, opts) { function copyDirItem (item, src, dest, opts) {
const srcItem = path.join(src, item) const srcItem = path.join(src, item)
const destItem = path.join(dest, item) const destItem = path.join(dest, item)
if (opts.filter && !opts.filter(srcItem, destItem)) return
const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts) const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts)
return startCopy(destStat, srcItem, destItem, opts) return getStats(destStat, srcItem, destItem, opts)
} }
function onLink (destStat, src, dest, opts) { function onLink (destStat, src, dest, opts) {
@ -154,7 +146,7 @@ function onLink (destStat, src, dest, opts) {
// prevent copy if src is a subdir of dest since unlinking // prevent copy if src is a subdir of dest since unlinking
// dest in this case would result in removing src contents // dest in this case would result in removing src contents
// and therefore a broken symlink would be created. // and therefore a broken symlink would be created.
if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`) throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
} }
return copyLink(resolvedSrc, dest) return copyLink(resolvedSrc, dest)

@ -35,8 +35,12 @@ function copy (src, dest, opts, cb) {
const { srcStat, destStat } = stats const { srcStat, destStat } = stats
stat.checkParentPaths(src, srcStat, dest, 'copy', err => { stat.checkParentPaths(src, srcStat, dest, 'copy', err => {
if (err) return cb(err) if (err) return cb(err)
if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb) runFilter(src, dest, opts, (err, include) => {
return checkParentDir(destStat, src, dest, opts, cb) if (err) return cb(err)
if (!include) return cb()
checkParentDir(destStat, src, dest, opts, cb)
})
}) })
}) })
} }
@ -53,16 +57,10 @@ function checkParentDir (destStat, src, dest, opts, cb) {
}) })
} }
function handleFilter (onInclude, destStat, src, dest, opts, cb) { function runFilter (src, dest, opts, cb) {
Promise.resolve(opts.filter(src, dest)).then(include => { if (!opts.filter) return cb(null, true)
if (include) return onInclude(destStat, src, dest, opts, cb) Promise.resolve(opts.filter(src, dest))
return cb() .then(include => cb(null, include), error => cb(error))
}, error => cb(error))
}
function startCopy (destStat, src, dest, opts, cb) {
if (opts.filter) return handleFilter(getStats, destStat, src, dest, opts, cb)
return getStats(destStat, src, dest, opts, cb)
} }
function getStats (destStat, src, dest, opts, cb) { function getStats (destStat, src, dest, opts, cb) {
@ -178,12 +176,17 @@ function copyDirItems (items, src, dest, opts, cb) {
function copyDirItem (items, item, src, dest, opts, cb) { function copyDirItem (items, item, src, dest, opts, cb) {
const srcItem = path.join(src, item) const srcItem = path.join(src, item)
const destItem = path.join(dest, item) const destItem = path.join(dest, item)
stat.checkPaths(srcItem, destItem, 'copy', opts, (err, stats) => { runFilter(srcItem, destItem, opts, (err, include) => {
if (err) return cb(err) if (err) return cb(err)
const { destStat } = stats if (!include) return copyDirItems(items, src, dest, opts, cb)
startCopy(destStat, srcItem, destItem, opts, err => {
stat.checkPaths(srcItem, destItem, 'copy', opts, (err, stats) => {
if (err) return cb(err) if (err) return cb(err)
return copyDirItems(items, src, dest, opts, cb) const { destStat } = stats
getStats(destStat, srcItem, destItem, opts, err => {
if (err) return cb(err)
return copyDirItems(items, src, dest, opts, cb)
})
}) })
}) })
} }
@ -216,7 +219,7 @@ function onLink (destStat, src, dest, opts, cb) {
// do not copy if src is a subdir of dest since unlinking // do not copy if src is a subdir of dest since unlinking
// dest in this case would result in removing src contents // dest in this case would result in removing src contents
// and therefore a broken symlink would be created. // and therefore a broken symlink would be created.
if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)) return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`))
} }
return copyLink(resolvedSrc, dest, cb) return copyLink(resolvedSrc, dest, cb)

68
node_modules/fs-extra/lib/esm.mjs generated vendored Normal file

@ -0,0 +1,68 @@
import _copy from './copy/index.js'
import _empty from './empty/index.js'
import _ensure from './ensure/index.js'
import _json from './json/index.js'
import _mkdirs from './mkdirs/index.js'
import _move from './move/index.js'
import _outputFile from './output-file/index.js'
import _pathExists from './path-exists/index.js'
import _remove from './remove/index.js'
// NOTE: Only exports fs-extra's functions; fs functions must be imported from "node:fs" or "node:fs/promises"
export const copy = _copy.copy
export const copySync = _copy.copySync
export const emptyDirSync = _empty.emptyDirSync
export const emptydirSync = _empty.emptydirSync
export const emptyDir = _empty.emptyDir
export const emptydir = _empty.emptydir
export const createFile = _ensure.createFile
export const createFileSync = _ensure.createFileSync
export const ensureFile = _ensure.ensureFile
export const ensureFileSync = _ensure.ensureFileSync
export const createLink = _ensure.createLink
export const createLinkSync = _ensure.createLinkSync
export const ensureLink = _ensure.ensureLink
export const ensureLinkSync = _ensure.ensureLinkSync
export const createSymlink = _ensure.createSymlink
export const createSymlinkSync = _ensure.createSymlinkSync
export const ensureSymlink = _ensure.ensureSymlink
export const ensureSymlinkSync = _ensure.ensureSymlinkSync
export const readJson = _json.readJson
export const readJSON = _json.readJSON
export const readJsonSync = _json.readJsonSync
export const readJSONSync = _json.readJSONSync
export const writeJson = _json.writeJson
export const writeJSON = _json.writeJSON
export const writeJsonSync = _json.writeJsonSync
export const writeJSONSync = _json.writeJSONSync
export const outputJson = _json.outputJson
export const outputJSON = _json.outputJSON
export const outputJsonSync = _json.outputJsonSync
export const outputJSONSync = _json.outputJSONSync
export const mkdirs = _mkdirs.mkdirs
export const mkdirsSync = _mkdirs.mkdirsSync
export const mkdirp = _mkdirs.mkdirp
export const mkdirpSync = _mkdirs.mkdirpSync
export const ensureDir = _mkdirs.ensureDir
export const ensureDirSync = _mkdirs.ensureDirSync
export const move = _move.move
export const moveSync = _move.moveSync
export const outputFile = _outputFile.outputFile
export const outputFileSync = _outputFile.outputFileSync
export const pathExists = _pathExists.pathExists
export const pathExistsSync = _pathExists.pathExistsSync
export const remove = _remove.remove
export const removeSync = _remove.removeSync
export default {
..._copy,
..._empty,
..._ensure,
..._json,
..._mkdirs,
..._move,
..._outputFile,
..._pathExists,
..._remove
}

@ -41,8 +41,7 @@ const api = [
'writeFile' 'writeFile'
].filter(key => { ].filter(key => {
// Some commands are not available on some systems. Ex: // Some commands are not available on some systems. Ex:
// fs.opendir was added in Node.js v12.12.0 // fs.cp was added in Node.js v16.7.0
// fs.rm was added in Node.js v14.14.0
// fs.lchown is not available on at least some Linux // fs.lchown is not available on at least some Linux
return typeof fs[key] === 'function' return typeof fs[key] === 'function'
}) })
@ -66,7 +65,7 @@ exports.exists = function (filename, callback) {
}) })
} }
// fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args // fs.read(), fs.write(), fs.readv(), & fs.writev() need special treatment due to multiple callback args
exports.read = function (fd, buffer, offset, length, position, callback) { exports.read = function (fd, buffer, offset, length, position, callback) {
if (typeof callback === 'function') { if (typeof callback === 'function') {
@ -98,23 +97,36 @@ exports.write = function (fd, buffer, ...args) {
}) })
} }
// fs.writev only available in Node v12.9.0+ // Function signature is
if (typeof fs.writev === 'function') { // s.readv(fd, buffers[, position], callback)
// Function signature is // We need to handle the optional arg, so we use ...args
// s.writev(fd, buffers[, position], callback) exports.readv = function (fd, buffers, ...args) {
// We need to handle the optional arg, so we use ...args if (typeof args[args.length - 1] === 'function') {
exports.writev = function (fd, buffers, ...args) { return fs.readv(fd, buffers, ...args)
if (typeof args[args.length - 1] === 'function') {
return fs.writev(fd, buffers, ...args)
}
return new Promise((resolve, reject) => {
fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {
if (err) return reject(err)
resolve({ bytesWritten, buffers })
})
})
} }
return new Promise((resolve, reject) => {
fs.readv(fd, buffers, ...args, (err, bytesRead, buffers) => {
if (err) return reject(err)
resolve({ bytesRead, buffers })
})
})
}
// Function signature is
// s.writev(fd, buffers[, position], callback)
// We need to handle the optional arg, so we use ...args
exports.writev = function (fd, buffers, ...args) {
if (typeof args[args.length - 1] === 'function') {
return fs.writev(fd, buffers, ...args)
}
return new Promise((resolve, reject) => {
fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {
if (err) return reject(err)
resolve({ bytesWritten, buffers })
})
})
} }
// fs.realpath.native sometimes not available if fs is monkey-patched // fs.realpath.native sometimes not available if fs is monkey-patched

@ -45,7 +45,8 @@ function rename (src, dest, overwrite) {
function moveAcrossDevice (src, dest, overwrite) { function moveAcrossDevice (src, dest, overwrite) {
const opts = { const opts = {
overwrite, overwrite,
errorOnExist: true errorOnExist: true,
preserveTimestamps: true
} }
copySync(src, dest, opts) copySync(src, dest, opts)
return removeSync(src) return removeSync(src)

@ -64,7 +64,8 @@ function rename (src, dest, overwrite, cb) {
function moveAcrossDevice (src, dest, overwrite, cb) { function moveAcrossDevice (src, dest, overwrite, cb) {
const opts = { const opts = {
overwrite, overwrite,
errorOnExist: true errorOnExist: true,
preserveTimestamps: true
} }
copy(src, dest, opts, err => { copy(src, dest, opts, err => {
if (err) return cb(err) if (err) return cb(err)

@ -2,18 +2,13 @@
const fs = require('graceful-fs') const fs = require('graceful-fs')
const u = require('universalify').fromCallback const u = require('universalify').fromCallback
const rimraf = require('./rimraf')
function remove (path, callback) { function remove (path, callback) {
// Node 14.14.0+ fs.rm(path, { recursive: true, force: true }, callback)
if (fs.rm) return fs.rm(path, { recursive: true, force: true }, callback)
rimraf(path, callback)
} }
function removeSync (path) { function removeSync (path) {
// Node 14.14.0+ fs.rmSync(path, { recursive: true, force: true })
if (fs.rmSync) return fs.rmSync(path, { recursive: true, force: true })
rimraf.sync(path)
} }
module.exports = { module.exports = {

@ -1,302 +0,0 @@
'use strict'
const fs = require('graceful-fs')
const path = require('path')
const assert = require('assert')
const isWindows = (process.platform === 'win32')
function defaults (options) {
const methods = [
'unlink',
'chmod',
'stat',
'lstat',
'rmdir',
'readdir'
]
methods.forEach(m => {
options[m] = options[m] || fs[m]
m = m + 'Sync'
options[m] = options[m] || fs[m]
})
options.maxBusyTries = options.maxBusyTries || 3
}
function rimraf (p, options, cb) {
let busyTries = 0
if (typeof options === 'function') {
cb = options
options = {}
}
assert(p, 'rimraf: missing path')
assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string')
assert.strictEqual(typeof cb, 'function', 'rimraf: callback function required')
assert(options, 'rimraf: invalid options argument provided')
assert.strictEqual(typeof options, 'object', 'rimraf: options should be object')
defaults(options)
rimraf_(p, options, function CB (er) {
if (er) {
if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') &&
busyTries < options.maxBusyTries) {
busyTries++
const time = busyTries * 100
// try again, with the same exact callback as this one.
return setTimeout(() => rimraf_(p, options, CB), time)
}
// already gone
if (er.code === 'ENOENT') er = null
}
cb(er)
})
}
// Two possible strategies.
// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR
// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR
//
// Both result in an extra syscall when you guess wrong. However, there
// are likely far more normal files in the world than directories. This
// is based on the assumption that a the average number of files per
// directory is >= 1.
//
// If anyone ever complains about this, then I guess the strategy could
// be made configurable somehow. But until then, YAGNI.
function rimraf_ (p, options, cb) {
assert(p)
assert(options)
assert(typeof cb === 'function')
// sunos lets the root user unlink directories, which is... weird.
// so we have to lstat here and make sure it's not a dir.
options.lstat(p, (er, st) => {
if (er && er.code === 'ENOENT') {
return cb(null)
}
// Windows can EPERM on stat. Life is suffering.
if (er && er.code === 'EPERM' && isWindows) {
return fixWinEPERM(p, options, er, cb)
}
if (st && st.isDirectory()) {
return rmdir(p, options, er, cb)
}
options.unlink(p, er => {
if (er) {
if (er.code === 'ENOENT') {
return cb(null)
}
if (er.code === 'EPERM') {
return (isWindows)
? fixWinEPERM(p, options, er, cb)
: rmdir(p, options, er, cb)
}
if (er.code === 'EISDIR') {
return rmdir(p, options, er, cb)
}
}
return cb(er)
})
})
}
function fixWinEPERM (p, options, er, cb) {
assert(p)
assert(options)
assert(typeof cb === 'function')
options.chmod(p, 0o666, er2 => {
if (er2) {
cb(er2.code === 'ENOENT' ? null : er)
} else {
options.stat(p, (er3, stats) => {
if (er3) {
cb(er3.code === 'ENOENT' ? null : er)
} else if (stats.isDirectory()) {
rmdir(p, options, er, cb)
} else {
options.unlink(p, cb)
}
})
}
})
}
function fixWinEPERMSync (p, options, er) {
let stats
assert(p)
assert(options)
try {
options.chmodSync(p, 0o666)
} catch (er2) {
if (er2.code === 'ENOENT') {
return
} else {
throw er
}
}
try {
stats = options.statSync(p)
} catch (er3) {
if (er3.code === 'ENOENT') {
return
} else {
throw er
}
}
if (stats.isDirectory()) {
rmdirSync(p, options, er)
} else {
options.unlinkSync(p)
}
}
function rmdir (p, options, originalEr, cb) {
assert(p)
assert(options)
assert(typeof cb === 'function')
// try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
// if we guessed wrong, and it's not a directory, then
// raise the original error.
options.rmdir(p, er => {
if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) {
rmkids(p, options, cb)
} else if (er && er.code === 'ENOTDIR') {
cb(originalEr)
} else {
cb(er)
}
})
}
function rmkids (p, options, cb) {
assert(p)
assert(options)
assert(typeof cb === 'function')
options.readdir(p, (er, files) => {
if (er) return cb(er)
let n = files.length
let errState
if (n === 0) return options.rmdir(p, cb)
files.forEach(f => {
rimraf(path.join(p, f), options, er => {
if (errState) {
return
}
if (er) return cb(errState = er)
if (--n === 0) {
options.rmdir(p, cb)
}
})
})
})
}
// this looks simpler, and is strictly *faster*, but will
// tie up the JavaScript thread and fail on excessively
// deep directory trees.
function rimrafSync (p, options) {
let st
options = options || {}
defaults(options)
assert(p, 'rimraf: missing path')
assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string')
assert(options, 'rimraf: missing options')
assert.strictEqual(typeof options, 'object', 'rimraf: options should be object')
try {
st = options.lstatSync(p)
} catch (er) {
if (er.code === 'ENOENT') {
return
}
// Windows can EPERM on stat. Life is suffering.
if (er.code === 'EPERM' && isWindows) {
fixWinEPERMSync(p, options, er)
}
}
try {
// sunos lets the root user unlink directories, which is... weird.
if (st && st.isDirectory()) {
rmdirSync(p, options, null)
} else {
options.unlinkSync(p)
}
} catch (er) {
if (er.code === 'ENOENT') {
return
} else if (er.code === 'EPERM') {
return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)
} else if (er.code !== 'EISDIR') {
throw er
}
rmdirSync(p, options, er)
}
}
function rmdirSync (p, options, originalEr) {
assert(p)
assert(options)
try {
options.rmdirSync(p)
} catch (er) {
if (er.code === 'ENOTDIR') {
throw originalEr
} else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') {
rmkidsSync(p, options)
} else if (er.code !== 'ENOENT') {
throw er
}
}
}
function rmkidsSync (p, options) {
assert(p)
assert(options)
options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options))
if (isWindows) {
// We only end up here once we got ENOTEMPTY at least once, and
// at this point, we are guaranteed to have removed all the kids.
// So, we know that it won't be ENOENT or ENOTDIR or anything else.
// try really hard to delete stuff on windows, because it has a
// PROFOUNDLY annoying habit of not closing handles promptly when
// files are deleted, resulting in spurious ENOTEMPTY errors.
const startTime = Date.now()
do {
try {
const ret = options.rmdirSync(p, options)
return ret
} catch {}
} while (Date.now() - startTime < 500) // give up after 500ms
} else {
const ret = options.rmdirSync(p, options)
return ret
}
}
module.exports = rimraf
rimraf.sync = rimrafSync

18
node_modules/fs-extra/package.json generated vendored

@ -1,9 +1,9 @@
{ {
"name": "fs-extra", "name": "fs-extra",
"version": "10.1.0", "version": "11.1.1",
"description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.", "description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.",
"engines": { "engines": {
"node": ">=12" "node": ">=14.14"
}, },
"homepage": "https://github.com/jprichardson/node-fs-extra", "homepage": "https://github.com/jprichardson/node-fs-extra",
"repository": { "repository": {
@ -42,17 +42,20 @@
"universalify": "^2.0.0" "universalify": "^2.0.0"
}, },
"devDependencies": { "devDependencies": {
"at-least-node": "^1.0.0",
"klaw": "^2.1.1", "klaw": "^2.1.1",
"klaw-sync": "^3.0.2", "klaw-sync": "^3.0.2",
"minimist": "^1.1.1", "minimist": "^1.1.1",
"mocha": "^5.0.5", "mocha": "^10.1.0",
"nyc": "^15.0.0", "nyc": "^15.0.0",
"proxyquire": "^2.0.1", "proxyquire": "^2.0.1",
"read-dir-files": "^0.1.1", "read-dir-files": "^0.1.1",
"standard": "^16.0.3" "standard": "^17.0.0"
}, },
"main": "./lib/index.js", "main": "./lib/index.js",
"exports": {
".": "./lib/index.js",
"./esm": "./lib/esm.mjs"
},
"files": [ "files": [
"lib/", "lib/",
"!lib/**/__tests__/" "!lib/**/__tests__/"
@ -60,8 +63,9 @@
"scripts": { "scripts": {
"lint": "standard", "lint": "standard",
"test-find": "find ./lib/**/__tests__ -name *.test.js | xargs mocha", "test-find": "find ./lib/**/__tests__ -name *.test.js | xargs mocha",
"test": "npm run lint && npm run unit", "test": "npm run lint && npm run unit && npm run unit-esm",
"unit": "nyc node test.js" "unit": "nyc node test.js",
"unit-esm": "node test.mjs"
}, },
"sideEffects": false "sideEffects": false
} }

@ -1,7 +1,7 @@
{ {
"name": "graceful-fs", "name": "graceful-fs",
"description": "A drop-in replacement for fs, making various improvements.", "description": "A drop-in replacement for fs, making various improvements.",
"version": "4.2.10", "version": "4.2.11",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/isaacs/node-graceful-fs" "url": "https://github.com/isaacs/node-graceful-fs"
@ -38,7 +38,7 @@
"import-fresh": "^2.0.0", "import-fresh": "^2.0.0",
"mkdirp": "^0.5.0", "mkdirp": "^0.5.0",
"rimraf": "^2.2.8", "rimraf": "^2.2.8",
"tap": "^12.7.0" "tap": "^16.3.4"
}, },
"files": [ "files": [
"fs.js", "fs.js",
@ -46,5 +46,8 @@
"legacy-streams.js", "legacy-streams.js",
"polyfills.js", "polyfills.js",
"clone.js" "clone.js"
] ],
"tap": {
"reporter": "classic"
}
} }

@ -101,7 +101,7 @@ function patch (fs) {
var backoff = 0; var backoff = 0;
fs$rename(from, to, function CB (er) { fs$rename(from, to, function CB (er) {
if (er if (er
&& (er.code === "EACCES" || er.code === "EPERM") && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY")
&& Date.now() - start < 60000) { && Date.now() - start < 60000) {
setTimeout(function() { setTimeout(function() {
fs.stat(to, function (stater, st) { fs.stat(to, function (stater, st) {

75
node_modules/minimist/.eslintrc generated vendored

@ -1,54 +1,29 @@
{ {
"root": true, "root": true,
"extends": "@ljharb/eslint-config/node/0.4", "extends": "@ljharb/eslint-config/node/0.4",
"rules": { "rules": {
"array-bracket-spacing": 0, "array-element-newline": 0,
"array-element-newline": 0, "complexity": 0,
"brace-style": 1, "func-style": [2, "declaration"],
"camelcase": 1, "max-lines-per-function": 0,
"comma-dangle": 1, "max-nested-callbacks": 1,
"comma-spacing": 1, "max-statements-per-line": 1,
"complexity": 0, "max-statements": 0,
"curly": 1, "multiline-comment-style": 0,
"dot-notation": 1, "no-continue": 1,
"eol-last": 1, "no-param-reassign": 1,
"func-style": 1, "no-restricted-syntax": 1,
"function-paren-newline": 1, "object-curly-newline": 0,
"indent": [1, 4], },
"key-spacing": 1,
"max-lines-per-function": 0, "overrides": [
"max-nested-callbacks": 1, {
"max-statements": 0, "files": "test/**",
"multiline-comment-style": 1, "rules": {
"no-array-constructor": 1, "camelcase": 0,
"no-continue": 1, },
"no-div-regex": 1, },
"no-extra-parens": 1, ]
"no-mixed-operators": 1,
"no-multi-spaces": 1,
"no-multiple-empty-lines": 1,
"no-param-reassign": 1,
"no-plusplus": 1,
"no-proto": 1,
"no-redeclare": 1,
"no-restricted-syntax": 1,
"no-shadow": 1,
"no-trailing-spaces": 1,
"no-unused-vars": 1,
"no-use-before-define": 1,
"object-curly-newline": 1,
"object-curly-spacing": 1,
"operator-linebreak": 1,
"quote-props": 1,
"quotes": 1,
"semi-style": 1,
"semi": 1,
"space-before-blocks": 1,
"space-before-function-paren": 1,
"space-infix-ops": 1,
"strict": 1,
"wrap-regex": 1,
},
} }

88
node_modules/minimist/CHANGELOG.md generated vendored

@ -5,6 +5,52 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.2.8](https://github.com/minimistjs/minimist/compare/v1.2.7...v1.2.8) - 2023-02-09
### Merged
- [Fix] Fix long option followed by single dash [`#17`](https://github.com/minimistjs/minimist/pull/17)
- [Tests] Remove duplicate test [`#12`](https://github.com/minimistjs/minimist/pull/12)
- [Fix] opt.string works with multiple aliases [`#10`](https://github.com/minimistjs/minimist/pull/10)
### Fixed
- [Fix] Fix long option followed by single dash (#17) [`#15`](https://github.com/minimistjs/minimist/issues/15)
- [Tests] Remove duplicate test (#12) [`#8`](https://github.com/minimistjs/minimist/issues/8)
- [Fix] Fix long option followed by single dash [`#15`](https://github.com/minimistjs/minimist/issues/15)
- [Fix] opt.string works with multiple aliases (#10) [`#9`](https://github.com/minimistjs/minimist/issues/9)
- [Fix] Fix handling of short option with non-trivial equals [`#5`](https://github.com/minimistjs/minimist/issues/5)
- [Tests] Remove duplicate test [`#8`](https://github.com/minimistjs/minimist/issues/8)
- [Fix] opt.string works with multiple aliases [`#9`](https://github.com/minimistjs/minimist/issues/9)
### Commits
- Merge tag 'v0.2.3' [`a026794`](https://github.com/minimistjs/minimist/commit/a0267947c7870fc5847cf2d437fbe33f392767da)
- [eslint] fix indentation and whitespace [`5368ca4`](https://github.com/minimistjs/minimist/commit/5368ca4147e974138a54cc0dc4cea8f756546b70)
- [eslint] fix indentation and whitespace [`e5f5067`](https://github.com/minimistjs/minimist/commit/e5f5067259ceeaf0b098d14bec910f87e58708c7)
- [eslint] more cleanup [`62fde7d`](https://github.com/minimistjs/minimist/commit/62fde7d935f83417fb046741531a9e2346a36976)
- [eslint] more cleanup [`36ac5d0`](https://github.com/minimistjs/minimist/commit/36ac5d0d95e4947d074e5737d94814034ca335d1)
- [meta] add `auto-changelog` [`73923d2`](https://github.com/minimistjs/minimist/commit/73923d223553fca08b1ba77e3fbc2a492862ae4c)
- [actions] add reusable workflows [`d80727d`](https://github.com/minimistjs/minimist/commit/d80727df77bfa9e631044d7f16368d8f09242c91)
- [eslint] add eslint; rules to enable later are warnings [`48bc06a`](https://github.com/minimistjs/minimist/commit/48bc06a1b41f00e9cdf183db34f7a51ba70e98d4)
- [eslint] fix indentation [`34b0f1c`](https://github.com/minimistjs/minimist/commit/34b0f1ccaa45183c3c4f06a91f9b405180a6f982)
- [readme] rename and add badges [`5df0fe4`](https://github.com/minimistjs/minimist/commit/5df0fe49211bd09a3636f8686a7cb3012c3e98f0)
- [Dev Deps] switch from `covert` to `nyc` [`a48b128`](https://github.com/minimistjs/minimist/commit/a48b128fdb8d427dfb20a15273f83e38d97bef07)
- [Dev Deps] update `covert`, `tape`; remove unnecessary `tap` [`f0fb958`](https://github.com/minimistjs/minimist/commit/f0fb958e9a1fe980cdffc436a211b0bda58f621b)
- [meta] create FUNDING.yml; add `funding` in package.json [`3639e0c`](https://github.com/minimistjs/minimist/commit/3639e0c819359a366387e425ab6eabf4c78d3caa)
- [meta] use `npmignore` to autogenerate an npmignore file [`be2e038`](https://github.com/minimistjs/minimist/commit/be2e038c342d8333b32f0fde67a0026b79c8150e)
- Only apps should have lockfiles [`282b570`](https://github.com/minimistjs/minimist/commit/282b570e7489d01b03f2d6d3dabf79cd3e5f84cf)
- isConstructorOrProto adapted from PR [`ef9153f`](https://github.com/minimistjs/minimist/commit/ef9153fc52b6cea0744b2239921c5dcae4697f11)
- [Dev Deps] update `@ljharb/eslint-config`, `aud` [`098873c`](https://github.com/minimistjs/minimist/commit/098873c213cdb7c92e55ae1ef5aa1af3a8192a79)
- [Dev Deps] update `@ljharb/eslint-config`, `aud` [`3124ed3`](https://github.com/minimistjs/minimist/commit/3124ed3e46306301ebb3c834874ce0241555c2c4)
- [meta] add `safe-publish-latest` [`4b927de`](https://github.com/minimistjs/minimist/commit/4b927de696d561c636b4f43bf49d4597cb36d6d6)
- [Tests] add `aud` in `posttest` [`b32d9bd`](https://github.com/minimistjs/minimist/commit/b32d9bd0ab340f4e9f8c3a97ff2a4424f25fab8c)
- [meta] update repo URLs [`f9fdfc0`](https://github.com/minimistjs/minimist/commit/f9fdfc032c54884d9a9996a390c63cd0719bbe1a)
- [actions] Avoid 0.6 tests due to build failures [`ba92fe6`](https://github.com/minimistjs/minimist/commit/ba92fe6ebbdc0431cca9a2ea8f27beb492f5e4ec)
- [Dev Deps] update `tape` [`950eaa7`](https://github.com/minimistjs/minimist/commit/950eaa74f112e04d23e9c606c67472c46739b473)
- [Dev Deps] add missing `npmignore` dev dep [`3226afa`](https://github.com/minimistjs/minimist/commit/3226afaf09e9d127ca369742437fe6e88f752d6b)
- Merge tag 'v0.2.2' [`980d7ac`](https://github.com/minimistjs/minimist/commit/980d7ac61a0b4bd552711251ac107d506b23e41f)
## [v1.2.7](https://github.com/minimistjs/minimist/compare/v1.2.6...v1.2.7) - 2022-10-10 ## [v1.2.7](https://github.com/minimistjs/minimist/compare/v1.2.6...v1.2.7) - 2022-10-10
### Commits ### Commits
@ -109,13 +155,53 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- coverage script [`e5531ba`](https://github.com/minimistjs/minimist/commit/e5531ba0479da3b8138d3d8cac545d84ccb1c8df) - coverage script [`e5531ba`](https://github.com/minimistjs/minimist/commit/e5531ba0479da3b8138d3d8cac545d84ccb1c8df)
- extra fn to get 100% coverage again [`a6972da`](https://github.com/minimistjs/minimist/commit/a6972da89e56bf77642f8ec05a13b6558db93498) - extra fn to get 100% coverage again [`a6972da`](https://github.com/minimistjs/minimist/commit/a6972da89e56bf77642f8ec05a13b6558db93498)
## [v1.0.0](https://github.com/minimistjs/minimist/compare/v0.2.1...v1.0.0) - 2014-08-10 ## [v1.0.0](https://github.com/minimistjs/minimist/compare/v0.2.3...v1.0.0) - 2014-08-10
### Commits ### Commits
- added stopEarly option [`471c7e4`](https://github.com/minimistjs/minimist/commit/471c7e4a7e910fc7ad8f9df850a186daf32c64e9) - added stopEarly option [`471c7e4`](https://github.com/minimistjs/minimist/commit/471c7e4a7e910fc7ad8f9df850a186daf32c64e9)
- fix list [`fef6ae7`](https://github.com/minimistjs/minimist/commit/fef6ae79c38b9dc1c49569abb7cd04eb965eac5e) - fix list [`fef6ae7`](https://github.com/minimistjs/minimist/commit/fef6ae79c38b9dc1c49569abb7cd04eb965eac5e)
## [v0.2.3](https://github.com/minimistjs/minimist/compare/v0.2.2...v0.2.3) - 2023-02-09
### Merged
- [Fix] Fix long option followed by single dash [`#17`](https://github.com/minimistjs/minimist/pull/17)
- [Tests] Remove duplicate test [`#12`](https://github.com/minimistjs/minimist/pull/12)
- [Fix] opt.string works with multiple aliases [`#10`](https://github.com/minimistjs/minimist/pull/10)
### Fixed
- [Fix] Fix long option followed by single dash (#17) [`#15`](https://github.com/minimistjs/minimist/issues/15)
- [Tests] Remove duplicate test (#12) [`#8`](https://github.com/minimistjs/minimist/issues/8)
- [Fix] opt.string works with multiple aliases (#10) [`#9`](https://github.com/minimistjs/minimist/issues/9)
### Commits
- [eslint] fix indentation and whitespace [`e5f5067`](https://github.com/minimistjs/minimist/commit/e5f5067259ceeaf0b098d14bec910f87e58708c7)
- [eslint] more cleanup [`36ac5d0`](https://github.com/minimistjs/minimist/commit/36ac5d0d95e4947d074e5737d94814034ca335d1)
- [eslint] fix indentation [`34b0f1c`](https://github.com/minimistjs/minimist/commit/34b0f1ccaa45183c3c4f06a91f9b405180a6f982)
- isConstructorOrProto adapted from PR [`ef9153f`](https://github.com/minimistjs/minimist/commit/ef9153fc52b6cea0744b2239921c5dcae4697f11)
- [Dev Deps] update `@ljharb/eslint-config`, `aud` [`098873c`](https://github.com/minimistjs/minimist/commit/098873c213cdb7c92e55ae1ef5aa1af3a8192a79)
- [Dev Deps] add missing `npmignore` dev dep [`3226afa`](https://github.com/minimistjs/minimist/commit/3226afaf09e9d127ca369742437fe6e88f752d6b)
## [v0.2.2](https://github.com/minimistjs/minimist/compare/v0.2.1...v0.2.2) - 2022-10-10
### Commits
- [meta] add `auto-changelog` [`73923d2`](https://github.com/minimistjs/minimist/commit/73923d223553fca08b1ba77e3fbc2a492862ae4c)
- [actions] add reusable workflows [`d80727d`](https://github.com/minimistjs/minimist/commit/d80727df77bfa9e631044d7f16368d8f09242c91)
- [eslint] add eslint; rules to enable later are warnings [`48bc06a`](https://github.com/minimistjs/minimist/commit/48bc06a1b41f00e9cdf183db34f7a51ba70e98d4)
- [readme] rename and add badges [`5df0fe4`](https://github.com/minimistjs/minimist/commit/5df0fe49211bd09a3636f8686a7cb3012c3e98f0)
- [Dev Deps] switch from `covert` to `nyc` [`a48b128`](https://github.com/minimistjs/minimist/commit/a48b128fdb8d427dfb20a15273f83e38d97bef07)
- [Dev Deps] update `covert`, `tape`; remove unnecessary `tap` [`f0fb958`](https://github.com/minimistjs/minimist/commit/f0fb958e9a1fe980cdffc436a211b0bda58f621b)
- [meta] create FUNDING.yml; add `funding` in package.json [`3639e0c`](https://github.com/minimistjs/minimist/commit/3639e0c819359a366387e425ab6eabf4c78d3caa)
- [meta] use `npmignore` to autogenerate an npmignore file [`be2e038`](https://github.com/minimistjs/minimist/commit/be2e038c342d8333b32f0fde67a0026b79c8150e)
- Only apps should have lockfiles [`282b570`](https://github.com/minimistjs/minimist/commit/282b570e7489d01b03f2d6d3dabf79cd3e5f84cf)
- [meta] add `safe-publish-latest` [`4b927de`](https://github.com/minimistjs/minimist/commit/4b927de696d561c636b4f43bf49d4597cb36d6d6)
- [Tests] add `aud` in `posttest` [`b32d9bd`](https://github.com/minimistjs/minimist/commit/b32d9bd0ab340f4e9f8c3a97ff2a4424f25fab8c)
- [meta] update repo URLs [`f9fdfc0`](https://github.com/minimistjs/minimist/commit/f9fdfc032c54884d9a9996a390c63cd0719bbe1a)
## [v0.2.1](https://github.com/minimistjs/minimist/compare/v0.2.0...v0.2.1) - 2020-03-12 ## [v0.2.1](https://github.com/minimistjs/minimist/compare/v0.2.0...v0.2.1) - 2020-03-12
## [v0.2.0](https://github.com/minimistjs/minimist/compare/v0.1.0...v0.2.0) - 2014-06-19 ## [v0.2.0](https://github.com/minimistjs/minimist/compare/v0.1.0...v0.2.0) - 2014-06-19

24
node_modules/minimist/README.md generated vendored

@ -26,14 +26,16 @@ $ node example/parse.js -a beep -b boop
``` ```
$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz $ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz
{ _: [ 'foo', 'bar', 'baz' ], {
x: 3, _: ['foo', 'bar', 'baz'],
y: 4, x: 3,
n: 5, y: 4,
a: true, n: 5,
b: true, a: true,
c: true, b: true,
beep: 'boop' } c: true,
beep: 'boop'
}
``` ```
# security # security
@ -81,8 +83,10 @@ and `argv['--']` with everything after the `--`. Here's an example:
``` ```
> require('./')('one two three -- four five --six'.split(' '), { '--': true }) > require('./')('one two three -- four five --six'.split(' '), { '--': true })
{ _: [ 'one', 'two', 'three' ], {
'--': [ 'four', 'five', '--six' ] } _: ['one', 'two', 'three'],
'--': ['four', 'five', '--six']
}
``` ```
Note that with `opts['--']` set, parsing for arguments still stops after the Note that with `opts['--']` set, parsing for arguments still stops after the

@ -1,2 +1,4 @@
'use strict';
var argv = require('../')(process.argv.slice(2)); var argv = require('../')(process.argv.slice(2));
console.log(argv); console.log(argv);

452
node_modules/minimist/index.js generated vendored

@ -1,249 +1,263 @@
'use strict';
function hasKey(obj, keys) {
var o = obj;
keys.slice(0, -1).forEach(function (key) {
o = o[key] || {};
});
var key = keys[keys.length - 1];
return key in o;
}
function isNumber(x) {
if (typeof x === 'number') { return true; }
if ((/^0x[0-9a-f]+$/i).test(x)) { return true; }
return (/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/).test(x);
}
function isConstructorOrProto(obj, key) {
return (key === 'constructor' && typeof obj[key] === 'function') || key === '__proto__';
}
module.exports = function (args, opts) { module.exports = function (args, opts) {
if (!opts) opts = {}; if (!opts) { opts = {}; }
var flags = { bools : {}, strings : {}, unknownFn: null }; var flags = {
bools: {},
strings: {},
unknownFn: null,
};
if (typeof opts['unknown'] === 'function') { if (typeof opts.unknown === 'function') {
flags.unknownFn = opts['unknown']; flags.unknownFn = opts.unknown;
} }
if (typeof opts['boolean'] === 'boolean' && opts['boolean']) { if (typeof opts.boolean === 'boolean' && opts.boolean) {
flags.allBools = true; flags.allBools = true;
} else { } else {
[].concat(opts['boolean']).filter(Boolean).forEach(function (key) { [].concat(opts.boolean).filter(Boolean).forEach(function (key) {
flags.bools[key] = true; flags.bools[key] = true;
}); });
} }
var aliases = {}; var aliases = {};
Object.keys(opts.alias || {}).forEach(function (key) {
aliases[key] = [].concat(opts.alias[key]);
aliases[key].forEach(function (x) {
aliases[x] = [key].concat(aliases[key].filter(function (y) {
return x !== y;
}));
});
});
[].concat(opts.string).filter(Boolean).forEach(function (key) { function aliasIsBoolean(key) {
flags.strings[key] = true; return aliases[key].some(function (x) {
if (aliases[key]) { return flags.bools[x];
flags.strings[aliases[key]] = true; });
} }
});
var defaults = opts['default'] || {}; Object.keys(opts.alias || {}).forEach(function (key) {
aliases[key] = [].concat(opts.alias[key]);
aliases[key].forEach(function (x) {
aliases[x] = [key].concat(aliases[key].filter(function (y) {
return x !== y;
}));
});
});
var argv = { _ : [] }; [].concat(opts.string).filter(Boolean).forEach(function (key) {
Object.keys(flags.bools).forEach(function (key) { flags.strings[key] = true;
setArg(key, defaults[key] === undefined ? false : defaults[key]); if (aliases[key]) {
}); [].concat(aliases[key]).forEach(function (k) {
flags.strings[k] = true;
});
}
});
var notFlags = []; var defaults = opts.default || {};
if (args.indexOf('--') !== -1) { var argv = { _: [] };
notFlags = args.slice(args.indexOf('--')+1);
args = args.slice(0, args.indexOf('--'));
}
function argDefined(key, arg) { function argDefined(key, arg) {
return (flags.allBools && /^--[^=]+$/.test(arg)) || return (flags.allBools && (/^--[^=]+$/).test(arg))
flags.strings[key] || flags.bools[key] || aliases[key]; || flags.strings[key]
} || flags.bools[key]
|| aliases[key];
}
function setArg (key, val, arg) { function setKey(obj, keys, value) {
if (arg && flags.unknownFn && !argDefined(key, arg)) { var o = obj;
if (flags.unknownFn(arg) === false) return; for (var i = 0; i < keys.length - 1; i++) {
} var key = keys[i];
if (isConstructorOrProto(o, key)) { return; }
if (o[key] === undefined) { o[key] = {}; }
if (
o[key] === Object.prototype
|| o[key] === Number.prototype
|| o[key] === String.prototype
) {
o[key] = {};
}
if (o[key] === Array.prototype) { o[key] = []; }
o = o[key];
}
var value = !flags.strings[key] && isNumber(val) var lastKey = keys[keys.length - 1];
? Number(val) : val if (isConstructorOrProto(o, lastKey)) { return; }
; if (
setKey(argv, key.split('.'), value); o === Object.prototype
|| o === Number.prototype
|| o === String.prototype
) {
o = {};
}
if (o === Array.prototype) { o = []; }
if (o[lastKey] === undefined || flags.bools[lastKey] || typeof o[lastKey] === 'boolean') {
o[lastKey] = value;
} else if (Array.isArray(o[lastKey])) {
o[lastKey].push(value);
} else {
o[lastKey] = [o[lastKey], value];
}
}
(aliases[key] || []).forEach(function (x) { function setArg(key, val, arg) {
setKey(argv, x.split('.'), value); if (arg && flags.unknownFn && !argDefined(key, arg)) {
}); if (flags.unknownFn(arg) === false) { return; }
} }
function setKey (obj, keys, value) { var value = !flags.strings[key] && isNumber(val)
var o = obj; ? Number(val)
for (var i = 0; i < keys.length-1; i++) { : val;
var key = keys[i]; setKey(argv, key.split('.'), value);
if (isConstructorOrProto(o, key)) return;
if (o[key] === undefined) o[key] = {};
if (o[key] === Object.prototype || o[key] === Number.prototype
|| o[key] === String.prototype) o[key] = {};
if (o[key] === Array.prototype) o[key] = [];
o = o[key];
}
var key = keys[keys.length - 1]; (aliases[key] || []).forEach(function (x) {
if (isConstructorOrProto(o, key)) return; setKey(argv, x.split('.'), value);
if (o === Object.prototype || o === Number.prototype });
|| o === String.prototype) o = {}; }
if (o === Array.prototype) o = [];
if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') {
o[key] = value;
}
else if (Array.isArray(o[key])) {
o[key].push(value);
}
else {
o[key] = [ o[key], value ];
}
}
function aliasIsBoolean(key) { Object.keys(flags.bools).forEach(function (key) {
return aliases[key].some(function (x) { setArg(key, defaults[key] === undefined ? false : defaults[key]);
return flags.bools[x]; });
});
}
for (var i = 0; i < args.length; i++) { var notFlags = [];
var arg = args[i];
if (/^--.+=/.test(arg)) { if (args.indexOf('--') !== -1) {
// Using [\s\S] instead of . because js doesn't support the notFlags = args.slice(args.indexOf('--') + 1);
// 'dotall' regex modifier. See: args = args.slice(0, args.indexOf('--'));
// http://stackoverflow.com/a/1068308/13216 }
var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
var key = m[1];
var value = m[2];
if (flags.bools[key]) {
value = value !== 'false';
}
setArg(key, value, arg);
}
else if (/^--no-.+/.test(arg)) {
var key = arg.match(/^--no-(.+)/)[1];
setArg(key, false, arg);
}
else if (/^--.+/.test(arg)) {
var key = arg.match(/^--(.+)/)[1];
var next = args[i + 1];
if (next !== undefined && !/^-/.test(next)
&& !flags.bools[key]
&& !flags.allBools
&& (aliases[key] ? !aliasIsBoolean(key) : true)) {
setArg(key, next, arg);
i++;
}
else if (/^(true|false)$/.test(next)) {
setArg(key, next === 'true', arg);
i++;
}
else {
setArg(key, flags.strings[key] ? '' : true, arg);
}
}
else if (/^-[^-]+/.test(arg)) {
var letters = arg.slice(1,-1).split('');
var broken = false; for (var i = 0; i < args.length; i++) {
for (var j = 0; j < letters.length; j++) { var arg = args[i];
var next = arg.slice(j+2); var key;
var next;
if (next === '-') { if ((/^--.+=/).test(arg)) {
setArg(letters[j], next, arg) // Using [\s\S] instead of . because js doesn't support the
continue; // 'dotall' regex modifier. See:
} // http://stackoverflow.com/a/1068308/13216
var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
key = m[1];
var value = m[2];
if (flags.bools[key]) {
value = value !== 'false';
}
setArg(key, value, arg);
} else if ((/^--no-.+/).test(arg)) {
key = arg.match(/^--no-(.+)/)[1];
setArg(key, false, arg);
} else if ((/^--.+/).test(arg)) {
key = arg.match(/^--(.+)/)[1];
next = args[i + 1];
if (
next !== undefined
&& !(/^(-|--)[^-]/).test(next)
&& !flags.bools[key]
&& !flags.allBools
&& (aliases[key] ? !aliasIsBoolean(key) : true)
) {
setArg(key, next, arg);
i += 1;
} else if ((/^(true|false)$/).test(next)) {
setArg(key, next === 'true', arg);
i += 1;
} else {
setArg(key, flags.strings[key] ? '' : true, arg);
}
} else if ((/^-[^-]+/).test(arg)) {
var letters = arg.slice(1, -1).split('');
if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) { var broken = false;
setArg(letters[j], next.split('=')[1], arg); for (var j = 0; j < letters.length; j++) {
broken = true; next = arg.slice(j + 2);
break;
}
if (/[A-Za-z]/.test(letters[j]) if (next === '-') {
&& /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { setArg(letters[j], next, arg);
setArg(letters[j], next, arg); continue;
broken = true; }
break;
}
if (letters[j+1] && letters[j+1].match(/\W/)) { if ((/[A-Za-z]/).test(letters[j]) && next[0] === '=') {
setArg(letters[j], arg.slice(j+2), arg); setArg(letters[j], next.slice(1), arg);
broken = true; broken = true;
break; break;
} }
else {
setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg);
}
}
var key = arg.slice(-1)[0]; if (
if (!broken && key !== '-') { (/[A-Za-z]/).test(letters[j])
if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) && (/-?\d+(\.\d*)?(e-?\d+)?$/).test(next)
&& !flags.bools[key] ) {
&& (aliases[key] ? !aliasIsBoolean(key) : true)) { setArg(letters[j], next, arg);
setArg(key, args[i+1], arg); broken = true;
i++; break;
} }
else if (args[i+1] && /^(true|false)$/.test(args[i+1])) {
setArg(key, args[i+1] === 'true', arg);
i++;
}
else {
setArg(key, flags.strings[key] ? '' : true, arg);
}
}
}
else {
if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
argv._.push(
flags.strings['_'] || !isNumber(arg) ? arg : Number(arg)
);
}
if (opts.stopEarly) {
argv._.push.apply(argv._, args.slice(i + 1));
break;
}
}
}
Object.keys(defaults).forEach(function (key) { if (letters[j + 1] && letters[j + 1].match(/\W/)) {
if (!hasKey(argv, key.split('.'))) { setArg(letters[j], arg.slice(j + 2), arg);
setKey(argv, key.split('.'), defaults[key]); broken = true;
break;
} else {
setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg);
}
}
(aliases[key] || []).forEach(function (x) { key = arg.slice(-1)[0];
setKey(argv, x.split('.'), defaults[key]); if (!broken && key !== '-') {
}); if (
} args[i + 1]
}); && !(/^(-|--)[^-]/).test(args[i + 1])
&& !flags.bools[key]
&& (aliases[key] ? !aliasIsBoolean(key) : true)
) {
setArg(key, args[i + 1], arg);
i += 1;
} else if (args[i + 1] && (/^(true|false)$/).test(args[i + 1])) {
setArg(key, args[i + 1] === 'true', arg);
i += 1;
} else {
setArg(key, flags.strings[key] ? '' : true, arg);
}
}
} else {
if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
argv._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg));
}
if (opts.stopEarly) {
argv._.push.apply(argv._, args.slice(i + 1));
break;
}
}
}
if (opts['--']) { Object.keys(defaults).forEach(function (k) {
argv['--'] = new Array(); if (!hasKey(argv, k.split('.'))) {
notFlags.forEach(function(key) { setKey(argv, k.split('.'), defaults[k]);
argv['--'].push(key);
});
}
else {
notFlags.forEach(function(key) {
argv._.push(key);
});
}
return argv; (aliases[k] || []).forEach(function (x) {
setKey(argv, x.split('.'), defaults[k]);
});
}
});
if (opts['--']) {
argv['--'] = notFlags.slice();
} else {
notFlags.forEach(function (k) {
argv._.push(k);
});
}
return argv;
}; };
function hasKey (obj, keys) {
var o = obj;
keys.slice(0,-1).forEach(function (key) {
o = (o[key] || {});
});
var key = keys[keys.length - 1];
return key in o;
}
function isNumber (x) {
if (typeof x === 'number') return true;
if (/^0x[0-9a-f]+$/i.test(x)) return true;
return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
}
function isConstructorOrProto (obj, key) {
return key === 'constructor' && typeof obj[key] === 'function' || key === '__proto__';
}

146
node_modules/minimist/package.json generated vendored

@ -1,75 +1,75 @@
{ {
"name": "minimist", "name": "minimist",
"version": "1.2.7", "version": "1.2.8",
"description": "parse argument options", "description": "parse argument options",
"main": "index.js", "main": "index.js",
"devDependencies": { "devDependencies": {
"@ljharb/eslint-config": "^21.0.0", "@ljharb/eslint-config": "^21.0.1",
"aud": "^2.0.1", "aud": "^2.0.2",
"auto-changelog": "^2.4.0", "auto-changelog": "^2.4.0",
"eslint": "=8.8.0", "eslint": "=8.8.0",
"in-publish": "^2.0.1", "in-publish": "^2.0.1",
"npmignore": "^0.3.0", "npmignore": "^0.3.0",
"nyc": "^10.3.2", "nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0", "safe-publish-latest": "^2.0.0",
"tape": "^5.6.1" "tape": "^5.6.3"
}, },
"scripts": { "scripts": {
"prepack": "npmignore --auto --commentLines=auto", "prepack": "npmignore --auto --commentLines=auto",
"prepublishOnly": "safe-publish-latest", "prepublishOnly": "safe-publish-latest",
"prepublish": "not-in-publish || npm run prepublishOnly", "prepublish": "not-in-publish || npm run prepublishOnly",
"lint": "eslint --ext=js,mjs .", "lint": "eslint --ext=js,mjs .",
"pretest": "npm run lint", "pretest": "npm run lint",
"tests-only": "nyc tape test/*.js", "tests-only": "nyc tape 'test/**/*.js'",
"test": "npm run tests-only", "test": "npm run tests-only",
"posttest": "aud --production", "posttest": "aud --production",
"version": "auto-changelog && git add CHANGELOG.md", "version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
}, },
"testling": { "testling": {
"files": "test/*.js", "files": "test/*.js",
"browsers": [ "browsers": [
"ie/6..latest", "ie/6..latest",
"ff/5", "ff/5",
"firefox/latest", "firefox/latest",
"chrome/10", "chrome/10",
"chrome/latest", "chrome/latest",
"safari/5.1", "safari/5.1",
"safari/latest", "safari/latest",
"opera/12" "opera/12"
] ]
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/minimistjs/minimist.git" "url": "git://github.com/minimistjs/minimist.git"
}, },
"homepage": "https://github.com/minimistjs/minimist", "homepage": "https://github.com/minimistjs/minimist",
"keywords": [ "keywords": [
"argv", "argv",
"getopt", "getopt",
"parser", "parser",
"optimist" "optimist"
], ],
"author": { "author": {
"name": "James Halliday", "name": "James Halliday",
"email": "mail@substack.net", "email": "mail@substack.net",
"url": "http://substack.net" "url": "http://substack.net"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
}, },
"license": "MIT", "license": "MIT",
"auto-changelog": { "auto-changelog": {
"output": "CHANGELOG.md", "output": "CHANGELOG.md",
"template": "keepachangelog", "template": "keepachangelog",
"unreleased": false, "unreleased": false,
"commitLimit": false, "commitLimit": false,
"backfillLimit": false, "backfillLimit": false,
"hideCredit": true "hideCredit": true
}, },
"publishConfig": { "publishConfig": {
"ignore": [ "ignore": [
".github/workflows" ".github/workflows"
] ]
} }
} }

@ -1,32 +1,34 @@
'use strict';
var parse = require('../'); var parse = require('../');
var test = require('tape'); var test = require('tape');
test('flag boolean true (default all --args to boolean)', function (t) { test('flag boolean true (default all --args to boolean)', function (t) {
var argv = parse(['moo', '--honk', 'cow'], { var argv = parse(['moo', '--honk', 'cow'], {
boolean: true boolean: true,
}); });
t.deepEqual(argv, { t.deepEqual(argv, {
honk: true, honk: true,
_: ['moo', 'cow'] _: ['moo', 'cow'],
}); });
t.deepEqual(typeof argv.honk, 'boolean'); t.deepEqual(typeof argv.honk, 'boolean');
t.end(); t.end();
}); });
test('flag boolean true only affects double hyphen arguments without equals signs', function (t) { test('flag boolean true only affects double hyphen arguments without equals signs', function (t) {
var argv = parse(['moo', '--honk', 'cow', '-p', '55', '--tacos=good'], { var argv = parse(['moo', '--honk', 'cow', '-p', '55', '--tacos=good'], {
boolean: true boolean: true,
}); });
t.deepEqual(argv, { t.deepEqual(argv, {
honk: true, honk: true,
tacos: 'good', tacos: 'good',
p: 55, p: 55,
_: ['moo', 'cow'] _: ['moo', 'cow'],
}); });
t.deepEqual(typeof argv.honk, 'boolean'); t.deepEqual(typeof argv.honk, 'boolean');
t.end(); t.end();
}); });

267
node_modules/minimist/test/bool.js generated vendored

@ -1,178 +1,177 @@
'use strict';
var parse = require('../'); var parse = require('../');
var test = require('tape'); var test = require('tape');
test('flag boolean default false', function (t) { test('flag boolean default false', function (t) {
var argv = parse(['moo'], { var argv = parse(['moo'], {
boolean: ['t', 'verbose'], boolean: ['t', 'verbose'],
default: { verbose: false, t: false } default: { verbose: false, t: false },
}); });
t.deepEqual(argv, { t.deepEqual(argv, {
verbose: false, verbose: false,
t: false, t: false,
_: ['moo'] _: ['moo'],
}); });
t.deepEqual(typeof argv.verbose, 'boolean'); t.deepEqual(typeof argv.verbose, 'boolean');
t.deepEqual(typeof argv.t, 'boolean'); t.deepEqual(typeof argv.t, 'boolean');
t.end(); t.end();
}); });
test('boolean groups', function (t) { test('boolean groups', function (t) {
var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { var argv = parse(['-x', '-z', 'one', 'two', 'three'], {
boolean: ['x','y','z'] boolean: ['x', 'y', 'z'],
}); });
t.deepEqual(argv, { t.deepEqual(argv, {
x : true, x: true,
y : false, y: false,
z : true, z: true,
_ : [ 'one', 'two', 'three' ] _: ['one', 'two', 'three'],
}); });
t.deepEqual(typeof argv.x, 'boolean'); t.deepEqual(typeof argv.x, 'boolean');
t.deepEqual(typeof argv.y, 'boolean'); t.deepEqual(typeof argv.y, 'boolean');
t.deepEqual(typeof argv.z, 'boolean'); t.deepEqual(typeof argv.z, 'boolean');
t.end(); t.end();
}); });
test('boolean and alias with chainable api', function (t) { test('boolean and alias with chainable api', function (t) {
var aliased = [ '-h', 'derp' ]; var aliased = ['-h', 'derp'];
var regular = [ '--herp', 'derp' ]; var regular = ['--herp', 'derp'];
var opts = { var aliasedArgv = parse(aliased, {
herp: { alias: 'h', boolean: true } boolean: 'herp',
}; alias: { h: 'herp' },
var aliasedArgv = parse(aliased, { });
boolean: 'herp', var propertyArgv = parse(regular, {
alias: { h: 'herp' } boolean: 'herp',
}); alias: { h: 'herp' },
var propertyArgv = parse(regular, { });
boolean: 'herp', var expected = {
alias: { h: 'herp' } herp: true,
}); h: true,
var expected = { _: ['derp'],
herp: true, };
h: true,
'_': [ 'derp' ]
};
t.same(aliasedArgv, expected); t.same(aliasedArgv, expected);
t.same(propertyArgv, expected); t.same(propertyArgv, expected);
t.end(); t.end();
}); });
test('boolean and alias with options hash', function (t) { test('boolean and alias with options hash', function (t) {
var aliased = [ '-h', 'derp' ]; var aliased = ['-h', 'derp'];
var regular = [ '--herp', 'derp' ]; var regular = ['--herp', 'derp'];
var opts = { var opts = {
alias: { 'h': 'herp' }, alias: { h: 'herp' },
boolean: 'herp' boolean: 'herp',
}; };
var aliasedArgv = parse(aliased, opts); var aliasedArgv = parse(aliased, opts);
var propertyArgv = parse(regular, opts); var propertyArgv = parse(regular, opts);
var expected = { var expected = {
herp: true, herp: true,
h: true, h: true,
'_': [ 'derp' ] _: ['derp'],
}; };
t.same(aliasedArgv, expected); t.same(aliasedArgv, expected);
t.same(propertyArgv, expected); t.same(propertyArgv, expected);
t.end(); t.end();
}); });
test('boolean and alias array with options hash', function (t) { test('boolean and alias array with options hash', function (t) {
var aliased = [ '-h', 'derp' ]; var aliased = ['-h', 'derp'];
var regular = [ '--herp', 'derp' ]; var regular = ['--herp', 'derp'];
var alt = [ '--harp', 'derp' ]; var alt = ['--harp', 'derp'];
var opts = { var opts = {
alias: { 'h': ['herp', 'harp'] }, alias: { h: ['herp', 'harp'] },
boolean: 'h' boolean: 'h',
}; };
var aliasedArgv = parse(aliased, opts); var aliasedArgv = parse(aliased, opts);
var propertyArgv = parse(regular, opts); var propertyArgv = parse(regular, opts);
var altPropertyArgv = parse(alt, opts); var altPropertyArgv = parse(alt, opts);
var expected = { var expected = {
harp: true, harp: true,
herp: true, herp: true,
h: true, h: true,
'_': [ 'derp' ] _: ['derp'],
}; };
t.same(aliasedArgv, expected); t.same(aliasedArgv, expected);
t.same(propertyArgv, expected); t.same(propertyArgv, expected);
t.same(altPropertyArgv, expected); t.same(altPropertyArgv, expected);
t.end(); t.end();
}); });
test('boolean and alias using explicit true', function (t) { test('boolean and alias using explicit true', function (t) {
var aliased = [ '-h', 'true' ]; var aliased = ['-h', 'true'];
var regular = [ '--herp', 'true' ]; var regular = ['--herp', 'true'];
var opts = { var opts = {
alias: { h: 'herp' }, alias: { h: 'herp' },
boolean: 'h' boolean: 'h',
}; };
var aliasedArgv = parse(aliased, opts); var aliasedArgv = parse(aliased, opts);
var propertyArgv = parse(regular, opts); var propertyArgv = parse(regular, opts);
var expected = { var expected = {
herp: true, herp: true,
h: true, h: true,
'_': [ ] _: [],
}; };
t.same(aliasedArgv, expected); t.same(aliasedArgv, expected);
t.same(propertyArgv, expected); t.same(propertyArgv, expected);
t.end(); t.end();
}); });
// regression, see https://github.com/substack/node-optimist/issues/71 // regression, see https://github.com/substack/node-optimist/issues/71
test('boolean and --x=true', function(t) { test('boolean and --x=true', function (t) {
var parsed = parse(['--boool', '--other=true'], { var parsed = parse(['--boool', '--other=true'], {
boolean: 'boool' boolean: 'boool',
}); });
t.same(parsed.boool, true); t.same(parsed.boool, true);
t.same(parsed.other, 'true'); t.same(parsed.other, 'true');
parsed = parse(['--boool', '--other=false'], { parsed = parse(['--boool', '--other=false'], {
boolean: 'boool' boolean: 'boool',
}); });
t.same(parsed.boool, true); t.same(parsed.boool, true);
t.same(parsed.other, 'false'); t.same(parsed.other, 'false');
t.end(); t.end();
}); });
test('boolean --boool=true', function (t) { test('boolean --boool=true', function (t) {
var parsed = parse(['--boool=true'], { var parsed = parse(['--boool=true'], {
default: { default: {
boool: false boool: false,
}, },
boolean: ['boool'] boolean: ['boool'],
}); });
t.same(parsed.boool, true); t.same(parsed.boool, true);
t.end(); t.end();
}); });
test('boolean --boool=false', function (t) { test('boolean --boool=false', function (t) {
var parsed = parse(['--boool=false'], { var parsed = parse(['--boool=false'], {
default: { default: {
boool: true boool: true,
}, },
boolean: ['boool'] boolean: ['boool'],
}); });
t.same(parsed.boool, false); t.same(parsed.boool, false);
t.end(); t.end();
}); });
test('boolean using something similar to true', function (t) { test('boolean using something similar to true', function (t) {
var opts = { boolean: 'h' }; var opts = { boolean: 'h' };
var result = parse(['-h', 'true.txt'], opts); var result = parse(['-h', 'true.txt'], opts);
var expected = { var expected = {
h: true, h: true,
'_': ['true.txt'] _: ['true.txt'],
}; };
t.same(result, expected); t.same(result, expected);
t.end(); t.end();
}); });

54
node_modules/minimist/test/dash.js generated vendored

@ -1,31 +1,43 @@
'use strict';
var parse = require('../'); var parse = require('../');
var test = require('tape'); var test = require('tape');
test('-', function (t) { test('-', function (t) {
t.plan(5); t.plan(6);
t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); t.deepEqual(parse(['-n', '-']), { n: '-', _: [] });
t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); t.deepEqual(parse(['--nnn', '-']), { nnn: '-', _: [] });
t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); t.deepEqual(parse(['-']), { _: ['-'] });
t.deepEqual( t.deepEqual(parse(['-f-']), { f: '-', _: [] });
parse([ '-b', '-' ], { boolean: 'b' }), t.deepEqual(
{ b: true, _: [ '-' ] } parse(['-b', '-'], { boolean: 'b' }),
); { b: true, _: ['-'] }
t.deepEqual( );
parse([ '-s', '-' ], { string: 's' }), t.deepEqual(
{ s: '-', _: [] } parse(['-s', '-'], { string: 's' }),
); { s: '-', _: [] }
);
}); });
test('-a -- b', function (t) { test('-a -- b', function (t) {
t.plan(3); t.plan(2);
t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); t.deepEqual(parse(['-a', '--', 'b']), { a: true, _: ['b'] });
t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); t.deepEqual(parse(['--a', '--', 'b']), { a: true, _: ['b'] });
t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] });
}); });
test('move arguments after the -- into their own `--` array', function(t) { test('move arguments after the -- into their own `--` array', function (t) {
t.plan(1); t.plan(1);
t.deepEqual( t.deepEqual(
parse([ '--name', 'John', 'before', '--', 'after' ], { '--': true }), parse(['--name', 'John', 'before', '--', 'after'], { '--': true }),
{ name: 'John', _: [ 'before' ], '--': [ 'after' ] }); { name: 'John', _: ['before'], '--': ['after'] }
);
}); });
test('--- option value', function (t) {
// A multi-dash value is largely an edge case, but check the behaviour is as expected,
// and in particular the same for short option and long option (as made consistent in Jan 2023).
t.plan(2);
t.deepEqual(parse(['-n', '---']), { n: '---', _: [] });
t.deepEqual(parse(['--nnn', '---']), { nnn: '---', _: [] });
});

@ -1,35 +1,37 @@
'use strict';
var test = require('tape'); var test = require('tape');
var parse = require('../'); var parse = require('../');
test('boolean default true', function (t) { test('boolean default true', function (t) {
var argv = parse([], { var argv = parse([], {
boolean: 'sometrue', boolean: 'sometrue',
default: { sometrue: true } default: { sometrue: true },
}); });
t.equal(argv.sometrue, true); t.equal(argv.sometrue, true);
t.end(); t.end();
}); });
test('boolean default false', function (t) { test('boolean default false', function (t) {
var argv = parse([], { var argv = parse([], {
boolean: 'somefalse', boolean: 'somefalse',
default: { somefalse: false } default: { somefalse: false },
}); });
t.equal(argv.somefalse, false); t.equal(argv.somefalse, false);
t.end(); t.end();
}); });
test('boolean default to null', function (t) { test('boolean default to null', function (t) {
var argv = parse([], { var argv = parse([], {
boolean: 'maybe', boolean: 'maybe',
default: { maybe: null } default: { maybe: null },
}); });
t.equal(argv.maybe, null); t.equal(argv.maybe, null);
var argv = parse(['--maybe'], {
boolean: 'maybe',
default: { maybe: null }
});
t.equal(argv.maybe, true);
t.end();
}) var argvLong = parse(['--maybe'], {
boolean: 'maybe',
default: { maybe: null },
});
t.equal(argvLong.maybe, true);
t.end();
});

24
node_modules/minimist/test/dotted.js generated vendored

@ -1,22 +1,24 @@
'use strict';
var parse = require('../'); var parse = require('../');
var test = require('tape'); var test = require('tape');
test('dotted alias', function (t) { test('dotted alias', function (t) {
var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); var argv = parse(['--a.b', '22'], { default: { 'a.b': 11 }, alias: { 'a.b': 'aa.bb' } });
t.equal(argv.a.b, 22); t.equal(argv.a.b, 22);
t.equal(argv.aa.bb, 22); t.equal(argv.aa.bb, 22);
t.end(); t.end();
}); });
test('dotted default', function (t) { test('dotted default', function (t) {
var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); var argv = parse('', { default: { 'a.b': 11 }, alias: { 'a.b': 'aa.bb' } });
t.equal(argv.a.b, 11); t.equal(argv.a.b, 11);
t.equal(argv.aa.bb, 11); t.equal(argv.aa.bb, 11);
t.end(); t.end();
}); });
test('dotted default with no alias', function (t) { test('dotted default with no alias', function (t) {
var argv = parse('', {default: {'a.b': 11}}); var argv = parse('', { default: { 'a.b': 11 } });
t.equal(argv.a.b, 11); t.equal(argv.a.b, 11);
t.end(); t.end();
}); });

@ -1,16 +1,32 @@
'use strict';
var parse = require('../'); var parse = require('../');
var test = require('tape'); var test = require('tape');
test('short -k=v' , function (t) { test('short -k=v', function (t) {
t.plan(1); t.plan(1);
var argv = parse([ '-b=123' ]); var argv = parse(['-b=123']);
t.deepEqual(argv, { b: 123, _: [] }); t.deepEqual(argv, { b: 123, _: [] });
}); });
test('multi short -k=v' , function (t) { test('multi short -k=v', function (t) {
t.plan(1); t.plan(1);
var argv = parse([ '-a=whatever', '-b=robots' ]); var argv = parse(['-a=whatever', '-b=robots']);
t.deepEqual(argv, { a: 'whatever', b: 'robots', _: [] }); t.deepEqual(argv, { a: 'whatever', b: 'robots', _: [] });
});
test('short with embedded equals -k=a=b', function (t) {
t.plan(1);
var argv = parse(['-k=a=b']);
t.deepEqual(argv, { k: 'a=b', _: [] });
});
test('short with later equals like -ab=c', function (t) {
t.plan(1);
var argv = parse(['-ab=c']);
t.deepEqual(argv, { a: true, b: 'c', _: [] });
}); });

54
node_modules/minimist/test/long.js generated vendored

@ -1,31 +1,33 @@
'use strict';
var test = require('tape'); var test = require('tape');
var parse = require('../'); var parse = require('../');
test('long opts', function (t) { test('long opts', function (t) {
t.deepEqual( t.deepEqual(
parse([ '--bool' ]), parse(['--bool']),
{ bool : true, _ : [] }, { bool: true, _: [] },
'long boolean' 'long boolean'
); );
t.deepEqual( t.deepEqual(
parse([ '--pow', 'xixxle' ]), parse(['--pow', 'xixxle']),
{ pow : 'xixxle', _ : [] }, { pow: 'xixxle', _: [] },
'long capture sp' 'long capture sp'
); );
t.deepEqual( t.deepEqual(
parse([ '--pow=xixxle' ]), parse(['--pow=xixxle']),
{ pow : 'xixxle', _ : [] }, { pow: 'xixxle', _: [] },
'long capture eq' 'long capture eq'
); );
t.deepEqual( t.deepEqual(
parse([ '--host', 'localhost', '--port', '555' ]), parse(['--host', 'localhost', '--port', '555']),
{ host : 'localhost', port : 555, _ : [] }, { host: 'localhost', port: 555, _: [] },
'long captures sp' 'long captures sp'
); );
t.deepEqual( t.deepEqual(
parse([ '--host=localhost', '--port=555' ]), parse(['--host=localhost', '--port=555']),
{ host : 'localhost', port : 555, _ : [] }, { host: 'localhost', port: 555, _: [] },
'long captures eq' 'long captures eq'
); );
t.end(); t.end();
}); });

58
node_modules/minimist/test/num.js generated vendored

@ -1,36 +1,38 @@
'use strict';
var parse = require('../'); var parse = require('../');
var test = require('tape'); var test = require('tape');
test('nums', function (t) { test('nums', function (t) {
var argv = parse([ var argv = parse([
'-x', '1234', '-x', '1234',
'-y', '5.67', '-y', '5.67',
'-z', '1e7', '-z', '1e7',
'-w', '10f', '-w', '10f',
'--hex', '0xdeadbeef', '--hex', '0xdeadbeef',
'789' '789',
]); ]);
t.deepEqual(argv, { t.deepEqual(argv, {
x : 1234, x: 1234,
y : 5.67, y: 5.67,
z : 1e7, z: 1e7,
w : '10f', w: '10f',
hex : 0xdeadbeef, hex: 0xdeadbeef,
_ : [ 789 ] _: [789],
}); });
t.deepEqual(typeof argv.x, 'number'); t.deepEqual(typeof argv.x, 'number');
t.deepEqual(typeof argv.y, 'number'); t.deepEqual(typeof argv.y, 'number');
t.deepEqual(typeof argv.z, 'number'); t.deepEqual(typeof argv.z, 'number');
t.deepEqual(typeof argv.w, 'string'); t.deepEqual(typeof argv.w, 'string');
t.deepEqual(typeof argv.hex, 'number'); t.deepEqual(typeof argv.hex, 'number');
t.deepEqual(typeof argv._[0], 'number'); t.deepEqual(typeof argv._[0], 'number');
t.end(); t.end();
}); });
test('already a number', function (t) { test('already a number', function (t) {
var argv = parse([ '-x', 1234, 789 ]); var argv = parse(['-x', 1234, 789]);
t.deepEqual(argv, { x : 1234, _ : [ 789 ] }); t.deepEqual(argv, { x: 1234, _: [789] });
t.deepEqual(typeof argv.x, 'number'); t.deepEqual(typeof argv.x, 'number');
t.deepEqual(typeof argv._[0], 'number'); t.deepEqual(typeof argv._[0], 'number');
t.end(); t.end();
}); });

306
node_modules/minimist/test/parse.js generated vendored

@ -1,197 +1,209 @@
'use strict';
var parse = require('../'); var parse = require('../');
var test = require('tape'); var test = require('tape');
test('parse args', function (t) { test('parse args', function (t) {
t.deepEqual( t.deepEqual(
parse([ '--no-moo' ]), parse(['--no-moo']),
{ moo : false, _ : [] }, { moo: false, _: [] },
'no' 'no'
); );
t.deepEqual( t.deepEqual(
parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), parse(['-v', 'a', '-v', 'b', '-v', 'c']),
{ v : ['a','b','c'], _ : [] }, { v: ['a', 'b', 'c'], _: [] },
'multi' 'multi'
); );
t.end(); t.end();
}); });
test('comprehensive', function (t) { test('comprehensive', function (t) {
t.deepEqual( t.deepEqual(
parse([ parse([
'--name=meowmers', 'bare', '-cats', 'woo', '--name=meowmers', 'bare', '-cats', 'woo',
'-h', 'awesome', '--multi=quux', '-h', 'awesome', '--multi=quux',
'--key', 'value', '--key', 'value',
'-b', '--bool', '--no-meep', '--multi=baz', '-b', '--bool', '--no-meep', '--multi=baz',
'--', '--not-a-flag', 'eek' '--', '--not-a-flag', 'eek',
]), ]),
{ {
c : true, c: true,
a : true, a: true,
t : true, t: true,
s : 'woo', s: 'woo',
h : 'awesome', h: 'awesome',
b : true, b: true,
bool : true, bool: true,
key : 'value', key: 'value',
multi : [ 'quux', 'baz' ], multi: ['quux', 'baz'],
meep : false, meep: false,
name : 'meowmers', name: 'meowmers',
_ : [ 'bare', '--not-a-flag', 'eek' ] _: ['bare', '--not-a-flag', 'eek'],
} }
); );
t.end(); t.end();
}); });
test('flag boolean', function (t) { test('flag boolean', function (t) {
var argv = parse([ '-t', 'moo' ], { boolean: 't' }); var argv = parse(['-t', 'moo'], { boolean: 't' });
t.deepEqual(argv, { t : true, _ : [ 'moo' ] }); t.deepEqual(argv, { t: true, _: ['moo'] });
t.deepEqual(typeof argv.t, 'boolean'); t.deepEqual(typeof argv.t, 'boolean');
t.end(); t.end();
}); });
test('flag boolean value', function (t) { test('flag boolean value', function (t) {
var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], {
boolean: [ 't', 'verbose' ], boolean: ['t', 'verbose'],
default: { verbose: true } default: { verbose: true },
}); });
t.deepEqual(argv, { t.deepEqual(argv, {
verbose: false, verbose: false,
t: true, t: true,
_: ['moo'] _: ['moo'],
}); });
t.deepEqual(typeof argv.verbose, 'boolean'); t.deepEqual(typeof argv.verbose, 'boolean');
t.deepEqual(typeof argv.t, 'boolean'); t.deepEqual(typeof argv.t, 'boolean');
t.end(); t.end();
}); });
test('newlines in params' , function (t) { test('newlines in params', function (t) {
var args = parse([ '-s', "X\nX" ]) var args = parse(['-s', 'X\nX']);
t.deepEqual(args, { _ : [], s : "X\nX" }); t.deepEqual(args, { _: [], s: 'X\nX' });
// reproduce in bash: // reproduce in bash:
// VALUE="new // VALUE="new
// line" // line"
// node program.js --s="$VALUE" // node program.js --s="$VALUE"
args = parse([ "--s=X\nX" ]) args = parse(['--s=X\nX']);
t.deepEqual(args, { _ : [], s : "X\nX" }); t.deepEqual(args, { _: [], s: 'X\nX' });
t.end(); t.end();
}); });
test('strings' , function (t) { test('strings', function (t) {
var s = parse([ '-s', '0001234' ], { string: 's' }).s; var s = parse(['-s', '0001234'], { string: 's' }).s;
t.equal(s, '0001234'); t.equal(s, '0001234');
t.equal(typeof s, 'string'); t.equal(typeof s, 'string');
var x = parse([ '-x', '56' ], { string: 'x' }).x; var x = parse(['-x', '56'], { string: 'x' }).x;
t.equal(x, '56'); t.equal(x, '56');
t.equal(typeof x, 'string'); t.equal(typeof x, 'string');
t.end(); t.end();
}); });
test('stringArgs', function (t) { test('stringArgs', function (t) {
var s = parse([ ' ', ' ' ], { string: '_' })._; var s = parse([' ', ' '], { string: '_' })._;
t.same(s.length, 2); t.same(s.length, 2);
t.same(typeof s[0], 'string'); t.same(typeof s[0], 'string');
t.same(s[0], ' '); t.same(s[0], ' ');
t.same(typeof s[1], 'string'); t.same(typeof s[1], 'string');
t.same(s[1], ' '); t.same(s[1], ' ');
t.end(); t.end();
}); });
test('empty strings', function(t) { test('empty strings', function (t) {
var s = parse([ '-s' ], { string: 's' }).s; var s = parse(['-s'], { string: 's' }).s;
t.equal(s, ''); t.equal(s, '');
t.equal(typeof s, 'string'); t.equal(typeof s, 'string');
var str = parse([ '--str' ], { string: 'str' }).str; var str = parse(['--str'], { string: 'str' }).str;
t.equal(str, ''); t.equal(str, '');
t.equal(typeof str, 'string'); t.equal(typeof str, 'string');
var letters = parse([ '-art' ], { var letters = parse(['-art'], {
string: [ 'a', 't' ] string: ['a', 't'],
}); });
t.equal(letters.a, ''); t.equal(letters.a, '');
t.equal(letters.r, true); t.equal(letters.r, true);
t.equal(letters.t, ''); t.equal(letters.t, '');
t.end(); t.end();
}); });
test('string and alias', function (t) {
var x = parse(['--str', '000123'], {
string: 's',
alias: { s: 'str' },
});
test('string and alias', function(t) { t.equal(x.str, '000123');
var x = parse([ '--str', '000123' ], { t.equal(typeof x.str, 'string');
string: 's', t.equal(x.s, '000123');
alias: { s: 'str' } t.equal(typeof x.s, 'string');
});
t.equal(x.str, '000123'); var y = parse(['-s', '000123'], {
t.equal(typeof x.str, 'string'); string: 'str',
t.equal(x.s, '000123'); alias: { str: 's' },
t.equal(typeof x.s, 'string'); });
var y = parse([ '-s', '000123' ], { t.equal(y.str, '000123');
string: 'str', t.equal(typeof y.str, 'string');
alias: { str: 's' } t.equal(y.s, '000123');
}); t.equal(typeof y.s, 'string');
t.equal(y.str, '000123'); var z = parse(['-s123'], {
t.equal(typeof y.str, 'string'); alias: { str: ['s', 'S'] },
t.equal(y.s, '000123'); string: ['str'],
t.equal(typeof y.s, 'string'); });
t.end();
t.deepEqual(
z,
{ _: [], s: '123', S: '123', str: '123' },
'opt.string works with multiple aliases'
);
t.end();
}); });
test('slashBreak', function (t) { test('slashBreak', function (t) {
t.same( t.same(
parse([ '-I/foo/bar/baz' ]), parse(['-I/foo/bar/baz']),
{ I : '/foo/bar/baz', _ : [] } { I: '/foo/bar/baz', _: [] }
); );
t.same( t.same(
parse([ '-xyz/foo/bar/baz' ]), parse(['-xyz/foo/bar/baz']),
{ x : true, y : true, z : '/foo/bar/baz', _ : [] } { x: true, y: true, z: '/foo/bar/baz', _: [] }
); );
t.end(); t.end();
}); });
test('alias', function (t) { test('alias', function (t) {
var argv = parse([ '-f', '11', '--zoom', '55' ], { var argv = parse(['-f', '11', '--zoom', '55'], {
alias: { z: 'zoom' } alias: { z: 'zoom' },
}); });
t.equal(argv.zoom, 55); t.equal(argv.zoom, 55);
t.equal(argv.z, argv.zoom); t.equal(argv.z, argv.zoom);
t.equal(argv.f, 11); t.equal(argv.f, 11);
t.end(); t.end();
}); });
test('multiAlias', function (t) { test('multiAlias', function (t) {
var argv = parse([ '-f', '11', '--zoom', '55' ], { var argv = parse(['-f', '11', '--zoom', '55'], {
alias: { z: [ 'zm', 'zoom' ] } alias: { z: ['zm', 'zoom'] },
}); });
t.equal(argv.zoom, 55); t.equal(argv.zoom, 55);
t.equal(argv.z, argv.zoom); t.equal(argv.z, argv.zoom);
t.equal(argv.z, argv.zm); t.equal(argv.z, argv.zm);
t.equal(argv.f, 11); t.equal(argv.f, 11);
t.end(); t.end();
}); });
test('nested dotted objects', function (t) { test('nested dotted objects', function (t) {
var argv = parse([ var argv = parse([
'--foo.bar', '3', '--foo.baz', '4', '--foo.bar', '3', '--foo.baz', '4',
'--foo.quux.quibble', '5', '--foo.quux.o_O', '--foo.quux.quibble', '5', '--foo.quux.o_O',
'--beep.boop' '--beep.boop',
]); ]);
t.same(argv.foo, { t.same(argv.foo, {
bar : 3, bar: 3,
baz : 4, baz: 4,
quux : { quux: {
quibble : 5, quibble: 5,
o_O : true o_O: true,
} },
}); });
t.same(argv.beep, { boop : true }); t.same(argv.beep, { boop: true });
t.end(); t.end();
}); });

@ -1,9 +1,11 @@
'use strict';
var parse = require('../'); var parse = require('../');
var test = require('tape'); var test = require('tape');
test('parse with modifier functions' , function (t) { test('parse with modifier functions', function (t) {
t.plan(1); t.plan(1);
var argv = parse([ '-b', '123' ], { boolean: 'b' }); var argv = parse(['-b', '123'], { boolean: 'b' });
t.deepEqual(argv, { b: true, _: [123] }); t.deepEqual(argv, { b: true, _: [123] });
}); });

78
node_modules/minimist/test/proto.js generated vendored

@ -1,60 +1,64 @@
'use strict';
/* eslint no-proto: 0 */
var parse = require('../'); var parse = require('../');
var test = require('tape'); var test = require('tape');
test('proto pollution', function (t) { test('proto pollution', function (t) {
var argv = parse(['--__proto__.x','123']); var argv = parse(['--__proto__.x', '123']);
t.equal({}.x, undefined); t.equal({}.x, undefined);
t.equal(argv.__proto__.x, undefined); t.equal(argv.__proto__.x, undefined);
t.equal(argv.x, undefined); t.equal(argv.x, undefined);
t.end(); t.end();
}); });
test('proto pollution (array)', function (t) { test('proto pollution (array)', function (t) {
var argv = parse(['--x','4','--x','5','--x.__proto__.z','789']); var argv = parse(['--x', '4', '--x', '5', '--x.__proto__.z', '789']);
t.equal({}.z, undefined); t.equal({}.z, undefined);
t.deepEqual(argv.x, [4,5]); t.deepEqual(argv.x, [4, 5]);
t.equal(argv.x.z, undefined); t.equal(argv.x.z, undefined);
t.equal(argv.x.__proto__.z, undefined); t.equal(argv.x.__proto__.z, undefined);
t.end(); t.end();
}); });
test('proto pollution (number)', function (t) { test('proto pollution (number)', function (t) {
var argv = parse(['--x','5','--x.__proto__.z','100']); var argv = parse(['--x', '5', '--x.__proto__.z', '100']);
t.equal({}.z, undefined); t.equal({}.z, undefined);
t.equal((4).z, undefined); t.equal((4).z, undefined);
t.equal(argv.x, 5); t.equal(argv.x, 5);
t.equal(argv.x.z, undefined); t.equal(argv.x.z, undefined);
t.end(); t.end();
}); });
test('proto pollution (string)', function (t) { test('proto pollution (string)', function (t) {
var argv = parse(['--x','abc','--x.__proto__.z','def']); var argv = parse(['--x', 'abc', '--x.__proto__.z', 'def']);
t.equal({}.z, undefined); t.equal({}.z, undefined);
t.equal('...'.z, undefined); t.equal('...'.z, undefined);
t.equal(argv.x, 'abc'); t.equal(argv.x, 'abc');
t.equal(argv.x.z, undefined); t.equal(argv.x.z, undefined);
t.end(); t.end();
}); });
test('proto pollution (constructor)', function (t) { test('proto pollution (constructor)', function (t) {
var argv = parse(['--constructor.prototype.y','123']); var argv = parse(['--constructor.prototype.y', '123']);
t.equal({}.y, undefined); t.equal({}.y, undefined);
t.equal(argv.y, undefined); t.equal(argv.y, undefined);
t.end(); t.end();
}); });
test('proto pollution (constructor function)', function (t) { test('proto pollution (constructor function)', function (t) {
var argv = parse(['--_.concat.constructor.prototype.y', '123']); var argv = parse(['--_.concat.constructor.prototype.y', '123']);
function fnToBeTested() {} function fnToBeTested() {}
t.equal(fnToBeTested.y, undefined); t.equal(fnToBeTested.y, undefined);
t.equal(argv.y, undefined); t.equal(argv.y, undefined);
t.end(); t.end();
}); });
// powered by snyk - https://github.com/backstage/backstage/issues/10343 // powered by snyk - https://github.com/backstage/backstage/issues/10343
test('proto pollution (constructor function) snyk', function (t) { test('proto pollution (constructor function) snyk', function (t) {
var argv = parse('--_.constructor.constructor.prototype.foo bar'.split(' ')); var argv = parse('--_.constructor.constructor.prototype.foo bar'.split(' '));
t.equal((function(){}).foo, undefined); t.equal(function () {}.foo, undefined);
t.equal(argv.y, undefined); t.equal(argv.y, undefined);
t.end(); t.end();
}) });

108
node_modules/minimist/test/short.js generated vendored

@ -1,67 +1,69 @@
'use strict';
var parse = require('../'); var parse = require('../');
var test = require('tape'); var test = require('tape');
test('numeric short args', function (t) { test('numeric short args', function (t) {
t.plan(2); t.plan(2);
t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); t.deepEqual(parse(['-n123']), { n: 123, _: [] });
t.deepEqual( t.deepEqual(
parse([ '-123', '456' ]), parse(['-123', '456']),
{ 1: true, 2: true, 3: 456, _: [] } { 1: true, 2: true, 3: 456, _: [] }
); );
}); });
test('short', function (t) { test('short', function (t) {
t.deepEqual( t.deepEqual(
parse([ '-b' ]), parse(['-b']),
{ b : true, _ : [] }, { b: true, _: [] },
'short boolean' 'short boolean'
); );
t.deepEqual( t.deepEqual(
parse([ 'foo', 'bar', 'baz' ]), parse(['foo', 'bar', 'baz']),
{ _ : [ 'foo', 'bar', 'baz' ] }, { _: ['foo', 'bar', 'baz'] },
'bare' 'bare'
); );
t.deepEqual( t.deepEqual(
parse([ '-cats' ]), parse(['-cats']),
{ c : true, a : true, t : true, s : true, _ : [] }, { c: true, a: true, t: true, s: true, _: [] },
'group' 'group'
); );
t.deepEqual( t.deepEqual(
parse([ '-cats', 'meow' ]), parse(['-cats', 'meow']),
{ c : true, a : true, t : true, s : 'meow', _ : [] }, { c: true, a: true, t: true, s: 'meow', _: [] },
'short group next' 'short group next'
); );
t.deepEqual( t.deepEqual(
parse([ '-h', 'localhost' ]), parse(['-h', 'localhost']),
{ h : 'localhost', _ : [] }, { h: 'localhost', _: [] },
'short capture' 'short capture'
); );
t.deepEqual( t.deepEqual(
parse([ '-h', 'localhost', '-p', '555' ]), parse(['-h', 'localhost', '-p', '555']),
{ h : 'localhost', p : 555, _ : [] }, { h: 'localhost', p: 555, _: [] },
'short captures' 'short captures'
); );
t.end(); t.end();
}); });
test('mixed short bool and capture', function (t) { test('mixed short bool and capture', function (t) {
t.same( t.same(
parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), parse(['-h', 'localhost', '-fp', '555', 'script.js']),
{ {
f : true, p : 555, h : 'localhost', f: true, p: 555, h: 'localhost',
_ : [ 'script.js' ] _: ['script.js'],
} }
); );
t.end(); t.end();
}); });
test('short and long', function (t) { test('short and long', function (t) {
t.deepEqual( t.deepEqual(
parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), parse(['-h', 'localhost', '-fp', '555', 'script.js']),
{ {
f : true, p : 555, h : 'localhost', f: true, p: 555, h: 'localhost',
_ : [ 'script.js' ] _: ['script.js'],
} }
); );
t.end(); t.end();
}); });

@ -1,15 +1,17 @@
'use strict';
var parse = require('../'); var parse = require('../');
var test = require('tape'); var test = require('tape');
test('stops parsing on the first non-option when stopEarly is set', function (t) { test('stops parsing on the first non-option when stopEarly is set', function (t) {
var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], { var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], {
stopEarly: true stopEarly: true,
}); });
t.deepEqual(argv, { t.deepEqual(argv, {
aaa: 'bbb', aaa: 'bbb',
_: ['ccc', '--ddd'] _: ['ccc', '--ddd'],
}); });
t.end(); t.end();
}); });

164
node_modules/minimist/test/unknown.js generated vendored

@ -1,102 +1,104 @@
'use strict';
var parse = require('../'); var parse = require('../');
var test = require('tape'); var test = require('tape');
test('boolean and alias is not unknown', function (t) { test('boolean and alias is not unknown', function (t) {
var unknown = []; var unknown = [];
function unknownFn(arg) { function unknownFn(arg) {
unknown.push(arg); unknown.push(arg);
return false; return false;
} }
var aliased = [ '-h', 'true', '--derp', 'true' ]; var aliased = ['-h', 'true', '--derp', 'true'];
var regular = [ '--herp', 'true', '-d', 'true' ]; var regular = ['--herp', 'true', '-d', 'true'];
var opts = { var opts = {
alias: { h: 'herp' }, alias: { h: 'herp' },
boolean: 'h', boolean: 'h',
unknown: unknownFn unknown: unknownFn,
}; };
var aliasedArgv = parse(aliased, opts); parse(aliased, opts);
var propertyArgv = parse(regular, opts); parse(regular, opts);
t.same(unknown, ['--derp', '-d']); t.same(unknown, ['--derp', '-d']);
t.end(); t.end();
}); });
test('flag boolean true any double hyphen argument is not unknown', function (t) { test('flag boolean true any double hyphen argument is not unknown', function (t) {
var unknown = []; var unknown = [];
function unknownFn(arg) { function unknownFn(arg) {
unknown.push(arg); unknown.push(arg);
return false; return false;
} }
var argv = parse(['--honk', '--tacos=good', 'cow', '-p', '55'], { var argv = parse(['--honk', '--tacos=good', 'cow', '-p', '55'], {
boolean: true, boolean: true,
unknown: unknownFn unknown: unknownFn,
}); });
t.same(unknown, ['--tacos=good', 'cow', '-p']); t.same(unknown, ['--tacos=good', 'cow', '-p']);
t.same(argv, { t.same(argv, {
honk: true, honk: true,
_: [] _: [],
}); });
t.end(); t.end();
}); });
test('string and alias is not unknown', function (t) { test('string and alias is not unknown', function (t) {
var unknown = []; var unknown = [];
function unknownFn(arg) { function unknownFn(arg) {
unknown.push(arg); unknown.push(arg);
return false; return false;
} }
var aliased = [ '-h', 'hello', '--derp', 'goodbye' ]; var aliased = ['-h', 'hello', '--derp', 'goodbye'];
var regular = [ '--herp', 'hello', '-d', 'moon' ]; var regular = ['--herp', 'hello', '-d', 'moon'];
var opts = { var opts = {
alias: { h: 'herp' }, alias: { h: 'herp' },
string: 'h', string: 'h',
unknown: unknownFn unknown: unknownFn,
}; };
var aliasedArgv = parse(aliased, opts); parse(aliased, opts);
var propertyArgv = parse(regular, opts); parse(regular, opts);
t.same(unknown, ['--derp', '-d']); t.same(unknown, ['--derp', '-d']);
t.end(); t.end();
}); });
test('default and alias is not unknown', function (t) { test('default and alias is not unknown', function (t) {
var unknown = []; var unknown = [];
function unknownFn(arg) { function unknownFn(arg) {
unknown.push(arg); unknown.push(arg);
return false; return false;
} }
var aliased = [ '-h', 'hello' ]; var aliased = ['-h', 'hello'];
var regular = [ '--herp', 'hello' ]; var regular = ['--herp', 'hello'];
var opts = { var opts = {
default: { 'h': 'bar' }, default: { h: 'bar' },
alias: { 'h': 'herp' }, alias: { h: 'herp' },
unknown: unknownFn unknown: unknownFn,
}; };
var aliasedArgv = parse(aliased, opts); parse(aliased, opts);
var propertyArgv = parse(regular, opts); parse(regular, opts);
t.same(unknown, []); t.same(unknown, []);
t.end(); t.end();
unknownFn(); // exercise fn for 100% coverage unknownFn(); // exercise fn for 100% coverage
}); });
test('value following -- is not unknown', function (t) { test('value following -- is not unknown', function (t) {
var unknown = []; var unknown = [];
function unknownFn(arg) { function unknownFn(arg) {
unknown.push(arg); unknown.push(arg);
return false; return false;
} }
var aliased = [ '--bad', '--', 'good', 'arg' ]; var aliased = ['--bad', '--', 'good', 'arg'];
var opts = { var opts = {
'--': true, '--': true,
unknown: unknownFn unknown: unknownFn,
}; };
var argv = parse(aliased, opts); var argv = parse(aliased, opts);
t.same(unknown, ['--bad']); t.same(unknown, ['--bad']);
t.same(argv, { t.same(argv, {
'--': ['good', 'arg'], '--': ['good', 'arg'],
'_': [] _: [],
}) });
t.end(); t.end();
}); });

@ -1,8 +1,10 @@
'use strict';
var parse = require('../'); var parse = require('../');
var test = require('tape'); var test = require('tape');
test('whitespace should be whitespace' , function (t) { test('whitespace should be whitespace', function (t) {
t.plan(1); t.plan(1);
var x = parse([ '-x', '\t' ]).x; var x = parse(['-x', '\t']).x;
t.equal(x, '\t'); t.equal(x, '\t');
}); });

21
node_modules/webpod/LICENSE generated vendored Normal file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 Anton Medvedev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

34
node_modules/webpod/README.md generated vendored Normal file

@ -0,0 +1,34 @@
# Webpod
```js
import { ssh } from 'webpod'
const $ = ssh('user@host')
const branch = await $`git branch --show-current`
await $`echo ${branch}`
await $`mkdir /tmp/${'foo bar'}`
```
## Installation
```sh
npm install webpod
```
```sh
deno install -A -r https://deno.land/x/webpod/webpod.ts
```
## Usage
### ssh()
```js
ssh('user@host', {port: 22, options: ['StrictHostKeyChecking=no']})
```
## License
[MIT](LICENSE)

1
node_modules/webpod/dist/cli.d.ts generated vendored Normal file

@ -0,0 +1 @@
export {};

1
node_modules/webpod/dist/cli.js generated vendored Normal file

@ -0,0 +1 @@
export {};

1
node_modules/webpod/dist/index.d.ts generated vendored Normal file

@ -0,0 +1 @@
export { ssh } from './ssh.js';

1
node_modules/webpod/dist/index.js generated vendored Executable file

@ -0,0 +1 @@
export { ssh } from './ssh.js';

19
node_modules/webpod/dist/ssh.d.ts generated vendored Normal file

@ -0,0 +1,19 @@
export type RemoteShell = ((pieces: TemplateStringsArray, ...values: any[]) => Promise<Result>) & {
exit: () => void;
};
export type Options = {
port?: number | string;
forwardAgent?: boolean;
shell?: string;
options?: (SshOption | `${SshOption}=${string}`)[];
};
export declare function ssh(host: string, options?: Options): RemoteShell;
export declare class Result extends String {
readonly source: string;
readonly stdout: string;
readonly stderr: string;
readonly exitCode: number | null;
readonly error?: Error;
constructor(source: string, exitCode: number | null, stdout: string, stderr: string, combined: string, error?: Error);
}
export type SshOption = 'AddKeysToAgent' | 'AddressFamily' | 'BatchMode' | 'BindAddress' | 'CanonicalDomains' | 'CanonicalizeFallbackLocal' | 'CanonicalizeHostname' | 'CanonicalizeMaxDots' | 'CanonicalizePermittedCNAMEs' | 'CASignatureAlgorithms' | 'CertificateFile' | 'ChallengeResponseAuthentication' | 'CheckHostIP' | 'Ciphers' | 'ClearAllForwardings' | 'Compression' | 'ConnectionAttempts' | 'ConnectTimeout' | 'ControlMaster' | 'ControlPath' | 'ControlPersist' | 'DynamicForward' | 'EscapeChar' | 'ExitOnForwardFailure' | 'FingerprintHash' | 'ForwardAgent' | 'ForwardX11' | 'ForwardX11Timeout' | 'ForwardX11Trusted' | 'GatewayPorts' | 'GlobalKnownHostsFile' | 'GSSAPIAuthentication' | 'GSSAPIDelegateCredentials' | 'HashKnownHosts' | 'Host' | 'HostbasedAcceptedAlgorithms' | 'HostbasedAuthentication' | 'HostKeyAlgorithms' | 'HostKeyAlias' | 'Hostname' | 'IdentitiesOnly' | 'IdentityAgent' | 'IdentityFile' | 'IPQoS' | 'KbdInteractiveAuthentication' | 'KbdInteractiveDevices' | 'KexAlgorithms' | 'KnownHostsCommand' | 'LocalCommand' | 'LocalForward' | 'LogLevel' | 'MACs' | 'Match' | 'NoHostAuthenticationForLocalhost' | 'NumberOfPasswordPrompts' | 'PasswordAuthentication' | 'PermitLocalCommand' | 'PermitRemoteOpen' | 'PKCS11Provider' | 'Port' | 'PreferredAuthentications' | 'ProxyCommand' | 'ProxyJump' | 'ProxyUseFdpass' | 'PubkeyAcceptedAlgorithms' | 'PubkeyAuthentication' | 'RekeyLimit' | 'RemoteCommand' | 'RemoteForward' | 'RequestTTY' | 'SendEnv' | 'ServerAliveInterval' | 'ServerAliveCountMax' | 'SetEnv' | 'StreamLocalBindMask' | 'StreamLocalBindUnlink' | 'StrictHostKeyChecking' | 'TCPKeepAlive' | 'Tunnel' | 'TunnelDevice' | 'UpdateHostKeys' | 'UseKeychain' | 'User' | 'UserKnownHostsFile' | 'VerifyHostKeyDNS' | 'VisualHostKey' | 'XAuthLocation';

79
node_modules/webpod/dist/ssh.js generated vendored Normal file

@ -0,0 +1,79 @@
import { spawn, spawnSync } from 'node:child_process';
import process from 'node:process';
import { controlPath, escapeshellarg } from './utils.js';
export function ssh(host, options = {}) {
const $ = function (pieces, ...values) {
const source = new Error().stack.split(/^\s*at\s/m)[2].trim();
if (pieces.some(p => p == undefined)) {
throw new Error(`Malformed command at ${source}`);
}
let cmd = pieces[0], i = 0;
while (i < values.length) {
let s;
if (Array.isArray(values[i])) {
s = values[i].map((x) => escapeshellarg(x)).join(' ');
}
else {
s = escapeshellarg(values[i]);
}
cmd += s + pieces[++i];
}
let resolve, reject;
const promise = new Promise((...args) => ([resolve, reject] = args));
const shellID = 'id$' + Math.random().toString(36).slice(2);
const args = [
host,
'-o', 'ControlMaster=auto',
'-o', 'ControlPath=' + controlPath(host),
'-o', 'ControlPersist=5m',
...(options.port ? ['-p', `${options.port}`] : []),
...(options.forwardAgent ? ['-A'] : []),
...(options.options || []).flatMap(x => ['-o', x]),
`: ${shellID}; ` + (options.shell || 'bash -ls')
];
if (process.env.WEBPOD_DEBUG) {
console.log('ssh', args.join(' '));
}
const child = spawn('ssh', args, {
stdio: ['pipe', 'pipe', 'pipe'],
windowsHide: true,
});
let stdout = '', stderr = '', combined = '';
const onStdout = (data) => {
stdout += data;
combined += data;
};
const onStderr = (data) => {
stderr += data;
combined += data;
};
child.stdout.on('data', onStdout);
child.stderr.on('data', onStderr);
child.on('close', (code) => {
if (code === 0) {
resolve(new Result(source, code, stdout, stderr, combined));
}
else {
reject(new Result(source, code, stdout, stderr, combined));
}
});
child.on('error', err => {
reject(new Result(source, null, stdout, stderr, combined, err));
});
child.stdin.write(cmd);
child.stdin.end();
return promise;
};
$.exit = () => spawnSync('ssh', [host, '-O', 'exit', '-o', `ControlPath=${controlPath(host)}`]);
return $;
}
export class Result extends String {
constructor(source, exitCode, stdout, stderr, combined, error) {
super(combined);
this.source = source;
this.stdout = stdout;
this.stderr = stderr;
this.exitCode = exitCode;
this.error = error;
}
}

3
node_modules/webpod/dist/utils.d.ts generated vendored Normal file

@ -0,0 +1,3 @@
export declare function isWritable(path: string): boolean;
export declare function controlPath(host: string): string;
export declare function escapeshellarg(arg: string): string;

35
node_modules/webpod/dist/utils.js generated vendored Normal file

@ -0,0 +1,35 @@
import fs from 'node:fs';
import os from 'node:os';
import process from 'node:process';
export function isWritable(path) {
try {
fs.accessSync(path, fs.constants.W_OK);
return true;
}
catch (err) {
return false;
}
}
export function controlPath(host) {
let c = 'ssh-' + host;
if ('CI' in process.env && isWritable('/dev/shm')) {
return `/dev/shm/${c}`;
}
return `${os.homedir()}/.ssh/${c}`;
}
export function escapeshellarg(arg) {
if (/^[a-z0-9/_.\-@:=]+$/i.test(arg) || arg === '') {
return arg;
}
return (`$'` +
arg
.replace(/\\/g, '\\\\')
.replace(/'/g, '\\\'')
.replace(/\f/g, '\\f')
.replace(/\n/g, '\\n')
.replace(/\r/g, '\\r')
.replace(/\t/g, '\\t')
.replace(/\v/g, '\\v')
.replace(/\0/g, '\\0') +
`'`);
}

2
node_modules/webpod/mod.ts generated vendored Normal file

@ -0,0 +1,2 @@
// @deno-types="./dist/index.d.ts"
export * from './dist/index.js'

Some files were not shown because too many files have changed in this diff Show More