├── .eslintrc.js
├── .gitignore
├── .npmrc
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── generate_annotations.js
├── package.json
└── src
├── annotation_map.js
├── annotations.js
├── highlight.js
├── history.js
├── index.js
├── inspector.js
├── stub.js
└── util.js
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | module.exports = {
4 | root: true,
5 | extends: 'airbnb-base',
6 | parser: 'babel-eslint',
7 | parserOptions: {
8 | ecmaVersion: 2021,
9 | sourceType: 'script',
10 | },
11 | env: {
12 | es6: true,
13 | node: true,
14 | },
15 | rules: {
16 | 'strict': ['error', 'global'],
17 | 'no-bitwise': 'off',
18 | 'no-iterator': 'off',
19 | 'global-require': 'off',
20 | 'quote-props': ['error', 'consistent-as-needed'],
21 | 'brace-style': ['error', '1tbs', { allowSingleLine: false }],
22 | 'curly': ['error', 'all'],
23 | 'no-param-reassign': 'off',
24 | 'arrow-parens': ['error', 'always'],
25 | 'no-multi-assign': 'off',
26 | 'no-underscore-dangle': 'off',
27 | 'no-restricted-syntax': 'off',
28 | 'object-curly-newline': 'off',
29 | 'prefer-const': ['error', { destructuring: 'all' }],
30 | 'class-methods-use-this': 'off',
31 | 'implicit-arrow-linebreak': 'off',
32 | 'import/no-dynamic-require': 'off',
33 | 'import/no-extraneous-dependencies': ['error', {
34 | devDependencies: true,
35 | }],
36 | 'import/extensions': 'off',
37 | },
38 | globals: {
39 | globalThis: false,
40 | },
41 | };
42 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Code of Conduct
2 |
3 | The [Node.js Code of Conduct][] applies to this repo.
4 |
5 | # Moderation Policy
6 |
7 | The [Node.js Moderation Policy][] applies to this repo.
8 |
9 | [Node.js Code of Conduct]: https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md
10 | [Node.js Moderation Policy]: https://github.com/nodejs/admin/blob/master/Moderation-Policy.md
11 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to Node.js
2 |
3 | The Node.js project has a
4 | [Code of Conduct](https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md)
5 | that *all* contributors are expected to follow. This code describes the
6 | *minimum* behavior expectations for all contributors.
7 |
8 |
9 | ## Developer's Certificate of Origin 1.1
10 |
11 | By making a contribution to this project, I certify that:
12 |
13 | * (a) The contribution was created in whole or in part by me and I
14 | have the right to submit it under the open source license
15 | indicated in the file; or
16 |
17 | * (b) The contribution is based upon previous work that, to the best
18 | of my knowledge, is covered under an appropriate open source
19 | license and I have the right under that license to submit that
20 | work with modifications, whether created in whole or in part
21 | by me, under the same open source license (unless I am
22 | permitted to submit under a different license), as indicated
23 | in the file; or
24 |
25 | * (c) The contribution was provided directly to me by some other
26 | person who certified (a), (b) or (c) and I have not modified
27 | it.
28 |
29 | * (d) I understand and agree that this project and the contribution
30 | are public and that a record of the contribution (including all
31 | personal information I submit with it, including my sign-off) is
32 | maintained indefinitely and may be redistributed consistent with
33 | this project or the open source license(s) involved.
34 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License (MIT)
2 |
3 | Copyright (c) Node.js contributors.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Node.js REPL Prototype
2 |
3 | Goals:
4 |
5 | - Better debugging and interaction
6 | - Runtime inspection
7 | - Benchmarking
8 | - Pretty UI
9 | - Highlight output *and* input
10 | - autocomplete
11 | - Keep the code neat for future changes
12 |
13 | ## Usage
14 |
15 | 
16 | 
17 | 
18 | 
19 | 
20 | 
21 | 
22 |
23 | ### Install
24 |
25 | ```sh
26 | $ npm install -g nodejs/repl
27 | ```
28 |
29 | ```sh
30 | $ node-prototype-repl
31 | ```
32 |
33 | If you want to use this REPL by default, you can point
34 | `NODE_REPL_EXTERNAL_MODULE` to the result of
35 | `which node-prototype-repl`!
36 |
37 | ## Contributing
38 |
39 | See [CONTRIBUTING.md](./CONTRIBUTING.md).
40 |
41 | ## License
42 |
43 | MIT. See [LICENSE](./LICENSE).
44 |
--------------------------------------------------------------------------------
/generate_annotations.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const fs = require('fs');
4 | const Module = require('module');
5 | const ts = require('typescript');
6 | const domain = require('domain');
7 |
8 | const d = domain.create();
9 | d.on('error', () => {});
10 |
11 | const functions = [];
12 |
13 | const scanned = new Set([
14 | process.mainModule,
15 | ]);
16 | const forbiddenPaths = new Set([
17 | // duplicate with buffer module
18 | 'globalThis?.Buffer',
19 | // prints experimental warning
20 | 'globalThis?.fetch',
21 | // prints experimental warning
22 | 'globalThis?.FormData',
23 | // prints experimental warning
24 | 'globalThis?.Headers',
25 | // prints experimental warning
26 | 'globalThis?.Request',
27 | // prints experimental warning
28 | 'globalThis?.Response',
29 | ]);
30 | const scan = (ns, path) => {
31 | if (scanned.has(ns)) {
32 | return;
33 | }
34 | if (forbiddenPaths.has(path)) {
35 | return;
36 | }
37 | scanned.add(ns);
38 | if (typeof ns === 'function') {
39 | functions.push(path);
40 | }
41 | if (typeof ns !== 'function' && (typeof ns !== 'object' || ns === null)) {
42 | return;
43 | }
44 |
45 | Reflect.ownKeys(ns).forEach((name) => {
46 | if (typeof name === 'string' && name.startsWith('_')) {
47 | return;
48 | }
49 | try {
50 | d.run(() => {
51 | ns[name];
52 | });
53 | } catch {
54 | return;
55 | }
56 | if (typeof name === 'symbol') {
57 | if (name.description.startsWith('Symbol')) {
58 | scan(ns[name], `${path}?.[${name.description}]`);
59 | }
60 | } else {
61 | scan(ns[name], `${path}?.${name}`);
62 | }
63 | });
64 | };
65 |
66 | scan(globalThis, 'globalThis');
67 |
68 | const required = new Set();
69 | const forbidden = new Set(['repl', 'domain', 'sys', 'module']);
70 | Module.builtinModules.forEach((m) => {
71 | if (m.startsWith('_') || m.includes('/') || forbidden.has(m)) {
72 | return;
73 | }
74 | required.add(m);
75 | scan(require(m), m);
76 | });
77 |
78 | const compilerOptions = {
79 | lib: ['lib.esnext.d.ts', 'lib.dom.d.ts'],
80 | types: ['node'],
81 | target: ts.ScriptTarget.Latest,
82 | strict: true,
83 | };
84 | const host = ts.createCompilerHost(compilerOptions);
85 | const originalReadFile = host.readFile;
86 | host.readFile = (name) => {
87 | if (name === 'index.ts') {
88 | return `
89 | ${[...required].map((r) => `import * as ${r} from '${r}';`).join('\n')}
90 | ${functions.join('\n').replaceAll('?', '')}
91 | `;
92 | }
93 | return originalReadFile.call(host, name);
94 | };
95 | host.writeFile = () => {
96 | throw new Error();
97 | };
98 | const program = ts.createProgram(['index.ts'], compilerOptions, host);
99 | const checker = program.getTypeChecker();
100 |
101 | function convertSignature(signature) {
102 | return signature.parameters.map((symbol) => {
103 | const param = symbol.valueDeclaration;
104 | if (param.questionToken) {
105 | return `?${symbol.name}`;
106 | }
107 | if (param.dotDotDotToken) {
108 | return `...${symbol.name}`;
109 | }
110 | return symbol.name;
111 | });
112 | }
113 |
114 | function arrayEqual(a1, a2) {
115 | if (a1.length !== a2.length) {
116 | return false;
117 | }
118 | for (let i = 0; i < a1.length; i += 1) {
119 | if (a1[i] !== a2[i]) {
120 | return false;
121 | }
122 | }
123 | return true;
124 | }
125 |
126 | const out = [];
127 |
128 | program.getSourceFile('index.ts').statements.forEach((stmt, i) => {
129 | const path = functions[i - required.size];
130 | if (!path) {
131 | return;
132 | }
133 |
134 | const type = checker.getTypeAtLocation(stmt.expression);
135 | if (checker.typeToString(type) === 'any') {
136 | console.error(path);
137 | }
138 |
139 | const data = {
140 | call: [],
141 | construct: [],
142 | };
143 |
144 | const C = (signatures, a) => {
145 | signatures
146 | .filter((s) => s.parameters.length > 0)
147 | .forEach((signature) => {
148 | const s = convertSignature(signature);
149 | if (!a.some((e) => arrayEqual(s, e))) {
150 | a.push(s);
151 | }
152 | });
153 | };
154 |
155 | C(type.getCallSignatures(), data.call);
156 | C(type.getConstructSignatures(), data.construct);
157 |
158 | data.call.sort((a, b) => a.length - b.length);
159 | data.construct.sort((a, b) => a.length - b.length);
160 |
161 | if (data.call.length > 0 || data.construct.length > 0) {
162 | out.push(` [${path}, ${JSON.stringify(data)}]`);
163 | }
164 | });
165 |
166 | fs.writeFileSync('./src/annotation_map.js', `'use strict';
167 |
168 | /* eslint-disable */
169 |
170 | // Generated by generate_annotations.js
171 | // This file maps native methods to their signatures for completion
172 | // in the repl. if a method isn't listed here, it is either unknown
173 | // to the generator script, or it doesn't take any arguments.
174 |
175 | ${[...required].map((r) => `const ${r} = require('${r}');`).join('\n')}
176 |
177 | module.exports = new WeakMap([
178 | ${out.join(',\n')},
179 | ].filter(([key]) => key !== undefined));
180 | `);
181 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@nodejs/repl",
3 | "version": "0.0.1",
4 | "description": "Prototype REPL for Node.js",
5 | "main": "src/index.js",
6 | "license": "MIT",
7 | "scripts": {
8 | "lint": "eslint src"
9 | },
10 | "bin": {
11 | "node-prototype-repl": "./src/index.js"
12 | },
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/nodejs/repl.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/nodejs/repl/issues"
19 | },
20 | "homepage": "https://github.com/nodejs/repl#readme",
21 | "devDependencies": {
22 | "@types/node": "^18.14.6",
23 | "babel-eslint": "^10.0.3",
24 | "eslint": "^6.5.1",
25 | "eslint-config-airbnb-base": "^14.0.0",
26 | "eslint-plugin-import": "^2.20.2",
27 | "typescript": "^4.7.4"
28 | },
29 | "dependencies": {
30 | "acorn": "^8.7.1",
31 | "acorn-loose": "^8.3.0",
32 | "chalk": "^4.1.2",
33 | "emphasize": "^4.2.0",
34 | "strip-ansi": "^6.0.1",
35 | "ws": "^7.3.0"
36 | },
37 | "private": true
38 | }
39 |
--------------------------------------------------------------------------------
/src/annotation_map.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* eslint-disable */
4 |
5 | // Generated by generate_annotations.js
6 | // This file maps native methods to their signatures for completion
7 | // in the repl. if a method isn't listed here, it is either unknown
8 | // to the generator script, or it doesn't take any arguments.
9 |
10 | const assert = require('assert');
11 | const async_hooks = require('async_hooks');
12 | const buffer = require('buffer');
13 | const child_process = require('child_process');
14 | const cluster = require('cluster');
15 | const console = require('console');
16 | const constants = require('constants');
17 | const crypto = require('crypto');
18 | const dgram = require('dgram');
19 | const diagnostics_channel = require('diagnostics_channel');
20 | const dns = require('dns');
21 | const events = require('events');
22 | const fs = require('fs');
23 | const http = require('http');
24 | const http2 = require('http2');
25 | const https = require('https');
26 | const inspector = require('inspector');
27 | const net = require('net');
28 | const os = require('os');
29 | const path = require('path');
30 | const perf_hooks = require('perf_hooks');
31 | const process = require('process');
32 | const punycode = require('punycode');
33 | const querystring = require('querystring');
34 | const readline = require('readline');
35 | const stream = require('stream');
36 | const string_decoder = require('string_decoder');
37 | const timers = require('timers');
38 | const tls = require('tls');
39 | const trace_events = require('trace_events');
40 | const tty = require('tty');
41 | const url = require('url');
42 | const util = require('util');
43 | const v8 = require('v8');
44 | const vm = require('vm');
45 | const worker_threads = require('worker_threads');
46 | const zlib = require('zlib');
47 |
48 | module.exports = new WeakMap([
49 | [globalThis?.Object, {"call":[["value"]],"construct":[["?value"]]}],
50 | [globalThis?.Object?.prototype?.hasOwnProperty, {"call":[["v"]],"construct":[]}],
51 | [globalThis?.Object?.prototype?.isPrototypeOf, {"call":[["v"]],"construct":[]}],
52 | [globalThis?.Object?.prototype?.propertyIsEnumerable, {"call":[["v"]],"construct":[]}],
53 | [globalThis?.Object?.assign, {"call":[["target","source"],["target","...sources"],["target","source1","source2"],["target","source1","source2","source3"]],"construct":[]}],
54 | [globalThis?.Object?.getOwnPropertyDescriptor, {"call":[["o","p"]],"construct":[]}],
55 | [globalThis?.Object?.getOwnPropertyDescriptors, {"call":[["o"]],"construct":[]}],
56 | [globalThis?.Object?.getOwnPropertyNames, {"call":[["o"]],"construct":[]}],
57 | [globalThis?.Object?.getOwnPropertySymbols, {"call":[["o"]],"construct":[]}],
58 | [globalThis?.Object?.hasOwn, {"call":[["o","v"]],"construct":[]}],
59 | [globalThis?.Object?.is, {"call":[["value1","value2"]],"construct":[]}],
60 | [globalThis?.Object?.preventExtensions, {"call":[["o"]],"construct":[]}],
61 | [globalThis?.Object?.seal, {"call":[["o"]],"construct":[]}],
62 | [globalThis?.Object?.create, {"call":[["o"],["o","properties"]],"construct":[]}],
63 | [globalThis?.Object?.defineProperties, {"call":[["o","properties"]],"construct":[]}],
64 | [globalThis?.Object?.defineProperty, {"call":[["o","p","attributes"]],"construct":[]}],
65 | [globalThis?.Object?.freeze, {"call":[["a"],["f"],["o"]],"construct":[]}],
66 | [globalThis?.Object?.getPrototypeOf, {"call":[["o"]],"construct":[]}],
67 | [globalThis?.Object?.setPrototypeOf, {"call":[["o","proto"]],"construct":[]}],
68 | [globalThis?.Object?.isExtensible, {"call":[["o"]],"construct":[]}],
69 | [globalThis?.Object?.isFrozen, {"call":[["o"]],"construct":[]}],
70 | [globalThis?.Object?.isSealed, {"call":[["o"]],"construct":[]}],
71 | [globalThis?.Object?.keys, {"call":[["o"]],"construct":[]}],
72 | [globalThis?.Object?.entries, {"call":[["o"]],"construct":[]}],
73 | [globalThis?.Object?.fromEntries, {"call":[["entries"]],"construct":[]}],
74 | [globalThis?.Object?.values, {"call":[["o"]],"construct":[]}],
75 | [globalThis?.Function, {"call":[["...args"]],"construct":[["...args"]]}],
76 | [globalThis?.Function?.prototype?.apply, {"call":[["thisArg","?argArray"]],"construct":[]}],
77 | [globalThis?.Function?.prototype?.bind, {"call":[["thisArg","...argArray"]],"construct":[]}],
78 | [globalThis?.Function?.prototype?.call, {"call":[["thisArg","...argArray"]],"construct":[]}],
79 | [globalThis?.Array, {"call":[["?arrayLength"],["arrayLength"],["...items"]],"construct":[["?arrayLength"],["arrayLength"],["...items"]]}],
80 | [globalThis?.Array?.prototype?.at, {"call":[["index"]],"construct":[]}],
81 | [globalThis?.Array?.prototype?.concat, {"call":[["...items"]],"construct":[]}],
82 | [globalThis?.Array?.prototype?.copyWithin, {"call":[["target","start","?end"]],"construct":[]}],
83 | [globalThis?.Array?.prototype?.fill, {"call":[["value","?start","?end"]],"construct":[]}],
84 | [globalThis?.Array?.prototype?.find, {"call":[["predicate","?thisArg"]],"construct":[]}],
85 | [globalThis?.Array?.prototype?.findIndex, {"call":[["predicate","?thisArg"]],"construct":[]}],
86 | [globalThis?.Array?.prototype?.lastIndexOf, {"call":[["searchElement","?fromIndex"]],"construct":[]}],
87 | [globalThis?.Array?.prototype?.push, {"call":[["...items"]],"construct":[]}],
88 | [globalThis?.Array?.prototype?.unshift, {"call":[["...items"]],"construct":[]}],
89 | [globalThis?.Array?.prototype?.slice, {"call":[["?start","?end"]],"construct":[]}],
90 | [globalThis?.Array?.prototype?.sort, {"call":[["?compareFn"]],"construct":[]}],
91 | [globalThis?.Array?.prototype?.splice, {"call":[["start","?deleteCount"],["start","deleteCount","...items"]],"construct":[]}],
92 | [globalThis?.Array?.prototype?.includes, {"call":[["searchElement","?fromIndex"]],"construct":[]}],
93 | [globalThis?.Array?.prototype?.indexOf, {"call":[["searchElement","?fromIndex"]],"construct":[]}],
94 | [globalThis?.Array?.prototype?.join, {"call":[["?separator"]],"construct":[]}],
95 | [globalThis?.Array?.prototype?.forEach, {"call":[["callbackfn","?thisArg"]],"construct":[]}],
96 | [globalThis?.Array?.prototype?.filter, {"call":[["predicate","?thisArg"]],"construct":[]}],
97 | [globalThis?.Array?.prototype?.flat, {"call":[["?depth"]],"construct":[]}],
98 | [globalThis?.Array?.prototype?.flatMap, {"call":[["callback","?thisArg"]],"construct":[]}],
99 | [globalThis?.Array?.prototype?.map, {"call":[["callbackfn","?thisArg"]],"construct":[]}],
100 | [globalThis?.Array?.prototype?.every, {"call":[["predicate","?thisArg"]],"construct":[]}],
101 | [globalThis?.Array?.prototype?.some, {"call":[["predicate","?thisArg"]],"construct":[]}],
102 | [globalThis?.Array?.prototype?.reduce, {"call":[["callbackfn"],["callbackfn","initialValue"]],"construct":[]}],
103 | [globalThis?.Array?.prototype?.reduceRight, {"call":[["callbackfn"],["callbackfn","initialValue"]],"construct":[]}],
104 | [globalThis?.Array?.isArray, {"call":[["arg"]],"construct":[]}],
105 | [globalThis?.Array?.from, {"call":[["arrayLike"],["iterable"],["arrayLike","mapfn","?thisArg"],["iterable","mapfn","?thisArg"]],"construct":[]}],
106 | [globalThis?.Array?.of, {"call":[["...items"]],"construct":[]}],
107 | [globalThis?.Number, {"call":[["?value"]],"construct":[["?value"]]}],
108 | [globalThis?.Number?.prototype?.toExponential, {"call":[["?fractionDigits"]],"construct":[]}],
109 | [globalThis?.Number?.prototype?.toFixed, {"call":[["?fractionDigits"]],"construct":[]}],
110 | [globalThis?.Number?.prototype?.toPrecision, {"call":[["?precision"]],"construct":[]}],
111 | [globalThis?.Number?.prototype?.toString, {"call":[["?radix"]],"construct":[]}],
112 | [globalThis?.Number?.prototype?.toLocaleString, {"call":[["?locales","?options"]],"construct":[]}],
113 | [globalThis?.Number?.isFinite, {"call":[["number"]],"construct":[]}],
114 | [globalThis?.Number?.isInteger, {"call":[["number"]],"construct":[]}],
115 | [globalThis?.Number?.isNaN, {"call":[["number"]],"construct":[]}],
116 | [globalThis?.Number?.isSafeInteger, {"call":[["number"]],"construct":[]}],
117 | [globalThis?.Number?.parseFloat, {"call":[["string"]],"construct":[]}],
118 | [globalThis?.Number?.parseInt, {"call":[["string","?radix"]],"construct":[]}],
119 | [globalThis?.Boolean, {"call":[["?value"]],"construct":[["?value"]]}],
120 | [globalThis?.String, {"call":[["?value"]],"construct":[["?value"]]}],
121 | [globalThis?.String?.prototype?.anchor, {"call":[["name"]],"construct":[]}],
122 | [globalThis?.String?.prototype?.at, {"call":[["index"]],"construct":[]}],
123 | [globalThis?.String?.prototype?.charAt, {"call":[["pos"]],"construct":[]}],
124 | [globalThis?.String?.prototype?.charCodeAt, {"call":[["index"]],"construct":[]}],
125 | [globalThis?.String?.prototype?.codePointAt, {"call":[["pos"]],"construct":[]}],
126 | [globalThis?.String?.prototype?.concat, {"call":[["...strings"]],"construct":[]}],
127 | [globalThis?.String?.prototype?.endsWith, {"call":[["searchString","?endPosition"]],"construct":[]}],
128 | [globalThis?.String?.prototype?.fontcolor, {"call":[["color"]],"construct":[]}],
129 | [globalThis?.String?.prototype?.fontsize, {"call":[["size"]],"construct":[]}],
130 | [globalThis?.String?.prototype?.includes, {"call":[["searchString","?position"]],"construct":[]}],
131 | [globalThis?.String?.prototype?.indexOf, {"call":[["searchString","?position"]],"construct":[]}],
132 | [globalThis?.String?.prototype?.lastIndexOf, {"call":[["searchString","?position"]],"construct":[]}],
133 | [globalThis?.String?.prototype?.link, {"call":[["url"]],"construct":[]}],
134 | [globalThis?.String?.prototype?.localeCompare, {"call":[["that"],["that","?locales","?options"]],"construct":[]}],
135 | [globalThis?.String?.prototype?.match, {"call":[["regexp"],["matcher"]],"construct":[]}],
136 | [globalThis?.String?.prototype?.matchAll, {"call":[["regexp"]],"construct":[]}],
137 | [globalThis?.String?.prototype?.normalize, {"call":[["form"],["?form"]],"construct":[]}],
138 | [globalThis?.String?.prototype?.padEnd, {"call":[["maxLength","?fillString"]],"construct":[]}],
139 | [globalThis?.String?.prototype?.padStart, {"call":[["maxLength","?fillString"]],"construct":[]}],
140 | [globalThis?.String?.prototype?.repeat, {"call":[["count"]],"construct":[]}],
141 | [globalThis?.String?.prototype?.replace, {"call":[["searchValue","replaceValue"],["searchValue","replacer"]],"construct":[]}],
142 | [globalThis?.String?.prototype?.replaceAll, {"call":[["searchValue","replaceValue"],["searchValue","replacer"]],"construct":[]}],
143 | [globalThis?.String?.prototype?.search, {"call":[["regexp"],["searcher"]],"construct":[]}],
144 | [globalThis?.String?.prototype?.slice, {"call":[["?start","?end"]],"construct":[]}],
145 | [globalThis?.String?.prototype?.split, {"call":[["separator","?limit"],["splitter","?limit"]],"construct":[]}],
146 | [globalThis?.String?.prototype?.substr, {"call":[["from","?length"]],"construct":[]}],
147 | [globalThis?.String?.prototype?.substring, {"call":[["start","?end"]],"construct":[]}],
148 | [globalThis?.String?.prototype?.startsWith, {"call":[["searchString","?position"]],"construct":[]}],
149 | [globalThis?.String?.prototype?.toLocaleLowerCase, {"call":[["?locales"]],"construct":[]}],
150 | [globalThis?.String?.prototype?.toLocaleUpperCase, {"call":[["?locales"]],"construct":[]}],
151 | [globalThis?.String?.fromCharCode, {"call":[["...codes"]],"construct":[]}],
152 | [globalThis?.String?.fromCodePoint, {"call":[["...codePoints"]],"construct":[]}],
153 | [globalThis?.String?.raw, {"call":[["template","...substitutions"]],"construct":[]}],
154 | [globalThis?.Symbol, {"call":[["?description"]],"construct":[]}],
155 | [globalThis?.Symbol?.for, {"call":[["key"]],"construct":[]}],
156 | [globalThis?.Symbol?.keyFor, {"call":[["sym"]],"construct":[]}],
157 | [globalThis?.Date, {"call":[],"construct":[["value"],["year","month","?date","?hours","?minutes","?seconds","?ms"]]}],
158 | [globalThis?.Date?.prototype?.setDate, {"call":[["date"]],"construct":[]}],
159 | [globalThis?.Date?.prototype?.setFullYear, {"call":[["year","?month","?date"]],"construct":[]}],
160 | [globalThis?.Date?.prototype?.setHours, {"call":[["hours","?min","?sec","?ms"]],"construct":[]}],
161 | [globalThis?.Date?.prototype?.setMilliseconds, {"call":[["ms"]],"construct":[]}],
162 | [globalThis?.Date?.prototype?.setMinutes, {"call":[["min","?sec","?ms"]],"construct":[]}],
163 | [globalThis?.Date?.prototype?.setMonth, {"call":[["month","?date"]],"construct":[]}],
164 | [globalThis?.Date?.prototype?.setSeconds, {"call":[["sec","?ms"]],"construct":[]}],
165 | [globalThis?.Date?.prototype?.setTime, {"call":[["time"]],"construct":[]}],
166 | [globalThis?.Date?.prototype?.setUTCDate, {"call":[["date"]],"construct":[]}],
167 | [globalThis?.Date?.prototype?.setUTCFullYear, {"call":[["year","?month","?date"]],"construct":[]}],
168 | [globalThis?.Date?.prototype?.setUTCHours, {"call":[["hours","?min","?sec","?ms"]],"construct":[]}],
169 | [globalThis?.Date?.prototype?.setUTCMilliseconds, {"call":[["ms"]],"construct":[]}],
170 | [globalThis?.Date?.prototype?.setUTCMinutes, {"call":[["min","?sec","?ms"]],"construct":[]}],
171 | [globalThis?.Date?.prototype?.setUTCMonth, {"call":[["month","?date"]],"construct":[]}],
172 | [globalThis?.Date?.prototype?.setUTCSeconds, {"call":[["sec","?ms"]],"construct":[]}],
173 | [globalThis?.Date?.prototype?.toJSON, {"call":[["?key"]],"construct":[]}],
174 | [globalThis?.Date?.prototype?.toLocaleString, {"call":[["?locales","?options"]],"construct":[]}],
175 | [globalThis?.Date?.prototype?.toLocaleDateString, {"call":[["?locales","?options"]],"construct":[]}],
176 | [globalThis?.Date?.prototype?.toLocaleTimeString, {"call":[["?locales","?options"]],"construct":[]}],
177 | [globalThis?.Date?.parse, {"call":[["s"]],"construct":[]}],
178 | [globalThis?.Date?.UTC, {"call":[["year","month","?date","?hours","?minutes","?seconds","?ms"]],"construct":[]}],
179 | [globalThis?.Promise, {"call":[],"construct":[["executor"]]}],
180 | [globalThis?.Promise?.prototype?.then, {"call":[["?onfulfilled","?onrejected"]],"construct":[]}],
181 | [globalThis?.Promise?.prototype?.catch, {"call":[["?onrejected"]],"construct":[]}],
182 | [globalThis?.Promise?.prototype?.finally, {"call":[["?onfinally"]],"construct":[]}],
183 | [globalThis?.Promise?.all, {"call":[["values"]],"construct":[]}],
184 | [globalThis?.Promise?.allSettled, {"call":[["values"]],"construct":[]}],
185 | [globalThis?.Promise?.any, {"call":[["values"]],"construct":[]}],
186 | [globalThis?.Promise?.race, {"call":[["values"]],"construct":[]}],
187 | [globalThis?.Promise?.resolve, {"call":[["value"]],"construct":[]}],
188 | [globalThis?.Promise?.reject, {"call":[["?reason"]],"construct":[]}],
189 | [globalThis?.RegExp, {"call":[["pattern"],["pattern","?flags"]],"construct":[["pattern"],["pattern","?flags"]]}],
190 | [globalThis?.RegExp?.prototype?.exec, {"call":[["string"]],"construct":[]}],
191 | [globalThis?.RegExp?.prototype?.compile, {"call":[["pattern","?flags"]],"construct":[]}],
192 | [globalThis?.RegExp?.prototype?.test, {"call":[["string"]],"construct":[]}],
193 | [globalThis?.Error, {"call":[["?message"],["?message","?options"]],"construct":[["?message"],["?message","?options"]]}],
194 | [globalThis?.Error?.captureStackTrace, {"call":[["targetObject","?constructorOpt"]],"construct":[]}],
195 | [globalThis?.AggregateError, {"call":[["errors","?message"],["errors","?message","?options"]],"construct":[["errors","?message"],["errors","?message","?options"]]}],
196 | [globalThis?.EvalError, {"call":[["?message"],["?message","?options"]],"construct":[["?message"],["?message","?options"]]}],
197 | [globalThis?.RangeError, {"call":[["?message"],["?message","?options"]],"construct":[["?message"],["?message","?options"]]}],
198 | [globalThis?.ReferenceError, {"call":[["?message"],["?message","?options"]],"construct":[["?message"],["?message","?options"]]}],
199 | [globalThis?.SyntaxError, {"call":[["?message"],["?message","?options"]],"construct":[["?message"],["?message","?options"]]}],
200 | [globalThis?.TypeError, {"call":[["?message"],["?message","?options"]],"construct":[["?message"],["?message","?options"]]}],
201 | [globalThis?.URIError, {"call":[["?message"],["?message","?options"]],"construct":[["?message"],["?message","?options"]]}],
202 | [globalThis?.JSON?.parse, {"call":[["text","?reviver"]],"construct":[]}],
203 | [globalThis?.JSON?.stringify, {"call":[["value","?replacer","?space"]],"construct":[]}],
204 | [globalThis?.Math?.abs, {"call":[["x"]],"construct":[]}],
205 | [globalThis?.Math?.acos, {"call":[["x"]],"construct":[]}],
206 | [globalThis?.Math?.acosh, {"call":[["x"]],"construct":[]}],
207 | [globalThis?.Math?.asin, {"call":[["x"]],"construct":[]}],
208 | [globalThis?.Math?.asinh, {"call":[["x"]],"construct":[]}],
209 | [globalThis?.Math?.atan, {"call":[["x"]],"construct":[]}],
210 | [globalThis?.Math?.atanh, {"call":[["x"]],"construct":[]}],
211 | [globalThis?.Math?.atan2, {"call":[["y","x"]],"construct":[]}],
212 | [globalThis?.Math?.ceil, {"call":[["x"]],"construct":[]}],
213 | [globalThis?.Math?.cbrt, {"call":[["x"]],"construct":[]}],
214 | [globalThis?.Math?.expm1, {"call":[["x"]],"construct":[]}],
215 | [globalThis?.Math?.clz32, {"call":[["x"]],"construct":[]}],
216 | [globalThis?.Math?.cos, {"call":[["x"]],"construct":[]}],
217 | [globalThis?.Math?.cosh, {"call":[["x"]],"construct":[]}],
218 | [globalThis?.Math?.exp, {"call":[["x"]],"construct":[]}],
219 | [globalThis?.Math?.floor, {"call":[["x"]],"construct":[]}],
220 | [globalThis?.Math?.fround, {"call":[["x"]],"construct":[]}],
221 | [globalThis?.Math?.hypot, {"call":[["...values"]],"construct":[]}],
222 | [globalThis?.Math?.imul, {"call":[["x","y"]],"construct":[]}],
223 | [globalThis?.Math?.log, {"call":[["x"]],"construct":[]}],
224 | [globalThis?.Math?.log1p, {"call":[["x"]],"construct":[]}],
225 | [globalThis?.Math?.log2, {"call":[["x"]],"construct":[]}],
226 | [globalThis?.Math?.log10, {"call":[["x"]],"construct":[]}],
227 | [globalThis?.Math?.max, {"call":[["...values"]],"construct":[]}],
228 | [globalThis?.Math?.min, {"call":[["...values"]],"construct":[]}],
229 | [globalThis?.Math?.pow, {"call":[["x","y"]],"construct":[]}],
230 | [globalThis?.Math?.round, {"call":[["x"]],"construct":[]}],
231 | [globalThis?.Math?.sign, {"call":[["x"]],"construct":[]}],
232 | [globalThis?.Math?.sin, {"call":[["x"]],"construct":[]}],
233 | [globalThis?.Math?.sinh, {"call":[["x"]],"construct":[]}],
234 | [globalThis?.Math?.sqrt, {"call":[["x"]],"construct":[]}],
235 | [globalThis?.Math?.tan, {"call":[["x"]],"construct":[]}],
236 | [globalThis?.Math?.tanh, {"call":[["x"]],"construct":[]}],
237 | [globalThis?.Math?.trunc, {"call":[["x"]],"construct":[]}],
238 | [globalThis?.Intl?.DateTimeFormat, {"call":[["?locales","?options"]],"construct":[["?locales","?options"]]}],
239 | [globalThis?.Intl?.DateTimeFormat?.prototype?.formatToParts, {"call":[["?date"]],"construct":[]}],
240 | [globalThis?.Intl?.DateTimeFormat?.prototype?.formatRange, {"call":[["startDate","endDate"]],"construct":[]}],
241 | [globalThis?.Intl?.DateTimeFormat?.prototype?.formatRangeToParts, {"call":[["startDate","endDate"]],"construct":[]}],
242 | [globalThis?.Intl?.DateTimeFormat?.supportedLocalesOf, {"call":[["locales","?options"]],"construct":[]}],
243 | [globalThis?.Intl?.NumberFormat, {"call":[["?locales","?options"]],"construct":[["?locales","?options"]]}],
244 | [globalThis?.Intl?.NumberFormat?.prototype?.formatToParts, {"call":[["?number"]],"construct":[]}],
245 | [globalThis?.Intl?.NumberFormat?.prototype?.formatRange, {"call":[["start","end"]],"construct":[]}],
246 | [globalThis?.Intl?.NumberFormat?.prototype?.formatRangeToParts, {"call":[["start","end"]],"construct":[]}],
247 | [globalThis?.Intl?.NumberFormat?.supportedLocalesOf, {"call":[["locales","?options"]],"construct":[]}],
248 | [globalThis?.Intl?.Collator, {"call":[["?locales","?options"]],"construct":[["?locales","?options"]]}],
249 | [globalThis?.Intl?.Collator?.supportedLocalesOf, {"call":[["locales","?options"]],"construct":[]}],
250 | [globalThis?.Intl?.PluralRules, {"call":[["?locales","?options"]],"construct":[["?locales","?options"]]}],
251 | [globalThis?.Intl?.PluralRules?.supportedLocalesOf, {"call":[["locales","?options"]],"construct":[]}],
252 | [globalThis?.Intl?.RelativeTimeFormat, {"call":[],"construct":[["?locales","?options"]]}],
253 | [globalThis?.Intl?.RelativeTimeFormat?.supportedLocalesOf, {"call":[["?locales","?options"]],"construct":[]}],
254 | [globalThis?.Intl?.ListFormat, {"call":[],"construct":[["?locales","?options"]]}],
255 | [globalThis?.Intl?.ListFormat?.prototype?.format, {"call":[["list"]],"construct":[]}],
256 | [globalThis?.Intl?.ListFormat?.prototype?.formatToParts, {"call":[["list"]],"construct":[]}],
257 | [globalThis?.Intl?.ListFormat?.supportedLocalesOf, {"call":[["locales","?options"]],"construct":[]}],
258 | [globalThis?.Intl?.Locale, {"call":[],"construct":[["tag","?options"]]}],
259 | [globalThis?.Intl?.DisplayNames, {"call":[],"construct":[["locales","options"]]}],
260 | [globalThis?.Intl?.DisplayNames?.prototype?.of, {"call":[["code"]],"construct":[]}],
261 | [globalThis?.Intl?.DisplayNames?.supportedLocalesOf, {"call":[["?locales","?options"]],"construct":[]}],
262 | [globalThis?.Intl?.Segmenter, {"call":[],"construct":[["?locales","?options"]]}],
263 | [globalThis?.Intl?.Segmenter?.prototype?.segment, {"call":[["input"]],"construct":[]}],
264 | [globalThis?.Intl?.Segmenter?.supportedLocalesOf, {"call":[["locales","?options"]],"construct":[]}],
265 | [globalThis?.ArrayBuffer, {"call":[],"construct":[["byteLength"]]}],
266 | [globalThis?.ArrayBuffer?.prototype?.slice, {"call":[["begin","?end"]],"construct":[]}],
267 | [globalThis?.ArrayBuffer?.isView, {"call":[["arg"]],"construct":[]}],
268 | [globalThis?.Uint8Array, {"call":[],"construct":[["length"],["array"],["elements"],["buffer","?byteOffset","?length"]]}],
269 | [globalThis?.Int8Array, {"call":[],"construct":[["length"],["array"],["elements"],["buffer","?byteOffset","?length"]]}],
270 | [globalThis?.Uint16Array, {"call":[],"construct":[["length"],["array"],["elements"],["buffer","?byteOffset","?length"]]}],
271 | [globalThis?.Int16Array, {"call":[],"construct":[["length"],["array"],["elements"],["buffer","?byteOffset","?length"]]}],
272 | [globalThis?.Uint32Array, {"call":[],"construct":[["length"],["array"],["elements"],["buffer","?byteOffset","?length"]]}],
273 | [globalThis?.Int32Array, {"call":[],"construct":[["length"],["array"],["elements"],["buffer","?byteOffset","?length"]]}],
274 | [globalThis?.Float32Array, {"call":[],"construct":[["length"],["array"],["elements"],["buffer","?byteOffset","?length"]]}],
275 | [globalThis?.Float64Array, {"call":[],"construct":[["length"],["array"],["elements"],["buffer","?byteOffset","?length"]]}],
276 | [globalThis?.Uint8ClampedArray, {"call":[],"construct":[["length"],["array"],["elements"],["buffer","?byteOffset","?length"]]}],
277 | [globalThis?.BigUint64Array, {"call":[],"construct":[["?length"],["array"],["buffer","?byteOffset","?length"]]}],
278 | [globalThis?.BigInt64Array, {"call":[],"construct":[["?length"],["array"],["buffer","?byteOffset","?length"]]}],
279 | [globalThis?.DataView, {"call":[],"construct":[["buffer","?byteOffset","?byteLength"]]}],
280 | [globalThis?.DataView?.prototype?.getInt8, {"call":[["byteOffset"]],"construct":[]}],
281 | [globalThis?.DataView?.prototype?.setInt8, {"call":[["byteOffset","value"]],"construct":[]}],
282 | [globalThis?.DataView?.prototype?.getUint8, {"call":[["byteOffset"]],"construct":[]}],
283 | [globalThis?.DataView?.prototype?.setUint8, {"call":[["byteOffset","value"]],"construct":[]}],
284 | [globalThis?.DataView?.prototype?.getInt16, {"call":[["byteOffset","?littleEndian"]],"construct":[]}],
285 | [globalThis?.DataView?.prototype?.setInt16, {"call":[["byteOffset","value","?littleEndian"]],"construct":[]}],
286 | [globalThis?.DataView?.prototype?.getUint16, {"call":[["byteOffset","?littleEndian"]],"construct":[]}],
287 | [globalThis?.DataView?.prototype?.setUint16, {"call":[["byteOffset","value","?littleEndian"]],"construct":[]}],
288 | [globalThis?.DataView?.prototype?.getInt32, {"call":[["byteOffset","?littleEndian"]],"construct":[]}],
289 | [globalThis?.DataView?.prototype?.setInt32, {"call":[["byteOffset","value","?littleEndian"]],"construct":[]}],
290 | [globalThis?.DataView?.prototype?.getUint32, {"call":[["byteOffset","?littleEndian"]],"construct":[]}],
291 | [globalThis?.DataView?.prototype?.setUint32, {"call":[["byteOffset","value","?littleEndian"]],"construct":[]}],
292 | [globalThis?.DataView?.prototype?.getFloat32, {"call":[["byteOffset","?littleEndian"]],"construct":[]}],
293 | [globalThis?.DataView?.prototype?.setFloat32, {"call":[["byteOffset","value","?littleEndian"]],"construct":[]}],
294 | [globalThis?.DataView?.prototype?.getFloat64, {"call":[["byteOffset","?littleEndian"]],"construct":[]}],
295 | [globalThis?.DataView?.prototype?.setFloat64, {"call":[["byteOffset","value","?littleEndian"]],"construct":[]}],
296 | [globalThis?.DataView?.prototype?.getBigInt64, {"call":[["byteOffset","?littleEndian"]],"construct":[]}],
297 | [globalThis?.DataView?.prototype?.setBigInt64, {"call":[["byteOffset","value","?littleEndian"]],"construct":[]}],
298 | [globalThis?.DataView?.prototype?.getBigUint64, {"call":[["byteOffset","?littleEndian"]],"construct":[]}],
299 | [globalThis?.DataView?.prototype?.setBigUint64, {"call":[["byteOffset","value","?littleEndian"]],"construct":[]}],
300 | [globalThis?.Map, {"call":[],"construct":[["?entries"],["?iterable"]]}],
301 | [globalThis?.Map?.prototype?.get, {"call":[["key"]],"construct":[]}],
302 | [globalThis?.Map?.prototype?.set, {"call":[["key","value"]],"construct":[]}],
303 | [globalThis?.Map?.prototype?.has, {"call":[["key"]],"construct":[]}],
304 | [globalThis?.Map?.prototype?.delete, {"call":[["key"]],"construct":[]}],
305 | [globalThis?.Map?.prototype?.forEach, {"call":[["callbackfn","?thisArg"]],"construct":[]}],
306 | [globalThis?.BigInt, {"call":[["value"]],"construct":[]}],
307 | [globalThis?.BigInt?.prototype?.toLocaleString, {"call":[["?locales","?options"]],"construct":[]}],
308 | [globalThis?.BigInt?.prototype?.toString, {"call":[["?radix"]],"construct":[]}],
309 | [globalThis?.BigInt?.asUintN, {"call":[["bits","int"]],"construct":[]}],
310 | [globalThis?.BigInt?.asIntN, {"call":[["bits","int"]],"construct":[]}],
311 | [globalThis?.Set, {"call":[],"construct":[["?values"],["?iterable"]]}],
312 | [globalThis?.Set?.prototype?.has, {"call":[["value"]],"construct":[]}],
313 | [globalThis?.Set?.prototype?.add, {"call":[["value"]],"construct":[]}],
314 | [globalThis?.Set?.prototype?.delete, {"call":[["value"]],"construct":[]}],
315 | [globalThis?.Set?.prototype?.forEach, {"call":[["callbackfn","?thisArg"]],"construct":[]}],
316 | [globalThis?.WeakMap, {"call":[],"construct":[["?entries"],["iterable"]]}],
317 | [globalThis?.WeakMap?.prototype?.delete, {"call":[["key"]],"construct":[]}],
318 | [globalThis?.WeakMap?.prototype?.get, {"call":[["key"]],"construct":[]}],
319 | [globalThis?.WeakMap?.prototype?.set, {"call":[["key","value"]],"construct":[]}],
320 | [globalThis?.WeakMap?.prototype?.has, {"call":[["key"]],"construct":[]}],
321 | [globalThis?.WeakSet, {"call":[],"construct":[["?values"],["iterable"]]}],
322 | [globalThis?.WeakSet?.prototype?.delete, {"call":[["value"]],"construct":[]}],
323 | [globalThis?.WeakSet?.prototype?.has, {"call":[["value"]],"construct":[]}],
324 | [globalThis?.WeakSet?.prototype?.add, {"call":[["value"]],"construct":[]}],
325 | [globalThis?.Proxy, {"call":[],"construct":[["target","handler"]]}],
326 | [globalThis?.Proxy?.revocable, {"call":[["target","handler"]],"construct":[]}],
327 | [globalThis?.Reflect?.defineProperty, {"call":[["target","propertyKey","attributes"]],"construct":[]}],
328 | [globalThis?.Reflect?.deleteProperty, {"call":[["target","propertyKey"]],"construct":[]}],
329 | [globalThis?.Reflect?.apply, {"call":[["target","thisArgument","argumentsList"]],"construct":[]}],
330 | [globalThis?.Reflect?.construct, {"call":[["target","argumentsList","?newTarget"]],"construct":[]}],
331 | [globalThis?.Reflect?.get, {"call":[["target","propertyKey","?receiver"]],"construct":[]}],
332 | [globalThis?.Reflect?.getOwnPropertyDescriptor, {"call":[["target","propertyKey"]],"construct":[]}],
333 | [globalThis?.Reflect?.getPrototypeOf, {"call":[["target"]],"construct":[]}],
334 | [globalThis?.Reflect?.has, {"call":[["target","propertyKey"]],"construct":[]}],
335 | [globalThis?.Reflect?.isExtensible, {"call":[["target"]],"construct":[]}],
336 | [globalThis?.Reflect?.ownKeys, {"call":[["target"]],"construct":[]}],
337 | [globalThis?.Reflect?.preventExtensions, {"call":[["target"]],"construct":[]}],
338 | [globalThis?.Reflect?.set, {"call":[["target","propertyKey","value","?receiver"]],"construct":[]}],
339 | [globalThis?.Reflect?.setPrototypeOf, {"call":[["target","proto"]],"construct":[]}],
340 | [globalThis?.FinalizationRegistry, {"call":[],"construct":[["cleanupCallback"]]}],
341 | [globalThis?.FinalizationRegistry?.prototype?.register, {"call":[["target","heldValue","?unregisterToken"]],"construct":[]}],
342 | [globalThis?.FinalizationRegistry?.prototype?.unregister, {"call":[["unregisterToken"]],"construct":[]}],
343 | [globalThis?.WeakRef, {"call":[],"construct":[["target"]]}],
344 | [globalThis?.decodeURI, {"call":[["encodedURI"]],"construct":[]}],
345 | [globalThis?.decodeURIComponent, {"call":[["encodedURIComponent"]],"construct":[]}],
346 | [globalThis?.encodeURI, {"call":[["uri"]],"construct":[]}],
347 | [globalThis?.encodeURIComponent, {"call":[["uriComponent"]],"construct":[]}],
348 | [globalThis?.escape, {"call":[["string"]],"construct":[]}],
349 | [globalThis?.unescape, {"call":[["string"]],"construct":[]}],
350 | [globalThis?.eval, {"call":[["x"]],"construct":[]}],
351 | [globalThis?.isFinite, {"call":[["number"]],"construct":[]}],
352 | [globalThis?.isNaN, {"call":[["number"]],"construct":[]}],
353 | [globalThis?.console?.log, {"call":[["...data"],["?message","...optionalParams"]],"construct":[]}],
354 | [globalThis?.console?.warn, {"call":[["...data"],["?message","...optionalParams"]],"construct":[]}],
355 | [globalThis?.console?.dir, {"call":[["?item","?options"],["obj","?options"]],"construct":[]}],
356 | [globalThis?.console?.time, {"call":[["?label"]],"construct":[]}],
357 | [globalThis?.console?.timeEnd, {"call":[["?label"]],"construct":[]}],
358 | [globalThis?.console?.timeLog, {"call":[["?label","...data"]],"construct":[]}],
359 | [globalThis?.console?.trace, {"call":[["...data"],["?message","...optionalParams"]],"construct":[]}],
360 | [globalThis?.console?.assert, {"call":[["?condition","...data"],["value","?message","...optionalParams"]],"construct":[]}],
361 | [globalThis?.console?.count, {"call":[["?label"]],"construct":[]}],
362 | [globalThis?.console?.countReset, {"call":[["?label"]],"construct":[]}],
363 | [globalThis?.console?.group, {"call":[["...data"],["...label"]],"construct":[]}],
364 | [globalThis?.console?.table, {"call":[["?tabularData","?properties"],["tabularData","?properties"]],"construct":[]}],
365 | [globalThis?.console?.debug, {"call":[["...data"],["?message","...optionalParams"]],"construct":[]}],
366 | [globalThis?.console?.info, {"call":[["...data"],["?message","...optionalParams"]],"construct":[]}],
367 | [globalThis?.console?.dirxml, {"call":[["...data"]],"construct":[]}],
368 | [globalThis?.console?.error, {"call":[["...data"],["?message","...optionalParams"]],"construct":[]}],
369 | [globalThis?.console?.groupCollapsed, {"call":[["...data"],["...label"]],"construct":[]}],
370 | [globalThis?.console?.Console, {"call":[],"construct":[["options"],["stdout","?stderr","?ignoreErrors"]]}],
371 | [globalThis?.console?.Console?.prototype?.log, {"call":[["...data"],["?message","...optionalParams"]],"construct":[]}],
372 | [globalThis?.console?.Console?.prototype?.warn, {"call":[["...data"],["?message","...optionalParams"]],"construct":[]}],
373 | [globalThis?.console?.Console?.prototype?.dir, {"call":[["?item","?options"],["obj","?options"]],"construct":[]}],
374 | [globalThis?.console?.Console?.prototype?.time, {"call":[["?label"]],"construct":[]}],
375 | [globalThis?.console?.Console?.prototype?.timeEnd, {"call":[["?label"]],"construct":[]}],
376 | [globalThis?.console?.Console?.prototype?.timeLog, {"call":[["?label","...data"]],"construct":[]}],
377 | [globalThis?.console?.Console?.prototype?.trace, {"call":[["...data"],["?message","...optionalParams"]],"construct":[]}],
378 | [globalThis?.console?.Console?.prototype?.assert, {"call":[["?condition","...data"],["value","?message","...optionalParams"]],"construct":[]}],
379 | [globalThis?.console?.Console?.prototype?.count, {"call":[["?label"]],"construct":[]}],
380 | [globalThis?.console?.Console?.prototype?.countReset, {"call":[["?label"]],"construct":[]}],
381 | [globalThis?.console?.Console?.prototype?.group, {"call":[["...data"],["...label"]],"construct":[]}],
382 | [globalThis?.console?.Console?.prototype?.table, {"call":[["?tabularData","?properties"],["tabularData","?properties"]],"construct":[]}],
383 | [globalThis?.console?.profile, {"call":[["?label"]],"construct":[]}],
384 | [globalThis?.console?.profileEnd, {"call":[["?label"]],"construct":[]}],
385 | [globalThis?.console?.timeStamp, {"call":[["?label"]],"construct":[]}],
386 | [globalThis?.process?.cpuUsage, {"call":[["?previousValue"]],"construct":[]}],
387 | [globalThis?.process?.kill, {"call":[["pid","?signal"]],"construct":[]}],
388 | [globalThis?.process?.exit, {"call":[["?code"]],"construct":[]}],
389 | [globalThis?.process?.hrtime, {"call":[["?time"]],"construct":[]}],
390 | [globalThis?.process?.setUncaughtExceptionCaptureCallback, {"call":[["cb"]],"construct":[]}],
391 | [globalThis?.process?.emitWarning, {"call":[["warning","?ctor"],["warning","?options"],["warning","?type","?ctor"],["warning","?type","?code","?ctor"]],"construct":[]}],
392 | [globalThis?.process?.nextTick, {"call":[["callback","...args"]],"construct":[]}],
393 | [globalThis?.process?.umask, {"call":[["mask"]],"construct":[]}],
394 | [globalThis?.process?.chdir, {"call":[["directory"]],"construct":[]}],
395 | [globalThis?.process?.report?.writeReport, {"call":[["?fileName"],["?error"],["?fileName","?err"]],"construct":[]}],
396 | [globalThis?.process?.report?.getReport, {"call":[["?err"]],"construct":[]}],
397 | [globalThis?.queueMicrotask, {"call":[["callback"]],"construct":[]}],
398 | [globalThis?.clearImmediate, {"call":[["immediateId"]],"construct":[]}],
399 | [globalThis?.setImmediate, {"call":[["callback"],["callback","...args"]],"construct":[]}],
400 | [globalThis?.structuredClone, {"call":[["value","?options"],["value","?transfer"]],"construct":[]}],
401 | [globalThis?.BroadcastChannel, {"call":[],"construct":[["name"]]}],
402 | [globalThis?.BroadcastChannel?.prototype?.postMessage, {"call":[["message"]],"construct":[]}],
403 | [globalThis?.URL, {"call":[],"construct":[["url","?base"]]}],
404 | [globalThis?.URL?.createObjectURL, {"call":[["obj"]],"construct":[]}],
405 | [globalThis?.URL?.revokeObjectURL, {"call":[["url"]],"construct":[]}],
406 | [globalThis?.URLSearchParams, {"call":[],"construct":[["?init"]]}],
407 | [globalThis?.URLSearchParams?.prototype?.append, {"call":[["name","value"]],"construct":[]}],
408 | [globalThis?.URLSearchParams?.prototype?.delete, {"call":[["name"]],"construct":[]}],
409 | [globalThis?.URLSearchParams?.prototype?.get, {"call":[["name"]],"construct":[]}],
410 | [globalThis?.URLSearchParams?.prototype?.getAll, {"call":[["name"]],"construct":[]}],
411 | [globalThis?.URLSearchParams?.prototype?.has, {"call":[["name"]],"construct":[]}],
412 | [globalThis?.URLSearchParams?.prototype?.set, {"call":[["name","value"]],"construct":[]}],
413 | [globalThis?.URLSearchParams?.prototype?.forEach, {"call":[["callbackfn","?thisArg"]],"construct":[]}],
414 | [globalThis?.DOMException, {"call":[],"construct":[["?message","?name"]]}],
415 | [globalThis?.clearInterval, {"call":[["?id"],["intervalId"]],"construct":[]}],
416 | [globalThis?.clearTimeout, {"call":[["?id"],["timeoutId"]],"construct":[]}],
417 | [globalThis?.setInterval, {"call":[["callback","?ms"],["handler","?timeout","...arguments"],["callback","?ms","...args"]],"construct":[]}],
418 | [globalThis?.setTimeout, {"call":[["callback","?ms"],["handler","?timeout","...arguments"],["callback","?ms","...args"]],"construct":[]}],
419 | [globalThis?.AbortController?.prototype?.abort, {"call":[["?reason"]],"construct":[]}],
420 | [globalThis?.Event, {"call":[],"construct":[["type","?eventInitDict"]]}],
421 | [globalThis?.Event?.prototype?.initEvent, {"call":[["type","?bubbles","?cancelable"]],"construct":[]}],
422 | [globalThis?.EventTarget?.prototype?.addEventListener, {"call":[["type","callback","?options"]],"construct":[]}],
423 | [globalThis?.EventTarget?.prototype?.removeEventListener, {"call":[["type","callback","?options"]],"construct":[]}],
424 | [globalThis?.EventTarget?.prototype?.dispatchEvent, {"call":[["event"]],"construct":[]}],
425 | [globalThis?.MessagePort?.prototype?.postMessage, {"call":[["message","transfer"],["message","?options"]],"construct":[]}],
426 | [globalThis?.MessageEvent, {"call":[],"construct":[["type","?eventInitDict"]]}],
427 | [globalThis?.atob, {"call":[["data"]],"construct":[]}],
428 | [globalThis?.btoa, {"call":[["data"]],"construct":[]}],
429 | [globalThis?.Blob, {"call":[],"construct":[["?blobParts","?options"]]}],
430 | [globalThis?.Blob?.prototype?.slice, {"call":[["?start","?end","?contentType"]],"construct":[]}],
431 | [globalThis?.Performance?.prototype?.clearMarks, {"call":[["?markName"]],"construct":[]}],
432 | [globalThis?.Performance?.prototype?.clearMeasures, {"call":[["?measureName"]],"construct":[]}],
433 | [globalThis?.Performance?.prototype?.getEntriesByName, {"call":[["name","?type"]],"construct":[]}],
434 | [globalThis?.Performance?.prototype?.getEntriesByType, {"call":[["type"]],"construct":[]}],
435 | [globalThis?.Performance?.prototype?.mark, {"call":[["markName","?markOptions"]],"construct":[]}],
436 | [globalThis?.Performance?.prototype?.measure, {"call":[["measureName","?startOrMeasureOptions","?endMark"]],"construct":[]}],
437 | [globalThis?.Performance?.prototype?.setResourceTimingBufferSize, {"call":[["maxSize"]],"construct":[]}],
438 | [globalThis?.PerformanceMark, {"call":[],"construct":[["markName","?markOptions"]]}],
439 | [globalThis?.PerformanceObserver, {"call":[],"construct":[["callback"]]}],
440 | [globalThis?.PerformanceObserver?.prototype?.observe, {"call":[["?options"]],"construct":[]}],
441 | [globalThis?.PerformanceObserverEntryList?.prototype?.getEntriesByType, {"call":[["type"]],"construct":[]}],
442 | [globalThis?.PerformanceObserverEntryList?.prototype?.getEntriesByName, {"call":[["name","?type"]],"construct":[]}],
443 | [globalThis?.TextEncoder?.prototype?.encode, {"call":[["?input"]],"construct":[]}],
444 | [globalThis?.TextEncoder?.prototype?.encodeInto, {"call":[["source","destination"]],"construct":[]}],
445 | [globalThis?.TextDecoder, {"call":[],"construct":[["?label","?options"]]}],
446 | [globalThis?.TextDecoder?.prototype?.decode, {"call":[["?input","?options"]],"construct":[]}],
447 | [globalThis?.TransformStream, {"call":[],"construct":[["?transformer","?writableStrategy","?readableStrategy"]]}],
448 | [globalThis?.TransformStreamDefaultController?.prototype?.enqueue, {"call":[["?chunk"]],"construct":[]}],
449 | [globalThis?.TransformStreamDefaultController?.prototype?.error, {"call":[["?reason"]],"construct":[]}],
450 | [globalThis?.WritableStream, {"call":[],"construct":[["?underlyingSink","?strategy"]]}],
451 | [globalThis?.WritableStream?.prototype?.abort, {"call":[["?reason"]],"construct":[]}],
452 | [globalThis?.WritableStreamDefaultController?.prototype?.error, {"call":[["?e"]],"construct":[]}],
453 | [globalThis?.WritableStreamDefaultWriter, {"call":[],"construct":[["stream"]]}],
454 | [globalThis?.WritableStreamDefaultWriter?.prototype?.abort, {"call":[["?reason"]],"construct":[]}],
455 | [globalThis?.WritableStreamDefaultWriter?.prototype?.write, {"call":[["?chunk"]],"construct":[]}],
456 | [globalThis?.ReadableStream, {"call":[],"construct":[["?underlyingSource","?strategy"]]}],
457 | [globalThis?.ReadableStream?.prototype?.cancel, {"call":[["?reason"]],"construct":[]}],
458 | [globalThis?.ReadableStream?.prototype?.pipeThrough, {"call":[["transform","?options"]],"construct":[]}],
459 | [globalThis?.ReadableStream?.prototype?.pipeTo, {"call":[["destination","?options"]],"construct":[]}],
460 | [globalThis?.ReadableStreamDefaultReader, {"call":[],"construct":[["stream"]]}],
461 | [globalThis?.ReadableStreamDefaultReader?.prototype?.cancel, {"call":[["?reason"]],"construct":[]}],
462 | [globalThis?.ReadableStreamDefaultController?.prototype?.enqueue, {"call":[["?chunk"]],"construct":[]}],
463 | [globalThis?.ReadableStreamDefaultController?.prototype?.error, {"call":[["?e"]],"construct":[]}],
464 | [globalThis?.ByteLengthQueuingStrategy, {"call":[],"construct":[["init"]]}],
465 | [globalThis?.CountQueuingStrategy, {"call":[],"construct":[["init"]]}],
466 | [globalThis?.TextDecoderStream, {"call":[],"construct":[["?label","?options"]]}],
467 | [globalThis?.SharedArrayBuffer, {"call":[],"construct":[["byteLength"]]}],
468 | [globalThis?.SharedArrayBuffer?.prototype?.slice, {"call":[["begin","?end"]],"construct":[]}],
469 | [globalThis?.Atomics?.load, {"call":[["typedArray","index"]],"construct":[]}],
470 | [globalThis?.Atomics?.store, {"call":[["typedArray","index","value"]],"construct":[]}],
471 | [globalThis?.Atomics?.add, {"call":[["typedArray","index","value"]],"construct":[]}],
472 | [globalThis?.Atomics?.sub, {"call":[["typedArray","index","value"]],"construct":[]}],
473 | [globalThis?.Atomics?.and, {"call":[["typedArray","index","value"]],"construct":[]}],
474 | [globalThis?.Atomics?.or, {"call":[["typedArray","index","value"]],"construct":[]}],
475 | [globalThis?.Atomics?.xor, {"call":[["typedArray","index","value"]],"construct":[]}],
476 | [globalThis?.Atomics?.exchange, {"call":[["typedArray","index","value"]],"construct":[]}],
477 | [globalThis?.Atomics?.compareExchange, {"call":[["typedArray","index","expectedValue","replacementValue"]],"construct":[]}],
478 | [globalThis?.Atomics?.isLockFree, {"call":[["size"]],"construct":[]}],
479 | [globalThis?.Atomics?.wait, {"call":[["typedArray","index","value","?timeout"]],"construct":[]}],
480 | [globalThis?.Atomics?.notify, {"call":[["typedArray","index","?count"]],"construct":[]}],
481 | [globalThis?.WebAssembly?.compile, {"call":[["bytes"]],"construct":[]}],
482 | [globalThis?.WebAssembly?.validate, {"call":[["bytes"]],"construct":[]}],
483 | [globalThis?.WebAssembly?.instantiate, {"call":[["bytes","?importObject"],["moduleObject","?importObject"]],"construct":[]}],
484 | [globalThis?.WebAssembly?.compileStreaming, {"call":[["source"]],"construct":[]}],
485 | [globalThis?.WebAssembly?.instantiateStreaming, {"call":[["source","?importObject"]],"construct":[]}],
486 | [globalThis?.WebAssembly?.Module, {"call":[],"construct":[["bytes"]]}],
487 | [globalThis?.WebAssembly?.Module?.imports, {"call":[["moduleObject"]],"construct":[]}],
488 | [globalThis?.WebAssembly?.Module?.exports, {"call":[["moduleObject"]],"construct":[]}],
489 | [globalThis?.WebAssembly?.Module?.customSections, {"call":[["moduleObject","sectionName"]],"construct":[]}],
490 | [globalThis?.WebAssembly?.Instance, {"call":[],"construct":[["module","?importObject"]]}],
491 | [globalThis?.WebAssembly?.Table, {"call":[],"construct":[["descriptor","?value"]]}],
492 | [globalThis?.WebAssembly?.Table?.prototype?.grow, {"call":[["delta","?value"]],"construct":[]}],
493 | [globalThis?.WebAssembly?.Table?.prototype?.set, {"call":[["index","?value"]],"construct":[]}],
494 | [globalThis?.WebAssembly?.Table?.prototype?.get, {"call":[["index"]],"construct":[]}],
495 | [globalThis?.WebAssembly?.Memory, {"call":[],"construct":[["descriptor"]]}],
496 | [globalThis?.WebAssembly?.Memory?.prototype?.grow, {"call":[["delta"]],"construct":[]}],
497 | [globalThis?.WebAssembly?.Global, {"call":[],"construct":[["descriptor","?v"]]}],
498 | [globalThis?.WebAssembly?.CompileError, {"call":[["?message"]],"construct":[["?message"]]}],
499 | [globalThis?.WebAssembly?.LinkError, {"call":[["?message"]],"construct":[["?message"]]}],
500 | [globalThis?.WebAssembly?.RuntimeError, {"call":[["?message"]],"construct":[["?message"]]}],
501 | [globalThis?.Crypto?.prototype?.getRandomValues, {"call":[["array"]],"construct":[]}],
502 | [globalThis?.SubtleCrypto?.prototype?.encrypt, {"call":[["algorithm","key","data"]],"construct":[]}],
503 | [globalThis?.SubtleCrypto?.prototype?.decrypt, {"call":[["algorithm","key","data"]],"construct":[]}],
504 | [globalThis?.SubtleCrypto?.prototype?.sign, {"call":[["algorithm","key","data"]],"construct":[]}],
505 | [globalThis?.SubtleCrypto?.prototype?.verify, {"call":[["algorithm","key","signature","data"]],"construct":[]}],
506 | [globalThis?.SubtleCrypto?.prototype?.digest, {"call":[["algorithm","data"]],"construct":[]}],
507 | [globalThis?.SubtleCrypto?.prototype?.generateKey, {"call":[["algorithm","extractable","keyUsages"]],"construct":[]}],
508 | [globalThis?.SubtleCrypto?.prototype?.deriveKey, {"call":[["algorithm","baseKey","derivedKeyType","extractable","keyUsages"]],"construct":[]}],
509 | [globalThis?.SubtleCrypto?.prototype?.deriveBits, {"call":[["algorithm","baseKey","length"]],"construct":[]}],
510 | [globalThis?.SubtleCrypto?.prototype?.importKey, {"call":[["format","keyData","algorithm","extractable","keyUsages"]],"construct":[]}],
511 | [globalThis?.SubtleCrypto?.prototype?.exportKey, {"call":[["format","key"]],"construct":[]}],
512 | [globalThis?.SubtleCrypto?.prototype?.wrapKey, {"call":[["format","key","wrappingKey","wrapAlgorithm"]],"construct":[]}],
513 | [globalThis?.SubtleCrypto?.prototype?.unwrapKey, {"call":[["format","wrappedKey","unwrappingKey","unwrapAlgorithm","unwrappedKeyAlgorithm","extractable","keyUsages"]],"construct":[]}],
514 | [globalThis?.CustomEvent, {"call":[],"construct":[["type","?eventInitDict"]]}],
515 | [assert, {"call":[["value","?message"]],"construct":[]}],
516 | [assert?.fail, {"call":[["?message"],["actual","expected","?message","?operator","?stackStartFn"]],"construct":[]}],
517 | [assert?.AssertionError, {"call":[],"construct":[["?options"]]}],
518 | [assert?.equal, {"call":[["actual","expected","?message"]],"construct":[]}],
519 | [assert?.notEqual, {"call":[["actual","expected","?message"]],"construct":[]}],
520 | [assert?.deepEqual, {"call":[["actual","expected","?message"]],"construct":[]}],
521 | [assert?.notDeepEqual, {"call":[["actual","expected","?message"]],"construct":[]}],
522 | [assert?.deepStrictEqual, {"call":[["actual","expected","?message"]],"construct":[]}],
523 | [assert?.notDeepStrictEqual, {"call":[["actual","expected","?message"]],"construct":[]}],
524 | [assert?.strictEqual, {"call":[["actual","expected","?message"]],"construct":[]}],
525 | [assert?.notStrictEqual, {"call":[["actual","expected","?message"]],"construct":[]}],
526 | [assert?.throws, {"call":[["block","?message"],["block","error","?message"]],"construct":[]}],
527 | [assert?.rejects, {"call":[["block","?message"],["block","error","?message"]],"construct":[]}],
528 | [assert?.doesNotThrow, {"call":[["block","?message"],["block","error","?message"]],"construct":[]}],
529 | [assert?.doesNotReject, {"call":[["block","?message"],["block","error","?message"]],"construct":[]}],
530 | [assert?.ifError, {"call":[["value"]],"construct":[]}],
531 | [assert?.match, {"call":[["value","regExp","?message"]],"construct":[]}],
532 | [assert?.doesNotMatch, {"call":[["value","regExp","?message"]],"construct":[]}],
533 | [assert?.CallTracker?.prototype?.reset, {"call":[["?fn"]],"construct":[]}],
534 | [assert?.CallTracker?.prototype?.getCalls, {"call":[["fn"]],"construct":[]}],
535 | [assert?.CallTracker?.prototype?.calls, {"call":[["?exact"],["?fn","?exact"]],"construct":[]}],
536 | [assert?.strict, {"call":[["value","?message"]],"construct":[]}],
537 | [async_hooks?.AsyncLocalStorage, {"call":[],"construct":[["?options"]]}],
538 | [async_hooks?.AsyncLocalStorage?.prototype?.enterWith, {"call":[["store"]],"construct":[]}],
539 | [async_hooks?.AsyncLocalStorage?.prototype?.run, {"call":[["store","callback","...args"]],"construct":[]}],
540 | [async_hooks?.AsyncLocalStorage?.prototype?.exit, {"call":[["callback","...args"]],"construct":[]}],
541 | [async_hooks?.createHook, {"call":[["callbacks"]],"construct":[]}],
542 | [async_hooks?.AsyncResource, {"call":[],"construct":[["type","?triggerAsyncId"]]}],
543 | [async_hooks?.AsyncResource?.prototype?.runInAsyncScope, {"call":[["fn","?thisArg","...args"]],"construct":[]}],
544 | [async_hooks?.AsyncResource?.prototype?.bind, {"call":[["fn"]],"construct":[]}],
545 | [async_hooks?.AsyncResource?.bind, {"call":[["fn","?type","?thisArg"]],"construct":[]}],
546 | [buffer?.Buffer, {"call":[],"construct":[["size"],["array"],["arrayBuffer"],["buffer"],["str","?encoding"]]}],
547 | [buffer?.Buffer?.from, {"call":[["data"],["str","?encoding"],["arrayBuffer","?byteOffset","?length"]],"construct":[]}],
548 | [buffer?.Buffer?.of, {"call":[["...items"]],"construct":[]}],
549 | [buffer?.Buffer?.alloc, {"call":[["size","?fill","?encoding"]],"construct":[]}],
550 | [buffer?.Buffer?.allocUnsafe, {"call":[["size"]],"construct":[]}],
551 | [buffer?.Buffer?.allocUnsafeSlow, {"call":[["size"]],"construct":[]}],
552 | [buffer?.Buffer?.isBuffer, {"call":[["obj"]],"construct":[]}],
553 | [buffer?.Buffer?.compare, {"call":[["buf1","buf2"]],"construct":[]}],
554 | [buffer?.Buffer?.isEncoding, {"call":[["encoding"]],"construct":[]}],
555 | [buffer?.Buffer?.concat, {"call":[["list","?totalLength"]],"construct":[]}],
556 | [buffer?.Buffer?.byteLength, {"call":[["string","?encoding"]],"construct":[]}],
557 | [buffer?.SlowBuffer, {"call":[],"construct":[["size"]]}],
558 | [buffer?.transcode, {"call":[["source","fromEnc","toEnc"]],"construct":[]}],
559 | [buffer?.isUtf8, {"call":[["input"]],"construct":[]}],
560 | [buffer?.resolveObjectURL, {"call":[["id"]],"construct":[]}],
561 | [buffer?.File, {"call":[],"construct":[["sources","fileName","?options"]]}],
562 | [child_process?.ChildProcess, {"call":[],"construct":[["?options"]]}],
563 | [child_process?.ChildProcess?.prototype?.kill, {"call":[["?signal"]],"construct":[]}],
564 | [child_process?.exec, {"call":[["command","?callback"],["command","options","?callback"]],"construct":[]}],
565 | [child_process?.execFile, {"call":[["file"],["file","options"],["file","?args"],["file","callback"],["file","args","options"],["file","args","callback"],["file","options","callback"],["file","args","options","callback"]],"construct":[]}],
566 | [child_process?.execFileSync, {"call":[["file"],["file","options"],["file","?options"],["file","args"],["file","args","options"],["file","?args","?options"]],"construct":[]}],
567 | [child_process?.execSync, {"call":[["command"],["command","options"],["command","?options"]],"construct":[]}],
568 | [child_process?.fork, {"call":[["modulePath","?options"],["modulePath","?args","?options"]],"construct":[]}],
569 | [child_process?.spawn, {"call":[["command","?options"],["command","options"],["command","?args","?options"],["command","args","options"]],"construct":[]}],
570 | [child_process?.spawnSync, {"call":[["command"],["command","options"],["command","?options"],["command","args"],["command","args","options"],["command","?args","?options"]],"construct":[]}],
571 | [cluster?.Worker, {"call":[],"construct":[["?options"]]}],
572 | [cluster?.Worker?.prototype?.kill, {"call":[["?signal"]],"construct":[]}],
573 | [cluster?.Worker?.prototype?.send, {"call":[["message","?callback"],["message","sendHandle","?callback"],["message","sendHandle","?options","?callback"]],"construct":[]}],
574 | [cluster?.Worker?.prototype?.destroy, {"call":[["?signal"]],"construct":[]}],
575 | [crypto?.checkPrime, {"call":[["value","callback"],["value","options","callback"]],"construct":[]}],
576 | [crypto?.checkPrimeSync, {"call":[["candidate","?options"]],"construct":[]}],
577 | [crypto?.createCipheriv, {"call":[["algorithm","key","iv","options"],["algorithm","key","iv","?options"]],"construct":[]}],
578 | [crypto?.createDecipheriv, {"call":[["algorithm","key","iv","options"],["algorithm","key","iv","?options"]],"construct":[]}],
579 | [crypto?.createDiffieHellman, {"call":[["primeLength","?generator"],["prime","?generator"],["prime","generator","generatorEncoding"],["prime","primeEncoding","?generator"],["prime","primeEncoding","generator","generatorEncoding"]],"construct":[]}],
580 | [crypto?.createDiffieHellmanGroup, {"call":[["name"]],"construct":[]}],
581 | [crypto?.createECDH, {"call":[["curveName"]],"construct":[]}],
582 | [crypto?.createHash, {"call":[["algorithm","?options"]],"construct":[]}],
583 | [crypto?.createHmac, {"call":[["algorithm","key","?options"]],"construct":[]}],
584 | [crypto?.createPrivateKey, {"call":[["key"]],"construct":[]}],
585 | [crypto?.createPublicKey, {"call":[["key"]],"construct":[]}],
586 | [crypto?.createSecretKey, {"call":[["key"],["key","encoding"]],"construct":[]}],
587 | [crypto?.createSign, {"call":[["algorithm","?options"]],"construct":[]}],
588 | [crypto?.createVerify, {"call":[["algorithm","?options"]],"construct":[]}],
589 | [crypto?.diffieHellman, {"call":[["options"]],"construct":[]}],
590 | [crypto?.generatePrime, {"call":[["size","callback"],["size","options","callback"]],"construct":[]}],
591 | [crypto?.generatePrimeSync, {"call":[["size"],["size","options"]],"construct":[]}],
592 | [crypto?.getCipherInfo, {"call":[["nameOrNid","?options"]],"construct":[]}],
593 | [crypto?.hkdf, {"call":[["digest","irm","salt","info","keylen","callback"]],"construct":[]}],
594 | [crypto?.hkdfSync, {"call":[["digest","ikm","salt","info","keylen"]],"construct":[]}],
595 | [crypto?.pbkdf2, {"call":[["password","salt","iterations","keylen","digest","callback"]],"construct":[]}],
596 | [crypto?.pbkdf2Sync, {"call":[["password","salt","iterations","keylen","digest"]],"construct":[]}],
597 | [crypto?.generateKeyPair, {"call":[["type","options","callback"]],"construct":[]}],
598 | [crypto?.generateKeyPairSync, {"call":[["type","options"],["type","?options"]],"construct":[]}],
599 | [crypto?.generateKey, {"call":[["type","options","callback"]],"construct":[]}],
600 | [crypto?.generateKeySync, {"call":[["type","options"]],"construct":[]}],
601 | [crypto?.privateDecrypt, {"call":[["privateKey","buffer"]],"construct":[]}],
602 | [crypto?.privateEncrypt, {"call":[["privateKey","buffer"]],"construct":[]}],
603 | [crypto?.publicDecrypt, {"call":[["key","buffer"]],"construct":[]}],
604 | [crypto?.publicEncrypt, {"call":[["key","buffer"]],"construct":[]}],
605 | [crypto?.randomBytes, {"call":[["size"],["size","callback"]],"construct":[]}],
606 | [crypto?.randomFill, {"call":[["buffer","callback"],["buffer","offset","callback"],["buffer","offset","size","callback"]],"construct":[]}],
607 | [crypto?.randomFillSync, {"call":[["buffer","?offset","?size"]],"construct":[]}],
608 | [crypto?.randomInt, {"call":[["max"],["min","max"],["max","callback"],["min","max","callback"]],"construct":[]}],
609 | [crypto?.randomUUID, {"call":[["?options"]],"construct":[]}],
610 | [crypto?.scrypt, {"call":[["password","salt","keylen","callback"],["password","salt","keylen","options","callback"]],"construct":[]}],
611 | [crypto?.scryptSync, {"call":[["password","salt","keylen","?options"]],"construct":[]}],
612 | [crypto?.sign, {"call":[["algorithm","data","key"],["algorithm","data","key","callback"]],"construct":[]}],
613 | [crypto?.setEngine, {"call":[["engine","?flags"]],"construct":[]}],
614 | [crypto?.timingSafeEqual, {"call":[["a","b"]],"construct":[]}],
615 | [crypto?.setFips, {"call":[["bool"]],"construct":[]}],
616 | [crypto?.verify, {"call":[["algorithm","data","key","signature"],["algorithm","data","key","signature","callback"]],"construct":[]}],
617 | [crypto?.Certificate?.prototype?.verifySpkac, {"call":[["spkac"]],"construct":[]}],
618 | [crypto?.Certificate?.prototype?.exportPublicKey, {"call":[["spkac","?encoding"]],"construct":[]}],
619 | [crypto?.Certificate?.prototype?.exportChallenge, {"call":[["spkac"]],"construct":[]}],
620 | [crypto?.Cipher?.prototype?.update, {"call":[["data"],["data","inputEncoding"],["data","inputEncoding","outputEncoding"]],"construct":[]}],
621 | [crypto?.Cipher?.prototype?.final, {"call":[["outputEncoding"]],"construct":[]}],
622 | [crypto?.Cipher?.prototype?.setAutoPadding, {"call":[["?autoPadding"]],"construct":[]}],
623 | [crypto?.DiffieHellman?.prototype?.generateKeys, {"call":[["encoding"]],"construct":[]}],
624 | [crypto?.DiffieHellman?.prototype?.computeSecret, {"call":[["otherPublicKey","?inputEncoding","?outputEncoding"],["otherPublicKey","inputEncoding","?outputEncoding"],["otherPublicKey","inputEncoding","outputEncoding"]],"construct":[]}],
625 | [crypto?.DiffieHellman?.prototype?.getPrime, {"call":[["encoding"]],"construct":[]}],
626 | [crypto?.DiffieHellman?.prototype?.getGenerator, {"call":[["encoding"]],"construct":[]}],
627 | [crypto?.DiffieHellman?.prototype?.getPublicKey, {"call":[["encoding"]],"construct":[]}],
628 | [crypto?.DiffieHellman?.prototype?.getPrivateKey, {"call":[["encoding"]],"construct":[]}],
629 | [crypto?.DiffieHellman?.prototype?.setPublicKey, {"call":[["publicKey"],["publicKey","encoding"]],"construct":[]}],
630 | [crypto?.DiffieHellman?.prototype?.setPrivateKey, {"call":[["privateKey"],["privateKey","encoding"]],"construct":[]}],
631 | [crypto?.DiffieHellmanGroup, {"call":[["name"]],"construct":[["name"]]}],
632 | [crypto?.ECDH?.prototype?.generateKeys, {"call":[["encoding","?format"]],"construct":[]}],
633 | [crypto?.ECDH?.prototype?.getPublicKey, {"call":[["?encoding","?format"],["encoding","?format"]],"construct":[]}],
634 | [crypto?.ECDH?.convertKey, {"call":[["key","curve","?inputEncoding","?outputEncoding","?format"]],"construct":[]}],
635 | [crypto?.Hash?.prototype?.copy, {"call":[["?options"]],"construct":[]}],
636 | [crypto?.Hash?.prototype?.update, {"call":[["data"],["data","inputEncoding"]],"construct":[]}],
637 | [crypto?.Hash?.prototype?.digest, {"call":[["encoding"]],"construct":[]}],
638 | [crypto?.Hmac?.prototype?.digest, {"call":[["encoding"]],"construct":[]}],
639 | [crypto?.KeyObject?.from, {"call":[["key"]],"construct":[]}],
640 | [crypto?.Sign?.prototype?.update, {"call":[["data"],["data","inputEncoding"]],"construct":[]}],
641 | [crypto?.Sign?.prototype?.sign, {"call":[["privateKey"],["privateKey","outputFormat"]],"construct":[]}],
642 | [crypto?.Verify?.prototype?.verify, {"call":[["object","signature"],["object","signature","?signature_format"]],"construct":[]}],
643 | [crypto?.X509Certificate, {"call":[],"construct":[["buffer"]]}],
644 | [crypto?.X509Certificate?.prototype?.checkHost, {"call":[["name","?options"]],"construct":[]}],
645 | [crypto?.X509Certificate?.prototype?.checkEmail, {"call":[["email","?options"]],"construct":[]}],
646 | [crypto?.X509Certificate?.prototype?.checkIP, {"call":[["ip"]],"construct":[]}],
647 | [crypto?.X509Certificate?.prototype?.checkIssued, {"call":[["otherCert"]],"construct":[]}],
648 | [crypto?.X509Certificate?.prototype?.checkPrivateKey, {"call":[["privateKey"]],"construct":[]}],
649 | [crypto?.X509Certificate?.prototype?.verify, {"call":[["publicKey"]],"construct":[]}],
650 | [crypto?.createCipher, {"call":[["algorithm","password","options"],["algorithm","password","?options"]],"construct":[]}],
651 | [crypto?.createDecipher, {"call":[["algorithm","password","options"],["algorithm","password","?options"]],"construct":[]}],
652 | [crypto?.getRandomValues, {"call":[["typedArray"]],"construct":[]}],
653 | [dgram?.createSocket, {"call":[["type","?callback"],["options","?callback"]],"construct":[]}],
654 | [dgram?.Socket, {"call":[],"construct":[["?options"]]}],
655 | [dgram?.Socket?.prototype?.bind, {"call":[["?callback"],["?port","?callback"],["options","?callback"],["?port","?address","?callback"]],"construct":[]}],
656 | [dgram?.Socket?.prototype?.connect, {"call":[["port","callback"],["port","?address","?callback"]],"construct":[]}],
657 | [dgram?.Socket?.prototype?.send, {"call":[["msg","?callback"],["msg","?port","?callback"],["msg","?port","?address","?callback"],["msg","offset","length","?callback"],["msg","offset","length","?port","?callback"],["msg","offset","length","?port","?address","?callback"]],"construct":[]}],
658 | [dgram?.Socket?.prototype?.close, {"call":[["?callback"]],"construct":[]}],
659 | [dgram?.Socket?.prototype?.setBroadcast, {"call":[["flag"]],"construct":[]}],
660 | [dgram?.Socket?.prototype?.setTTL, {"call":[["ttl"]],"construct":[]}],
661 | [dgram?.Socket?.prototype?.setMulticastTTL, {"call":[["ttl"]],"construct":[]}],
662 | [dgram?.Socket?.prototype?.setMulticastLoopback, {"call":[["flag"]],"construct":[]}],
663 | [dgram?.Socket?.prototype?.setMulticastInterface, {"call":[["multicastInterface"]],"construct":[]}],
664 | [dgram?.Socket?.prototype?.addMembership, {"call":[["multicastAddress","?multicastInterface"]],"construct":[]}],
665 | [dgram?.Socket?.prototype?.dropMembership, {"call":[["multicastAddress","?multicastInterface"]],"construct":[]}],
666 | [dgram?.Socket?.prototype?.addSourceSpecificMembership, {"call":[["sourceAddress","groupAddress","?multicastInterface"]],"construct":[]}],
667 | [dgram?.Socket?.prototype?.dropSourceSpecificMembership, {"call":[["sourceAddress","groupAddress","?multicastInterface"]],"construct":[]}],
668 | [dgram?.Socket?.prototype?.setRecvBufferSize, {"call":[["size"]],"construct":[]}],
669 | [dgram?.Socket?.prototype?.setSendBufferSize, {"call":[["size"]],"construct":[]}],
670 | [diagnostics_channel?.channel, {"call":[["name"]],"construct":[]}],
671 | [diagnostics_channel?.hasSubscribers, {"call":[["name"]],"construct":[]}],
672 | [diagnostics_channel?.Channel, {"call":[],"construct":[["name"]]}],
673 | [diagnostics_channel?.Channel?.prototype?.subscribe, {"call":[["onMessage"]],"construct":[]}],
674 | [diagnostics_channel?.Channel?.prototype?.unsubscribe, {"call":[["onMessage"]],"construct":[]}],
675 | [diagnostics_channel?.Channel?.prototype?.publish, {"call":[["message"]],"construct":[]}],
676 | [dns?.lookup, {"call":[["hostname","callback"],["hostname","family","callback"],["hostname","options","callback"]],"construct":[]}],
677 | [dns?.lookupService, {"call":[["address","port","callback"]],"construct":[]}],
678 | [dns?.Resolver, {"call":[],"construct":[["?options"]]}],
679 | [dns?.Resolver?.prototype?.resolveAny, {"call":[["hostname","callback"]],"construct":[]}],
680 | [dns?.Resolver?.prototype?.resolve4, {"call":[["hostname","callback"],["hostname","options","callback"]],"construct":[]}],
681 | [dns?.Resolver?.prototype?.resolve6, {"call":[["hostname","callback"],["hostname","options","callback"]],"construct":[]}],
682 | [dns?.Resolver?.prototype?.resolveCname, {"call":[["hostname","callback"]],"construct":[]}],
683 | [dns?.Resolver?.prototype?.resolveMx, {"call":[["hostname","callback"]],"construct":[]}],
684 | [dns?.Resolver?.prototype?.resolveNs, {"call":[["hostname","callback"]],"construct":[]}],
685 | [dns?.Resolver?.prototype?.resolveTxt, {"call":[["hostname","callback"]],"construct":[]}],
686 | [dns?.Resolver?.prototype?.resolveSrv, {"call":[["hostname","callback"]],"construct":[]}],
687 | [dns?.Resolver?.prototype?.resolvePtr, {"call":[["hostname","callback"]],"construct":[]}],
688 | [dns?.Resolver?.prototype?.resolveNaptr, {"call":[["hostname","callback"]],"construct":[]}],
689 | [dns?.Resolver?.prototype?.resolveSoa, {"call":[["hostname","callback"]],"construct":[]}],
690 | [dns?.Resolver?.prototype?.reverse, {"call":[["ip","callback"]],"construct":[]}],
691 | [dns?.Resolver?.prototype?.resolve, {"call":[["hostname","callback"],["hostname","rrtype","callback"]],"construct":[]}],
692 | [dns?.setDefaultResultOrder, {"call":[["order"]],"construct":[]}],
693 | [dns?.setServers, {"call":[["servers"]],"construct":[]}],
694 | [dns?.resolve, {"call":[["hostname","callback"],["hostname","rrtype","callback"]],"construct":[]}],
695 | [dns?.resolve4, {"call":[["hostname","callback"],["hostname","options","callback"]],"construct":[]}],
696 | [dns?.resolve6, {"call":[["hostname","callback"],["hostname","options","callback"]],"construct":[]}],
697 | [dns?.resolveAny, {"call":[["hostname","callback"]],"construct":[]}],
698 | [dns?.resolveCaa, {"call":[["hostname","callback"]],"construct":[]}],
699 | [dns?.resolveCname, {"call":[["hostname","callback"]],"construct":[]}],
700 | [dns?.resolveMx, {"call":[["hostname","callback"]],"construct":[]}],
701 | [dns?.resolveNaptr, {"call":[["hostname","callback"]],"construct":[]}],
702 | [dns?.resolveNs, {"call":[["hostname","callback"]],"construct":[]}],
703 | [dns?.resolvePtr, {"call":[["hostname","callback"]],"construct":[]}],
704 | [dns?.resolveSoa, {"call":[["hostname","callback"]],"construct":[]}],
705 | [dns?.resolveSrv, {"call":[["hostname","callback"]],"construct":[]}],
706 | [dns?.resolveTxt, {"call":[["hostname","callback"]],"construct":[]}],
707 | [dns?.reverse, {"call":[["ip","callback"]],"construct":[]}],
708 | [dns?.promises?.lookup, {"call":[["hostname"],["hostname","family"],["hostname","options"]],"construct":[]}],
709 | [dns?.promises?.lookupService, {"call":[["address","port"]],"construct":[]}],
710 | [dns?.promises?.Resolver, {"call":[],"construct":[["?options"]]}],
711 | [dns?.promises?.Resolver?.prototype?.resolveAny, {"call":[["hostname"]],"construct":[]}],
712 | [dns?.promises?.Resolver?.prototype?.resolve4, {"call":[["hostname"],["hostname","options"]],"construct":[]}],
713 | [dns?.promises?.Resolver?.prototype?.resolve6, {"call":[["hostname"],["hostname","options"]],"construct":[]}],
714 | [dns?.promises?.Resolver?.prototype?.resolveCname, {"call":[["hostname"]],"construct":[]}],
715 | [dns?.promises?.Resolver?.prototype?.resolveMx, {"call":[["hostname"]],"construct":[]}],
716 | [dns?.promises?.Resolver?.prototype?.resolveNs, {"call":[["hostname"]],"construct":[]}],
717 | [dns?.promises?.Resolver?.prototype?.resolveTxt, {"call":[["hostname"]],"construct":[]}],
718 | [dns?.promises?.Resolver?.prototype?.resolveSrv, {"call":[["hostname"]],"construct":[]}],
719 | [dns?.promises?.Resolver?.prototype?.resolvePtr, {"call":[["hostname"]],"construct":[]}],
720 | [dns?.promises?.Resolver?.prototype?.resolveNaptr, {"call":[["hostname"]],"construct":[]}],
721 | [dns?.promises?.Resolver?.prototype?.resolveSoa, {"call":[["hostname"]],"construct":[]}],
722 | [dns?.promises?.Resolver?.prototype?.reverse, {"call":[["ip"]],"construct":[]}],
723 | [dns?.promises?.Resolver?.prototype?.resolve, {"call":[["hostname"],["hostname","rrtype"]],"construct":[]}],
724 | [dns?.promises?.setServers, {"call":[["servers"]],"construct":[]}],
725 | [dns?.promises?.resolve, {"call":[["hostname"],["hostname","rrtype"]],"construct":[]}],
726 | [dns?.promises?.resolve4, {"call":[["hostname"],["hostname","options"]],"construct":[]}],
727 | [dns?.promises?.resolve6, {"call":[["hostname"],["hostname","options"]],"construct":[]}],
728 | [dns?.promises?.resolveAny, {"call":[["hostname"]],"construct":[]}],
729 | [dns?.promises?.resolveCaa, {"call":[["hostname"]],"construct":[]}],
730 | [dns?.promises?.resolveCname, {"call":[["hostname"]],"construct":[]}],
731 | [dns?.promises?.resolveMx, {"call":[["hostname"]],"construct":[]}],
732 | [dns?.promises?.resolveNaptr, {"call":[["hostname"]],"construct":[]}],
733 | [dns?.promises?.resolveNs, {"call":[["hostname"]],"construct":[]}],
734 | [dns?.promises?.resolvePtr, {"call":[["hostname"]],"construct":[]}],
735 | [dns?.promises?.resolveSoa, {"call":[["hostname"]],"construct":[]}],
736 | [dns?.promises?.resolveSrv, {"call":[["hostname"]],"construct":[]}],
737 | [dns?.promises?.resolveTxt, {"call":[["hostname"]],"construct":[]}],
738 | [dns?.promises?.reverse, {"call":[["ip"]],"construct":[]}],
739 | [events, {"call":[],"construct":[["?options"]]}],
740 | [events?.prototype?.setMaxListeners, {"call":[["n"]],"construct":[]}],
741 | [events?.prototype?.emit, {"call":[["eventName","...args"]],"construct":[]}],
742 | [events?.prototype?.addListener, {"call":[["eventName","listener"]],"construct":[]}],
743 | [events?.prototype?.prependListener, {"call":[["eventName","listener"]],"construct":[]}],
744 | [events?.prototype?.once, {"call":[["eventName","listener"]],"construct":[]}],
745 | [events?.prototype?.prependOnceListener, {"call":[["eventName","listener"]],"construct":[]}],
746 | [events?.prototype?.removeListener, {"call":[["eventName","listener"]],"construct":[]}],
747 | [events?.prototype?.removeAllListeners, {"call":[["?event"]],"construct":[]}],
748 | [events?.prototype?.listeners, {"call":[["eventName"]],"construct":[]}],
749 | [events?.prototype?.rawListeners, {"call":[["eventName"]],"construct":[]}],
750 | [events?.prototype?.listenerCount, {"call":[["eventName"]],"construct":[]}],
751 | [events?.once, {"call":[["emitter","eventName","?options"]],"construct":[]}],
752 | [events?.on, {"call":[["emitter","eventName","?options"]],"construct":[]}],
753 | [events?.getEventListeners, {"call":[["emitter","name"]],"construct":[]}],
754 | [events?.setMaxListeners, {"call":[["?n","...eventTargets"]],"construct":[]}],
755 | [events?.listenerCount, {"call":[["emitter","eventName"]],"construct":[]}],
756 | [fs?.appendFile, {"call":[["file","data","callback"],["path","data","options","callback"]],"construct":[]}],
757 | [fs?.appendFileSync, {"call":[["path","data","?options"]],"construct":[]}],
758 | [fs?.access, {"call":[["path","callback"],["path","mode","callback"]],"construct":[]}],
759 | [fs?.accessSync, {"call":[["path","?mode"]],"construct":[]}],
760 | [fs?.chown, {"call":[["path","uid","gid","callback"]],"construct":[]}],
761 | [fs?.chownSync, {"call":[["path","uid","gid"]],"construct":[]}],
762 | [fs?.chmod, {"call":[["path","mode","callback"]],"construct":[]}],
763 | [fs?.chmodSync, {"call":[["path","mode"]],"construct":[]}],
764 | [fs?.close, {"call":[["fd","?callback"]],"construct":[]}],
765 | [fs?.closeSync, {"call":[["fd"]],"construct":[]}],
766 | [fs?.copyFile, {"call":[["src","dest","callback"],["src","dest","mode","callback"]],"construct":[]}],
767 | [fs?.copyFileSync, {"call":[["src","dest","?mode"]],"construct":[]}],
768 | [fs?.cp, {"call":[["source","destination","callback"],["source","destination","opts","callback"]],"construct":[]}],
769 | [fs?.cpSync, {"call":[["source","destination","?opts"]],"construct":[]}],
770 | [fs?.createReadStream, {"call":[["path","?options"]],"construct":[]}],
771 | [fs?.createWriteStream, {"call":[["path","?options"]],"construct":[]}],
772 | [fs?.exists, {"call":[["path","callback"]],"construct":[]}],
773 | [fs?.existsSync, {"call":[["path"]],"construct":[]}],
774 | [fs?.fchown, {"call":[["fd","uid","gid","callback"]],"construct":[]}],
775 | [fs?.fchownSync, {"call":[["fd","uid","gid"]],"construct":[]}],
776 | [fs?.fchmod, {"call":[["fd","mode","callback"]],"construct":[]}],
777 | [fs?.fchmodSync, {"call":[["fd","mode"]],"construct":[]}],
778 | [fs?.fdatasync, {"call":[["fd","callback"]],"construct":[]}],
779 | [fs?.fdatasyncSync, {"call":[["fd"]],"construct":[]}],
780 | [fs?.fstat, {"call":[["fd","callback"],["fd","options","callback"]],"construct":[]}],
781 | [fs?.fstatSync, {"call":[["fd","?options"],["fd","options"]],"construct":[]}],
782 | [fs?.fsync, {"call":[["fd","callback"]],"construct":[]}],
783 | [fs?.fsyncSync, {"call":[["fd"]],"construct":[]}],
784 | [fs?.ftruncate, {"call":[["fd","callback"],["fd","len","callback"]],"construct":[]}],
785 | [fs?.ftruncateSync, {"call":[["fd","?len"]],"construct":[]}],
786 | [fs?.futimes, {"call":[["fd","atime","mtime","callback"]],"construct":[]}],
787 | [fs?.futimesSync, {"call":[["fd","atime","mtime"]],"construct":[]}],
788 | [fs?.lchown, {"call":[["path","uid","gid","callback"]],"construct":[]}],
789 | [fs?.lchownSync, {"call":[["path","uid","gid"]],"construct":[]}],
790 | [fs?.link, {"call":[["existingPath","newPath","callback"]],"construct":[]}],
791 | [fs?.linkSync, {"call":[["existingPath","newPath"]],"construct":[]}],
792 | [fs?.lstat, {"call":[["path","callback"],["path","options","callback"]],"construct":[]}],
793 | [fs?.lstatSync, {"call":[["path","?options"],["path","options"]],"construct":[]}],
794 | [fs?.lutimes, {"call":[["path","atime","mtime","callback"]],"construct":[]}],
795 | [fs?.lutimesSync, {"call":[["path","atime","mtime"]],"construct":[]}],
796 | [fs?.mkdir, {"call":[["path","callback"],["path","options","callback"]],"construct":[]}],
797 | [fs?.mkdirSync, {"call":[["path","options"],["path","?options"]],"construct":[]}],
798 | [fs?.mkdtemp, {"call":[["prefix","callback"],["prefix","options","callback"]],"construct":[]}],
799 | [fs?.mkdtempSync, {"call":[["prefix","?options"],["prefix","options"]],"construct":[]}],
800 | [fs?.open, {"call":[["path","callback"],["path","flags","callback"],["path","flags","mode","callback"]],"construct":[]}],
801 | [fs?.openSync, {"call":[["path","flags","?mode"]],"construct":[]}],
802 | [fs?.readdir, {"call":[["path","callback"],["path","options","callback"]],"construct":[]}],
803 | [fs?.readdirSync, {"call":[["path","?options"],["path","options"]],"construct":[]}],
804 | [fs?.read, {"call":[["fd","callback"],["fd","options","callback"],["fd","buffer","offset","length","position","callback"]],"construct":[]}],
805 | [fs?.readSync, {"call":[["fd","buffer","?opts"],["fd","buffer","offset","length","position"]],"construct":[]}],
806 | [fs?.readv, {"call":[["fd","buffers","cb"],["fd","buffers","position","cb"]],"construct":[]}],
807 | [fs?.readvSync, {"call":[["fd","buffers","?position"]],"construct":[]}],
808 | [fs?.readFile, {"call":[["path","callback"],["path","options","callback"]],"construct":[]}],
809 | [fs?.readFileSync, {"call":[["path","?options"],["path","options"]],"construct":[]}],
810 | [fs?.readlink, {"call":[["path","callback"],["path","options","callback"]],"construct":[]}],
811 | [fs?.readlinkSync, {"call":[["path","?options"],["path","options"]],"construct":[]}],
812 | [fs?.realpath, {"call":[["path","callback"],["path","options","callback"]],"construct":[]}],
813 | [fs?.realpath?.native, {"call":[["path","callback"],["path","options","callback"]],"construct":[]}],
814 | [fs?.realpathSync, {"call":[["path","?options"],["path","options"]],"construct":[]}],
815 | [fs?.realpathSync?.native, {"call":[["path","?options"],["path","options"]],"construct":[]}],
816 | [fs?.rename, {"call":[["oldPath","newPath","callback"]],"construct":[]}],
817 | [fs?.renameSync, {"call":[["oldPath","newPath"]],"construct":[]}],
818 | [fs?.rm, {"call":[["path","callback"],["path","options","callback"]],"construct":[]}],
819 | [fs?.rmSync, {"call":[["path","?options"]],"construct":[]}],
820 | [fs?.rmdir, {"call":[["path","callback"],["path","options","callback"]],"construct":[]}],
821 | [fs?.rmdirSync, {"call":[["path","?options"]],"construct":[]}],
822 | [fs?.stat, {"call":[["path","callback"],["path","options","callback"]],"construct":[]}],
823 | [fs?.statSync, {"call":[["path","?options"],["path","options"]],"construct":[]}],
824 | [fs?.symlink, {"call":[["target","path","callback"],["target","path","type","callback"]],"construct":[]}],
825 | [fs?.symlinkSync, {"call":[["target","path","?type"]],"construct":[]}],
826 | [fs?.truncate, {"call":[["path","callback"],["path","len","callback"]],"construct":[]}],
827 | [fs?.truncateSync, {"call":[["path","?len"]],"construct":[]}],
828 | [fs?.unwatchFile, {"call":[["filename","?listener"]],"construct":[]}],
829 | [fs?.unlink, {"call":[["path","callback"]],"construct":[]}],
830 | [fs?.unlinkSync, {"call":[["path"]],"construct":[]}],
831 | [fs?.utimes, {"call":[["path","atime","mtime","callback"]],"construct":[]}],
832 | [fs?.utimesSync, {"call":[["path","atime","mtime"]],"construct":[]}],
833 | [fs?.watch, {"call":[["filename","?listener"],["filename","options","?listener"],["filename","?options","?listener"]],"construct":[]}],
834 | [fs?.watchFile, {"call":[["filename","listener"],["filename","options","listener"]],"construct":[]}],
835 | [fs?.writeFile, {"call":[["path","data","callback"],["file","data","options","callback"]],"construct":[]}],
836 | [fs?.writeFileSync, {"call":[["file","data","?options"]],"construct":[]}],
837 | [fs?.write, {"call":[["fd","buffer","callback"],["fd","string","callback"],["fd","buffer","offset","callback"],["fd","string","position","callback"],["fd","buffer","offset","length","callback"],["fd","string","position","encoding","callback"],["fd","buffer","offset","length","position","callback"]],"construct":[]}],
838 | [fs?.writeSync, {"call":[["fd","string","?position","?encoding"],["fd","buffer","?offset","?length","?position"]],"construct":[]}],
839 | [fs?.writev, {"call":[["fd","buffers","cb"],["fd","buffers","position","cb"]],"construct":[]}],
840 | [fs?.writevSync, {"call":[["fd","buffers","?position"]],"construct":[]}],
841 | [fs?.ReadStream, {"call":[],"construct":[["?opts"]]}],
842 | [fs?.ReadStream?.prototype?.close, {"call":[["?callback"]],"construct":[]}],
843 | [fs?.WriteStream, {"call":[],"construct":[["?opts"]]}],
844 | [fs?.WriteStream?.prototype?.close, {"call":[["?callback"]],"construct":[]}],
845 | [fs?.Dir?.prototype?.read, {"call":[["cb"]],"construct":[]}],
846 | [fs?.Dir?.prototype?.close, {"call":[["cb"]],"construct":[]}],
847 | [fs?.opendir, {"call":[["path","cb"],["path","options","cb"]],"construct":[]}],
848 | [fs?.opendirSync, {"call":[["path","?options"]],"construct":[]}],
849 | [fs?.promises?.access, {"call":[["path","?mode"]],"construct":[]}],
850 | [fs?.promises?.copyFile, {"call":[["src","dest","?mode"]],"construct":[]}],
851 | [fs?.promises?.cp, {"call":[["source","destination","?opts"]],"construct":[]}],
852 | [fs?.promises?.open, {"call":[["path","?flags","?mode"]],"construct":[]}],
853 | [fs?.promises?.opendir, {"call":[["path","?options"]],"construct":[]}],
854 | [fs?.promises?.rename, {"call":[["oldPath","newPath"]],"construct":[]}],
855 | [fs?.promises?.truncate, {"call":[["path","?len"]],"construct":[]}],
856 | [fs?.promises?.rm, {"call":[["path","?options"]],"construct":[]}],
857 | [fs?.promises?.rmdir, {"call":[["path","?options"]],"construct":[]}],
858 | [fs?.promises?.mkdir, {"call":[["path","options"],["path","?options"]],"construct":[]}],
859 | [fs?.promises?.readdir, {"call":[["path","?options"],["path","options"]],"construct":[]}],
860 | [fs?.promises?.readlink, {"call":[["path","?options"],["path","options"]],"construct":[]}],
861 | [fs?.promises?.symlink, {"call":[["target","path","?type"]],"construct":[]}],
862 | [fs?.promises?.lstat, {"call":[["path","?opts"],["path","opts"]],"construct":[]}],
863 | [fs?.promises?.stat, {"call":[["path","?opts"],["path","opts"]],"construct":[]}],
864 | [fs?.promises?.link, {"call":[["existingPath","newPath"]],"construct":[]}],
865 | [fs?.promises?.unlink, {"call":[["path"]],"construct":[]}],
866 | [fs?.promises?.chmod, {"call":[["path","mode"]],"construct":[]}],
867 | [fs?.promises?.lchmod, {"call":[["path","mode"]],"construct":[]}],
868 | [fs?.promises?.lchown, {"call":[["path","uid","gid"]],"construct":[]}],
869 | [fs?.promises?.chown, {"call":[["path","uid","gid"]],"construct":[]}],
870 | [fs?.promises?.utimes, {"call":[["path","atime","mtime"]],"construct":[]}],
871 | [fs?.promises?.lutimes, {"call":[["path","atime","mtime"]],"construct":[]}],
872 | [fs?.promises?.realpath, {"call":[["path","?options"],["path","options"]],"construct":[]}],
873 | [fs?.promises?.mkdtemp, {"call":[["prefix","?options"],["prefix","options"]],"construct":[]}],
874 | [fs?.promises?.writeFile, {"call":[["file","data","?options"]],"construct":[]}],
875 | [fs?.promises?.appendFile, {"call":[["path","data","?options"]],"construct":[]}],
876 | [fs?.promises?.readFile, {"call":[["path","?options"],["path","options"]],"construct":[]}],
877 | [fs?.promises?.watch, {"call":[["filename","options"],["filename","?options"]],"construct":[]}],
878 | [http?.Agent, {"call":[],"construct":[["?opts"]]}],
879 | [http?.ClientRequest, {"call":[],"construct":[["url","?cb"]]}],
880 | [http?.ClientRequest?.prototype?.destroy, {"call":[["?error"]],"construct":[]}],
881 | [http?.ClientRequest?.prototype?.onSocket, {"call":[["socket"]],"construct":[]}],
882 | [http?.ClientRequest?.prototype?.setTimeout, {"call":[["timeout","?callback"]],"construct":[]}],
883 | [http?.ClientRequest?.prototype?.setNoDelay, {"call":[["?noDelay"]],"construct":[]}],
884 | [http?.ClientRequest?.prototype?.setSocketKeepAlive, {"call":[["?enable","?initialDelay"]],"construct":[]}],
885 | [http?.IncomingMessage, {"call":[],"construct":[["socket"]]}],
886 | [http?.IncomingMessage?.prototype?.setTimeout, {"call":[["msecs","?callback"]],"construct":[]}],
887 | [http?.OutgoingMessage?.prototype?.setTimeout, {"call":[["msecs","?callback"]],"construct":[]}],
888 | [http?.OutgoingMessage?.prototype?.destroy, {"call":[["?error"]],"construct":[]}],
889 | [http?.OutgoingMessage?.prototype?.setHeader, {"call":[["name","value"]],"construct":[]}],
890 | [http?.OutgoingMessage?.prototype?.getHeader, {"call":[["name"]],"construct":[]}],
891 | [http?.OutgoingMessage?.prototype?.hasHeader, {"call":[["name"]],"construct":[]}],
892 | [http?.OutgoingMessage?.prototype?.removeHeader, {"call":[["name"]],"construct":[]}],
893 | [http?.OutgoingMessage?.prototype?.write, {"call":[["chunk","?callback"],["chunk","encoding","?callback"]],"construct":[]}],
894 | [http?.OutgoingMessage?.prototype?.addTrailers, {"call":[["headers"]],"construct":[]}],
895 | [http?.OutgoingMessage?.prototype?.end, {"call":[["?cb"],["chunk","?cb"],["chunk","encoding","?cb"]],"construct":[]}],
896 | [http?.OutgoingMessage?.prototype?.pipe, {"call":[["destination","?options"]],"construct":[]}],
897 | [http?.Server, {"call":[],"construct":[["?requestListener"],["options","?requestListener"]]}],
898 | [http?.Server?.prototype?.close, {"call":[["?callback"]],"construct":[]}],
899 | [http?.Server?.prototype?.setTimeout, {"call":[["callback"],["?msecs","?callback"]],"construct":[]}],
900 | [http?.ServerResponse, {"call":[],"construct":[["req"]]}],
901 | [http?.ServerResponse?.prototype?.assignSocket, {"call":[["socket"]],"construct":[]}],
902 | [http?.ServerResponse?.prototype?.detachSocket, {"call":[["socket"]],"construct":[]}],
903 | [http?.ServerResponse?.prototype?.writeContinue, {"call":[["?callback"]],"construct":[]}],
904 | [http?.ServerResponse?.prototype?.writeEarlyHints, {"call":[["hints","?callback"]],"construct":[]}],
905 | [http?.ServerResponse?.prototype?.writeHead, {"call":[["statusCode","?headers"],["statusCode","?statusMessage","?headers"]],"construct":[]}],
906 | [http?.createServer, {"call":[["?requestListener"],["options","?requestListener"]],"construct":[]}],
907 | [http?.validateHeaderName, {"call":[["name"]],"construct":[]}],
908 | [http?.validateHeaderValue, {"call":[["name","value"]],"construct":[]}],
909 | [http?.get, {"call":[["options","?callback"],["url","options","?callback"]],"construct":[]}],
910 | [http?.request, {"call":[["options","?callback"],["url","options","?callback"]],"construct":[]}],
911 | [http?.setMaxIdleHTTPParsers, {"call":[["count"]],"construct":[]}],
912 | [http2?.connect, {"call":[["authority","listener"],["authority","?options","?listener"]],"construct":[]}],
913 | [http2?.createServer, {"call":[["?onRequestHandler"],["options","?onRequestHandler"]],"construct":[]}],
914 | [http2?.createSecureServer, {"call":[["?onRequestHandler"],["options","?onRequestHandler"]],"construct":[]}],
915 | [http2?.getPackedSettings, {"call":[["settings"]],"construct":[]}],
916 | [http2?.getUnpackedSettings, {"call":[["buf"]],"construct":[]}],
917 | [http2?.Http2ServerRequest, {"call":[],"construct":[["stream","headers","options","rawHeaders"]]}],
918 | [http2?.Http2ServerRequest?.prototype?.setTimeout, {"call":[["msecs","?callback"]],"construct":[]}],
919 | [http2?.Http2ServerResponse, {"call":[],"construct":[["stream"]]}],
920 | [http2?.Http2ServerResponse?.prototype?.addTrailers, {"call":[["trailers"]],"construct":[]}],
921 | [http2?.Http2ServerResponse?.prototype?.getHeader, {"call":[["name"]],"construct":[]}],
922 | [http2?.Http2ServerResponse?.prototype?.hasHeader, {"call":[["name"]],"construct":[]}],
923 | [http2?.Http2ServerResponse?.prototype?.removeHeader, {"call":[["name"]],"construct":[]}],
924 | [http2?.Http2ServerResponse?.prototype?.setHeader, {"call":[["name","value"]],"construct":[]}],
925 | [http2?.Http2ServerResponse?.prototype?.writeHead, {"call":[["statusCode","?headers"],["statusCode","statusMessage","?headers"]],"construct":[]}],
926 | [http2?.Http2ServerResponse?.prototype?.write, {"call":[["chunk","?callback"],["chunk","encoding","?callback"]],"construct":[]}],
927 | [http2?.Http2ServerResponse?.prototype?.end, {"call":[["?callback"],["data","?callback"],["data","encoding","?callback"]],"construct":[]}],
928 | [http2?.Http2ServerResponse?.prototype?.destroy, {"call":[["?error"]],"construct":[]}],
929 | [http2?.Http2ServerResponse?.prototype?.setTimeout, {"call":[["msecs","?callback"]],"construct":[]}],
930 | [http2?.Http2ServerResponse?.prototype?.createPushResponse, {"call":[["headers","callback"]],"construct":[]}],
931 | [http2?.Http2ServerResponse?.prototype?.writeEarlyHints, {"call":[["hints"]],"construct":[]}],
932 | [https?.Agent, {"call":[],"construct":[["?options"]]}],
933 | [https?.Server, {"call":[],"construct":[["?requestListener"],["options","?requestListener"]]}],
934 | [https?.createServer, {"call":[["?requestListener"],["options","?requestListener"]],"construct":[]}],
935 | [https?.get, {"call":[["options","?callback"],["url","options","?callback"]],"construct":[]}],
936 | [https?.request, {"call":[["options","?callback"],["url","options","?callback"]],"construct":[]}],
937 | [inspector?.open, {"call":[["?port","?host","?wait"]],"construct":[]}],
938 | [inspector?.Session?.prototype?.post, {"call":[["method","?callback"],["method","?params","?callback"]],"construct":[]}],
939 | [net?.BlockList?.prototype?.addAddress, {"call":[["address"],["address","?type"]],"construct":[]}],
940 | [net?.BlockList?.prototype?.addRange, {"call":[["start","end"],["start","end","?type"]],"construct":[]}],
941 | [net?.BlockList?.prototype?.addSubnet, {"call":[["net","prefix"],["net","prefix","?type"]],"construct":[]}],
942 | [net?.BlockList?.prototype?.check, {"call":[["address"],["address","?type"]],"construct":[]}],
943 | [net?.SocketAddress, {"call":[],"construct":[["options"]]}],
944 | [net?.createServer, {"call":[["?connectionListener"],["?options","?connectionListener"]],"construct":[]}],
945 | [net?.isIP, {"call":[["input"]],"construct":[]}],
946 | [net?.isIPv4, {"call":[["input"]],"construct":[]}],
947 | [net?.isIPv6, {"call":[["input"]],"construct":[]}],
948 | [net?.Server, {"call":[],"construct":[["?connectionListener"],["?options","?connectionListener"]]}],
949 | [net?.Server?.prototype?.listen, {"call":[["?port","?listeningListener"],["path","?listeningListener"],["options","?listeningListener"],["handle","?listeningListener"],["?port","?hostname","?listeningListener"],["?port","?backlog","?listeningListener"],["path","?backlog","?listeningListener"],["handle","?backlog","?listeningListener"],["?port","?hostname","?backlog","?listeningListener"]],"construct":[]}],
950 | [net?.Server?.prototype?.getConnections, {"call":[["cb"]],"construct":[]}],
951 | [net?.Server?.prototype?.close, {"call":[["?callback"]],"construct":[]}],
952 | [net?.Socket, {"call":[],"construct":[["?options"]]}],
953 | [net?.Socket?.prototype?.setTimeout, {"call":[["timeout","?callback"]],"construct":[]}],
954 | [net?.Socket?.prototype?.setNoDelay, {"call":[["?noDelay"]],"construct":[]}],
955 | [net?.Socket?.prototype?.setKeepAlive, {"call":[["?enable","?initialDelay"]],"construct":[]}],
956 | [net?.Socket?.prototype?.end, {"call":[["?callback"],["buffer","?callback"],["str","?encoding","?callback"]],"construct":[]}],
957 | [net?.Socket?.prototype?.read, {"call":[["?size"]],"construct":[]}],
958 | [net?.Socket?.prototype?.connect, {"call":[["options","?connectionListener"],["port","?connectionListener"],["path","?connectionListener"],["port","host","?connectionListener"]],"construct":[]}],
959 | [os?.getPriority, {"call":[["?pid"]],"construct":[]}],
960 | [os?.setPriority, {"call":[["priority"],["pid","priority"]],"construct":[]}],
961 | [os?.userInfo, {"call":[["options"],["?options"]],"construct":[]}],
962 | [path?.resolve, {"call":[["...paths"]],"construct":[]}],
963 | [path?.normalize, {"call":[["path"]],"construct":[]}],
964 | [path?.isAbsolute, {"call":[["path"]],"construct":[]}],
965 | [path?.join, {"call":[["...paths"]],"construct":[]}],
966 | [path?.relative, {"call":[["from","to"]],"construct":[]}],
967 | [path?.toNamespacedPath, {"call":[["path"]],"construct":[]}],
968 | [path?.dirname, {"call":[["path"]],"construct":[]}],
969 | [path?.basename, {"call":[["path","?suffix"]],"construct":[]}],
970 | [path?.extname, {"call":[["path"]],"construct":[]}],
971 | [path?.format, {"call":[["pathObject"]],"construct":[]}],
972 | [path?.parse, {"call":[["path"]],"construct":[]}],
973 | [path?.win32?.resolve, {"call":[["...paths"]],"construct":[]}],
974 | [path?.win32?.normalize, {"call":[["path"]],"construct":[]}],
975 | [path?.win32?.isAbsolute, {"call":[["path"]],"construct":[]}],
976 | [path?.win32?.join, {"call":[["...paths"]],"construct":[]}],
977 | [path?.win32?.relative, {"call":[["from","to"]],"construct":[]}],
978 | [path?.win32?.toNamespacedPath, {"call":[["path"]],"construct":[]}],
979 | [path?.win32?.dirname, {"call":[["path"]],"construct":[]}],
980 | [path?.win32?.basename, {"call":[["path","?suffix"]],"construct":[]}],
981 | [path?.win32?.extname, {"call":[["path"]],"construct":[]}],
982 | [path?.win32?.format, {"call":[["pathObject"]],"construct":[]}],
983 | [path?.win32?.parse, {"call":[["path"]],"construct":[]}],
984 | [perf_hooks?.monitorEventLoopDelay, {"call":[["?options"]],"construct":[]}],
985 | [perf_hooks?.createHistogram, {"call":[["?options"]],"construct":[]}],
986 | [punycode?.ucs2?.decode, {"call":[["string"]],"construct":[]}],
987 | [punycode?.ucs2?.encode, {"call":[["codePoints"]],"construct":[]}],
988 | [punycode?.decode, {"call":[["string"]],"construct":[]}],
989 | [punycode?.encode, {"call":[["string"]],"construct":[]}],
990 | [punycode?.toASCII, {"call":[["domain"]],"construct":[]}],
991 | [punycode?.toUnicode, {"call":[["domain"]],"construct":[]}],
992 | [querystring?.unescape, {"call":[["str"]],"construct":[]}],
993 | [querystring?.escape, {"call":[["str"]],"construct":[]}],
994 | [querystring?.stringify, {"call":[["?obj","?sep","?eq","?options"]],"construct":[]}],
995 | [querystring?.parse, {"call":[["str","?sep","?eq","?options"]],"construct":[]}],
996 | [readline?.Interface, {"call":[],"construct":[["options"],["input","?output","?completer","?terminal"]]}],
997 | [readline?.Interface?.prototype?.question, {"call":[["query","callback"],["query","options","callback"]],"construct":[]}],
998 | [readline?.clearLine, {"call":[["stream","dir","?callback"]],"construct":[]}],
999 | [readline?.clearScreenDown, {"call":[["stream","?callback"]],"construct":[]}],
1000 | [readline?.createInterface, {"call":[["options"],["input","?output","?completer","?terminal"]],"construct":[]}],
1001 | [readline?.cursorTo, {"call":[["stream","x","?y","?callback"]],"construct":[]}],
1002 | [readline?.emitKeypressEvents, {"call":[["stream","?readlineInterface"]],"construct":[]}],
1003 | [readline?.moveCursor, {"call":[["stream","dx","dy","?callback"]],"construct":[]}],
1004 | [readline?.promises?.Interface, {"call":[],"construct":[["options"],["input","?output","?completer","?terminal"]]}],
1005 | [readline?.promises?.Interface?.prototype?.question, {"call":[["query"],["query","options"]],"construct":[]}],
1006 | [readline?.promises?.Readline, {"call":[],"construct":[["stream","?options"]]}],
1007 | [readline?.promises?.Readline?.prototype?.cursorTo, {"call":[["x","?y"]],"construct":[]}],
1008 | [readline?.promises?.Readline?.prototype?.moveCursor, {"call":[["dx","dy"]],"construct":[]}],
1009 | [readline?.promises?.Readline?.prototype?.clearLine, {"call":[["dir"]],"construct":[]}],
1010 | [readline?.promises?.createInterface, {"call":[["options"],["input","?output","?completer","?terminal"]],"construct":[]}],
1011 | [stream, {"call":[],"construct":[["?options"]]}],
1012 | [stream?.prototype?.pipe, {"call":[["destination","?options"]],"construct":[]}],
1013 | [stream?.isErrored, {"call":[["stream"]],"construct":[]}],
1014 | [stream?.isReadable, {"call":[["stream"]],"construct":[]}],
1015 | [stream?.Readable, {"call":[],"construct":[["?opts"]]}],
1016 | [stream?.Readable?.prototype?.push, {"call":[["chunk","?encoding"]],"construct":[]}],
1017 | [stream?.Readable?.prototype?.unshift, {"call":[["chunk","?encoding"]],"construct":[]}],
1018 | [stream?.Readable?.prototype?.setEncoding, {"call":[["encoding"]],"construct":[]}],
1019 | [stream?.Readable?.prototype?.read, {"call":[["?size"]],"construct":[]}],
1020 | [stream?.Readable?.prototype?.pipe, {"call":[["destination","?options"]],"construct":[]}],
1021 | [stream?.Readable?.prototype?.unpipe, {"call":[["?destination"]],"construct":[]}],
1022 | [stream?.Readable?.prototype?.on, {"call":[["event","listener"]],"construct":[]}],
1023 | [stream?.Readable?.prototype?.removeListener, {"call":[["event","listener"]],"construct":[]}],
1024 | [stream?.Readable?.prototype?.removeAllListeners, {"call":[["?event"]],"construct":[]}],
1025 | [stream?.Readable?.prototype?.wrap, {"call":[["stream"]],"construct":[]}],
1026 | [stream?.Readable?.from, {"call":[["iterable","?options"]],"construct":[]}],
1027 | [stream?.Readable?.fromWeb, {"call":[["readableStream","?options"]],"construct":[]}],
1028 | [stream?.Readable?.toWeb, {"call":[["streamReadable"]],"construct":[]}],
1029 | [stream?.Writable, {"call":[],"construct":[["?opts"]]}],
1030 | [stream?.Writable?.prototype?.pipe, {"call":[["destination","?options"]],"construct":[]}],
1031 | [stream?.Writable?.prototype?.write, {"call":[["chunk","?callback"],["chunk","encoding","?callback"]],"construct":[]}],
1032 | [stream?.Writable?.prototype?.setDefaultEncoding, {"call":[["encoding"]],"construct":[]}],
1033 | [stream?.Writable?.prototype?.destroy, {"call":[["?error"]],"construct":[]}],
1034 | [stream?.Writable?.fromWeb, {"call":[["writableStream","?options"]],"construct":[]}],
1035 | [stream?.Writable?.toWeb, {"call":[["streamWritable"]],"construct":[]}],
1036 | [stream?.Duplex, {"call":[],"construct":[["?opts"]]}],
1037 | [stream?.Duplex?.fromWeb, {"call":[["readableStream","?options"]],"construct":[]}],
1038 | [stream?.Duplex?.toWeb, {"call":[["streamReadable"]],"construct":[]}],
1039 | [stream?.Duplex?.from, {"call":[["src"]],"construct":[]}],
1040 | [stream?.Transform, {"call":[],"construct":[["?opts"]]}],
1041 | [stream?.PassThrough, {"call":[],"construct":[["?opts"]]}],
1042 | [stream?.pipeline, {"call":[["streams","?callback"],["source","destination","?callback"],["stream1","stream2","...streams"],["source","transform1","destination","?callback"],["source","transform1","transform2","destination","?callback"],["source","transform1","transform2","transform3","destination","?callback"],["source","transform1","transform2","transform3","transform4","destination","?callback"]],"construct":[]}],
1043 | [stream?.addAbortSignal, {"call":[["signal","stream"]],"construct":[]}],
1044 | [stream?.finished, {"call":[["stream","callback"],["stream","options","callback"]],"construct":[]}],
1045 | [stream?.promises?.pipeline, {"call":[["streams","?options"],["source","destination","?options"],["stream1","stream2","...streams"],["source","transform1","destination","?options"],["source","transform1","transform2","destination","?options"],["source","transform1","transform2","transform3","destination","?options"],["source","transform1","transform2","transform3","transform4","destination","?options"]],"construct":[]}],
1046 | [string_decoder?.StringDecoder, {"call":[],"construct":[["?encoding"]]}],
1047 | [string_decoder?.StringDecoder?.prototype?.write, {"call":[["buffer"]],"construct":[]}],
1048 | [string_decoder?.StringDecoder?.prototype?.end, {"call":[["?buffer"]],"construct":[]}],
1049 | [tls?.checkServerIdentity, {"call":[["hostname","cert"]],"construct":[]}],
1050 | [tls?.createSecureContext, {"call":[["?options"]],"construct":[]}],
1051 | [tls?.TLSSocket, {"call":[],"construct":[["socket","?options"]]}],
1052 | [tls?.TLSSocket?.prototype?.renegotiate, {"call":[["options","callback"]],"construct":[]}],
1053 | [tls?.TLSSocket?.prototype?.exportKeyingMaterial, {"call":[["length","label","context"]],"construct":[]}],
1054 | [tls?.TLSSocket?.prototype?.setMaxSendFragment, {"call":[["size"]],"construct":[]}],
1055 | [tls?.TLSSocket?.prototype?.getPeerCertificate, {"call":[["detailed"],["?detailed"]],"construct":[]}],
1056 | [tls?.Server, {"call":[],"construct":[["?secureConnectionListener"],["options","?secureConnectionListener"]]}],
1057 | [tls?.Server?.prototype?.setSecureContext, {"call":[["options"]],"construct":[]}],
1058 | [tls?.Server?.prototype?.setTicketKeys, {"call":[["keys"]],"construct":[]}],
1059 | [tls?.Server?.prototype?.addContext, {"call":[["hostname","context"]],"construct":[]}],
1060 | [tls?.createServer, {"call":[["?secureConnectionListener"],["options","?secureConnectionListener"]],"construct":[]}],
1061 | [tls?.connect, {"call":[["options","?secureConnectListener"],["port","?options","?secureConnectListener"],["port","?host","?options","?secureConnectListener"]],"construct":[]}],
1062 | [tls?.createSecurePair, {"call":[["?context","?isServer","?requestCert","?rejectUnauthorized"]],"construct":[]}],
1063 | [trace_events?.createTracing, {"call":[["options"]],"construct":[]}],
1064 | [tty?.isatty, {"call":[["fd"]],"construct":[]}],
1065 | [tty?.ReadStream, {"call":[],"construct":[["fd","?options"]]}],
1066 | [tty?.ReadStream?.prototype?.setRawMode, {"call":[["mode"]],"construct":[]}],
1067 | [tty?.WriteStream, {"call":[],"construct":[["fd"]]}],
1068 | [tty?.WriteStream?.prototype?.getColorDepth, {"call":[["?env"]],"construct":[]}],
1069 | [tty?.WriteStream?.prototype?.hasColors, {"call":[["?count"],["?env"],["count","?env"]],"construct":[]}],
1070 | [tty?.WriteStream?.prototype?.cursorTo, {"call":[["x","callback"],["x","?y","?callback"]],"construct":[]}],
1071 | [tty?.WriteStream?.prototype?.moveCursor, {"call":[["dx","dy","?callback"]],"construct":[]}],
1072 | [tty?.WriteStream?.prototype?.clearLine, {"call":[["dir","?callback"]],"construct":[]}],
1073 | [tty?.WriteStream?.prototype?.clearScreenDown, {"call":[["?callback"]],"construct":[]}],
1074 | [url?.parse, {"call":[["urlString"],["urlString","parseQueryString","?slashesDenoteHost"]],"construct":[]}],
1075 | [url?.resolve, {"call":[["from","to"]],"construct":[]}],
1076 | [url?.format, {"call":[["urlObject"],["urlObject","?options"]],"construct":[]}],
1077 | [url?.domainToASCII, {"call":[["domain"]],"construct":[]}],
1078 | [url?.domainToUnicode, {"call":[["domain"]],"construct":[]}],
1079 | [url?.pathToFileURL, {"call":[["path"]],"construct":[]}],
1080 | [url?.fileURLToPath, {"call":[["url"]],"construct":[]}],
1081 | [url?.urlToHttpOptions, {"call":[["url"]],"construct":[]}],
1082 | [util?.callbackify, {"call":[["fn"]],"construct":[]}],
1083 | [util?.debug, {"call":[["section","?callback"]],"construct":[]}],
1084 | [util?.deprecate, {"call":[["fn","msg","?code"]],"construct":[]}],
1085 | [util?.format, {"call":[["?format","...param"]],"construct":[]}],
1086 | [util?.formatWithOptions, {"call":[["inspectOptions","?format","...param"]],"construct":[]}],
1087 | [util?.getSystemErrorName, {"call":[["err"]],"construct":[]}],
1088 | [util?.inherits, {"call":[["constructor","superConstructor"]],"construct":[]}],
1089 | [util?.inspect, {"call":[["object","?options"],["object","?showHidden","?depth","?color"]],"construct":[]}],
1090 | [util?.isBoolean, {"call":[["object"]],"construct":[]}],
1091 | [util?.isDeepStrictEqual, {"call":[["val1","val2"]],"construct":[]}],
1092 | [util?.isNull, {"call":[["object"]],"construct":[]}],
1093 | [util?.isNullOrUndefined, {"call":[["object"]],"construct":[]}],
1094 | [util?.isNumber, {"call":[["object"]],"construct":[]}],
1095 | [util?.isString, {"call":[["object"]],"construct":[]}],
1096 | [util?.isSymbol, {"call":[["object"]],"construct":[]}],
1097 | [util?.isUndefined, {"call":[["object"]],"construct":[]}],
1098 | [util?.isRegExp, {"call":[["object"]],"construct":[]}],
1099 | [util?.isObject, {"call":[["object"]],"construct":[]}],
1100 | [util?.isDate, {"call":[["object"]],"construct":[]}],
1101 | [util?.isError, {"call":[["object"]],"construct":[]}],
1102 | [util?.isFunction, {"call":[["object"]],"construct":[]}],
1103 | [util?.isPrimitive, {"call":[["object"]],"construct":[]}],
1104 | [util?.log, {"call":[["string"]],"construct":[]}],
1105 | [util?.promisify, {"call":[["fn"]],"construct":[]}],
1106 | [util?.stripVTControlCharacters, {"call":[["str"]],"construct":[]}],
1107 | [util?.toUSVString, {"call":[["string"]],"construct":[]}],
1108 | [util?.transferableAbortSignal, {"call":[["signal"]],"construct":[]}],
1109 | [util?.types?.isExternal, {"call":[["object"]],"construct":[]}],
1110 | [util?.types?.isArgumentsObject, {"call":[["object"]],"construct":[]}],
1111 | [util?.types?.isBooleanObject, {"call":[["object"]],"construct":[]}],
1112 | [util?.types?.isNumberObject, {"call":[["object"]],"construct":[]}],
1113 | [util?.types?.isStringObject, {"call":[["object"]],"construct":[]}],
1114 | [util?.types?.isSymbolObject, {"call":[["object"]],"construct":[]}],
1115 | [util?.types?.isNativeError, {"call":[["object"]],"construct":[]}],
1116 | [util?.types?.isAsyncFunction, {"call":[["object"]],"construct":[]}],
1117 | [util?.types?.isGeneratorFunction, {"call":[["object"]],"construct":[]}],
1118 | [util?.types?.isGeneratorObject, {"call":[["object"]],"construct":[]}],
1119 | [util?.types?.isPromise, {"call":[["object"]],"construct":[]}],
1120 | [util?.types?.isMap, {"call":[["object"]],"construct":[]}],
1121 | [util?.types?.isSet, {"call":[["object"]],"construct":[]}],
1122 | [util?.types?.isMapIterator, {"call":[["object"]],"construct":[]}],
1123 | [util?.types?.isSetIterator, {"call":[["object"]],"construct":[]}],
1124 | [util?.types?.isWeakMap, {"call":[["object"]],"construct":[]}],
1125 | [util?.types?.isWeakSet, {"call":[["object"]],"construct":[]}],
1126 | [util?.types?.isArrayBuffer, {"call":[["object"]],"construct":[]}],
1127 | [util?.types?.isDataView, {"call":[["object"]],"construct":[]}],
1128 | [util?.types?.isSharedArrayBuffer, {"call":[["object"]],"construct":[]}],
1129 | [util?.types?.isProxy, {"call":[["object"]],"construct":[]}],
1130 | [util?.types?.isModuleNamespaceObject, {"call":[["value"]],"construct":[]}],
1131 | [util?.types?.isAnyArrayBuffer, {"call":[["object"]],"construct":[]}],
1132 | [util?.types?.isBoxedPrimitive, {"call":[["object"]],"construct":[]}],
1133 | [util?.types?.isTypedArray, {"call":[["object"]],"construct":[]}],
1134 | [util?.types?.isUint8Array, {"call":[["object"]],"construct":[]}],
1135 | [util?.types?.isUint8ClampedArray, {"call":[["object"]],"construct":[]}],
1136 | [util?.types?.isUint16Array, {"call":[["object"]],"construct":[]}],
1137 | [util?.types?.isUint32Array, {"call":[["object"]],"construct":[]}],
1138 | [util?.types?.isInt8Array, {"call":[["object"]],"construct":[]}],
1139 | [util?.types?.isInt16Array, {"call":[["object"]],"construct":[]}],
1140 | [util?.types?.isInt32Array, {"call":[["object"]],"construct":[]}],
1141 | [util?.types?.isFloat32Array, {"call":[["object"]],"construct":[]}],
1142 | [util?.types?.isFloat64Array, {"call":[["object"]],"construct":[]}],
1143 | [util?.types?.isBigInt64Array, {"call":[["value"]],"construct":[]}],
1144 | [util?.types?.isBigUint64Array, {"call":[["value"]],"construct":[]}],
1145 | [util?.types?.isKeyObject, {"call":[["object"]],"construct":[]}],
1146 | [util?.types?.isCryptoKey, {"call":[["object"]],"construct":[]}],
1147 | [util?.parseArgs, {"call":[["?config"]],"construct":[]}],
1148 | [util?.MIMEType, {"call":[],"construct":[["input"]]}],
1149 | [util?.MIMEParams?.prototype?.delete, {"call":[["name"]],"construct":[]}],
1150 | [util?.MIMEParams?.prototype?.get, {"call":[["name"]],"construct":[]}],
1151 | [util?.MIMEParams?.prototype?.has, {"call":[["name"]],"construct":[]}],
1152 | [util?.MIMEParams?.prototype?.set, {"call":[["name","value"]],"construct":[]}],
1153 | [v8?.setFlagsFromString, {"call":[["flags"]],"construct":[]}],
1154 | [v8?.Serializer?.prototype?.writeValue, {"call":[["val"]],"construct":[]}],
1155 | [v8?.Serializer?.prototype?.transferArrayBuffer, {"call":[["id","arrayBuffer"]],"construct":[]}],
1156 | [v8?.Serializer?.prototype?.writeUint32, {"call":[["value"]],"construct":[]}],
1157 | [v8?.Serializer?.prototype?.writeUint64, {"call":[["hi","lo"]],"construct":[]}],
1158 | [v8?.Serializer?.prototype?.writeDouble, {"call":[["value"]],"construct":[]}],
1159 | [v8?.Serializer?.prototype?.writeRawBytes, {"call":[["buffer"]],"construct":[]}],
1160 | [v8?.Deserializer, {"call":[],"construct":[["data"]]}],
1161 | [v8?.Deserializer?.prototype?.transferArrayBuffer, {"call":[["id","arrayBuffer"]],"construct":[]}],
1162 | [v8?.Deserializer?.prototype?.readRawBytes, {"call":[["length"]],"construct":[]}],
1163 | [v8?.DefaultDeserializer, {"call":[],"construct":[["data"]]}],
1164 | [v8?.deserialize, {"call":[["buffer"]],"construct":[]}],
1165 | [v8?.serialize, {"call":[["value"]],"construct":[]}],
1166 | [v8?.writeHeapSnapshot, {"call":[["?filename"]],"construct":[]}],
1167 | [vm?.Script, {"call":[],"construct":[["code","?options"]]}],
1168 | [vm?.Script?.prototype?.runInThisContext, {"call":[["?options"]],"construct":[]}],
1169 | [vm?.Script?.prototype?.runInContext, {"call":[["contextifiedObject","?options"]],"construct":[]}],
1170 | [vm?.Script?.prototype?.runInNewContext, {"call":[["?contextObject","?options"]],"construct":[]}],
1171 | [vm?.createContext, {"call":[["?sandbox","?options"]],"construct":[]}],
1172 | [vm?.runInContext, {"call":[["code","contextifiedObject","?options"]],"construct":[]}],
1173 | [vm?.runInNewContext, {"call":[["code","?contextObject","?options"]],"construct":[]}],
1174 | [vm?.runInThisContext, {"call":[["code","?options"]],"construct":[]}],
1175 | [vm?.isContext, {"call":[["sandbox"]],"construct":[]}],
1176 | [vm?.compileFunction, {"call":[["code","?params","?options"]],"construct":[]}],
1177 | [vm?.measureMemory, {"call":[["?options"]],"construct":[]}],
1178 | [worker_threads?.markAsUntransferable, {"call":[["object"]],"construct":[]}],
1179 | [worker_threads?.moveMessagePortToContext, {"call":[["port","contextifiedSandbox"]],"construct":[]}],
1180 | [worker_threads?.receiveMessageOnPort, {"call":[["port"]],"construct":[]}],
1181 | [worker_threads?.Worker, {"call":[],"construct":[["filename","?options"]]}],
1182 | [worker_threads?.Worker?.prototype?.postMessage, {"call":[["value","?transferList"]],"construct":[]}],
1183 | [worker_threads?.setEnvironmentData, {"call":[["key","value"]],"construct":[]}],
1184 | [worker_threads?.getEnvironmentData, {"call":[["key"]],"construct":[]}],
1185 | [zlib?.deflate, {"call":[["buf","callback"],["buf","options","callback"]],"construct":[]}],
1186 | [zlib?.deflateSync, {"call":[["buf","?options"]],"construct":[]}],
1187 | [zlib?.gzip, {"call":[["buf","callback"],["buf","options","callback"]],"construct":[]}],
1188 | [zlib?.gzipSync, {"call":[["buf","?options"]],"construct":[]}],
1189 | [zlib?.deflateRaw, {"call":[["buf","callback"],["buf","options","callback"]],"construct":[]}],
1190 | [zlib?.deflateRawSync, {"call":[["buf","?options"]],"construct":[]}],
1191 | [zlib?.unzip, {"call":[["buf","callback"],["buf","options","callback"]],"construct":[]}],
1192 | [zlib?.unzipSync, {"call":[["buf","?options"]],"construct":[]}],
1193 | [zlib?.inflate, {"call":[["buf","callback"],["buf","options","callback"]],"construct":[]}],
1194 | [zlib?.inflateSync, {"call":[["buf","?options"]],"construct":[]}],
1195 | [zlib?.gunzip, {"call":[["buf","callback"],["buf","options","callback"]],"construct":[]}],
1196 | [zlib?.gunzipSync, {"call":[["buf","?options"]],"construct":[]}],
1197 | [zlib?.inflateRaw, {"call":[["buf","callback"],["buf","options","callback"]],"construct":[]}],
1198 | [zlib?.inflateRawSync, {"call":[["buf","?options"]],"construct":[]}],
1199 | [zlib?.brotliCompress, {"call":[["buf","callback"],["buf","options","callback"]],"construct":[]}],
1200 | [zlib?.brotliCompressSync, {"call":[["buf","?options"]],"construct":[]}],
1201 | [zlib?.brotliDecompress, {"call":[["buf","callback"],["buf","options","callback"]],"construct":[]}],
1202 | [zlib?.brotliDecompressSync, {"call":[["buf","?options"]],"construct":[]}],
1203 | [zlib?.createDeflate, {"call":[["?options"]],"construct":[]}],
1204 | [zlib?.createInflate, {"call":[["?options"]],"construct":[]}],
1205 | [zlib?.createDeflateRaw, {"call":[["?options"]],"construct":[]}],
1206 | [zlib?.createInflateRaw, {"call":[["?options"]],"construct":[]}],
1207 | [zlib?.createGzip, {"call":[["?options"]],"construct":[]}],
1208 | [zlib?.createGunzip, {"call":[["?options"]],"construct":[]}],
1209 | [zlib?.createUnzip, {"call":[["?options"]],"construct":[]}],
1210 | [zlib?.createBrotliCompress, {"call":[["?options"]],"construct":[]}],
1211 | [zlib?.createBrotliDecompress, {"call":[["?options"]],"construct":[]}],
1212 | ].filter(([key]) => key !== undefined));
1213 |
--------------------------------------------------------------------------------
/src/annotations.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const fs = require('fs');
4 | const path = require('path');
5 | const Module = require('module');
6 | const acorn = require('acorn');
7 | const annotationMap = require('./annotation_map.js');
8 |
9 | function generateAnnotationForJsFunction(method) {
10 | const description = method.toString();
11 | if (description.includes('{ [native function] }')) {
12 | return false;
13 | }
14 | let expr = null;
15 | try {
16 | // Try to parse as a function, anonymous function, or arrow function.
17 | expr = acorn.parse(`(${description})`, { ecmaVersion: 2021 }).body[0].expression;
18 | } catch {
19 | try {
20 | // Try to parse as a method.
21 | expr = acorn.parse(`({${description}})`, { ecmaVersion: 2021 }).body[0].expression;
22 | } catch {} // eslint-disable-line no-empty
23 | }
24 | if (!expr) {
25 | return false;
26 | }
27 | let params;
28 | switch (expr.type) {
29 | case 'ClassExpression': {
30 | if (!expr.body.body) {
31 | break;
32 | }
33 | const constructor = expr.body.body.find((m) => m.kind === 'constructor');
34 | if (constructor) {
35 | ({ params } = constructor.value);
36 | }
37 | break;
38 | }
39 | case 'ObjectExpression':
40 | if (!expr.properties[0] || !expr.properties[0].value) {
41 | break;
42 | }
43 | ({ params } = expr.properties[0].value);
44 | break;
45 | case 'FunctionExpression':
46 | case 'ArrowFunctionExpression':
47 | ({ params } = expr);
48 | break;
49 | default:
50 | break;
51 | }
52 | if (!params) {
53 | return false;
54 | }
55 | params = params.map(function paramName(param) {
56 | switch (param.type) {
57 | case 'Identifier':
58 | return param.name;
59 | case 'AssignmentPattern':
60 | return `?${paramName(param.left)}`;
61 | case 'ObjectPattern': {
62 | const list = param.properties.map((p) => {
63 | const k = paramName(p.key);
64 | const v = paramName(p.value);
65 | if (k === v) {
66 | return k;
67 | }
68 | if (`?${k}` === v) {
69 | return `?${k}`;
70 | }
71 | return `${k}: ${v}`;
72 | }).join(', ');
73 | return `{ ${list} }`;
74 | }
75 | case 'ArrayPattern': {
76 | const list = param.elements.map(paramName).join(', ');
77 | return `[ ${list} ]`;
78 | }
79 | case 'RestElement':
80 | return `...${paramName(param.argument)}`;
81 | default:
82 | return '?';
83 | }
84 | });
85 | annotationMap.set(method, { call: [params], construct: [params] });
86 | return true;
87 | }
88 |
89 | function gracefulOperation(fn, args, alternative) {
90 | try {
91 | return fn(...args);
92 | } catch {
93 | return alternative;
94 | }
95 | }
96 |
97 | function completeCall(method, expression, buffer) {
98 | if (method === globalThis.require) {
99 | if (expression.arguments.length > 1) {
100 | return ')';
101 | }
102 | if (expression.arguments.length === 1) {
103 | const a = expression.arguments[0];
104 | if (a.type !== 'Literal' || typeof a.value !== 'string'
105 | || /['"]$/.test(a.value)) {
106 | return undefined;
107 | }
108 | }
109 |
110 | const extensions = Object.keys(require.extensions);
111 | const indexes = extensions.map((extension) => `index${extension}`);
112 | indexes.push('package.json', 'index');
113 | const versionedFileNamesRe = /-\d+\.\d+/;
114 |
115 | const completeOn = expression.arguments[0].value;
116 | const subdir = /([\w@./-]+\/)?(?:[\w@./-]*)/m.exec(completeOn)[1] || '';
117 | let group = [];
118 | let paths = [];
119 |
120 | if (completeOn === '.') {
121 | group = ['./', '../'];
122 | } else if (completeOn === '..') {
123 | group = ['../'];
124 | } else if (/^\.\.?\//.test(completeOn)) {
125 | paths = [process.cwd()];
126 | } else {
127 | paths = module.paths.concat(Module.globalPaths);
128 | }
129 |
130 | paths.forEach((dir) => {
131 | dir = path.resolve(dir, subdir);
132 | gracefulOperation(
133 | fs.readdirSync,
134 | [dir, { withFileTypes: true }],
135 | [],
136 | ).forEach((dirent) => {
137 | if (versionedFileNamesRe.test(dirent.name) || dirent.name === '.npm') {
138 | // Exclude versioned names that 'npm' installs.
139 | return;
140 | }
141 | const extension = path.extname(dirent.name);
142 | const base = dirent.name.slice(0, -extension.length);
143 | if (!dirent.isDirectory()) {
144 | if (extensions.includes(extension) && (!subdir || base !== 'index')) {
145 | group.push(`${subdir}${base}`);
146 | }
147 | return;
148 | }
149 | group.push(`${subdir}${dirent.name}/`);
150 | const absolute = path.resolve(dir, dirent.name);
151 | const subfiles = gracefulOperation(fs.readdirSync, [absolute], []);
152 | for (const subfile of subfiles) {
153 | if (indexes.includes(subfile)) {
154 | group.push(`${subdir}${dirent.name}`);
155 | break;
156 | }
157 | }
158 | });
159 | });
160 |
161 | for (const g of group) {
162 | if (g.startsWith(completeOn)) {
163 | return g.slice(completeOn.length);
164 | }
165 | }
166 |
167 | return undefined;
168 | }
169 |
170 | if (!annotationMap.has(method)) {
171 | if (!generateAnnotationForJsFunction(method)) {
172 | return undefined;
173 | }
174 | }
175 |
176 | const entry = annotationMap.get(method)[{
177 | CallExpression: 'call',
178 | NewExpression: 'construct',
179 | }[expression.type]].slice(0);
180 | const target = expression.arguments.length + (buffer.trim().endsWith(',') ? 1 : 0);
181 | let params = entry.find((p) => p.length >= target) || entry.at(-1);
182 | if (target >= params.length) {
183 | if (params[params.length - 1].startsWith('...')) {
184 | return `, ${params[params.length - 1]}`;
185 | }
186 | return ')';
187 | }
188 | params = params.slice(target).join(', ');
189 | if (target > 0) {
190 | if (buffer.trim().endsWith(',')) {
191 | const spaces = buffer.length - (buffer.lastIndexOf(',') + 1);
192 | if (spaces > 0) {
193 | return params;
194 | }
195 | return ` ${params}`;
196 | }
197 | return `, ${params}`;
198 | }
199 | return params;
200 | }
201 |
202 | module.exports = { completeCall };
203 |
--------------------------------------------------------------------------------
/src/highlight.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const emphasize = require('emphasize');
4 | const chalk = require('chalk');
5 |
6 | const windows = process.platform === 'win32';
7 | const sheet = {
8 | 'comment': chalk.gray,
9 | 'quote': chalk.gray,
10 |
11 | 'keyword': chalk.green,
12 | 'addition': chalk.green,
13 |
14 | 'number': windows ? chalk.yellow : chalk.blue,
15 | 'string': chalk.green,
16 | 'meta meta-string': chalk.cyan,
17 | 'literal': chalk.cyan,
18 | 'doctag': chalk.cyan,
19 | 'regexp': chalk.cyan,
20 |
21 | 'attribute': undefined,
22 | 'attr': undefined,
23 | 'variable': chalk.yellow,
24 | 'template-variable': chalk.yellow,
25 | 'class title': chalk.yellow,
26 | 'type': chalk.yellow,
27 |
28 | 'symbol': chalk.magenta,
29 | 'bullet': chalk.magenta,
30 | 'subst': chalk.magenta,
31 | 'meta': chalk.magenta,
32 | 'meta keyword': chalk.magenta,
33 | 'link': chalk.magenta,
34 |
35 | 'built_in': chalk.cyan,
36 | 'deletion': chalk.red,
37 |
38 | 'emphasis': chalk.italic,
39 | 'strong': chalk.bold,
40 | 'formula': chalk.inverse,
41 | };
42 |
43 | module.exports = (s) =>
44 | emphasize.highlight('js', s, sheet).value;
45 |
--------------------------------------------------------------------------------
/src/history.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const fs = require('fs').promises;
4 | const path = require('path');
5 | const os = require('os');
6 |
7 | module.exports = async () => {
8 | let handle;
9 | try {
10 | const historyPath = path.join(os.homedir(), '.node_repl_history');
11 | handle = await fs.open(historyPath, 'a+', 0o0600);
12 | const data = await handle.readFile({ encoding: 'utf8' });
13 | const history = data.split(os.EOL, 1000);
14 | const writeHistory = async (d) => {
15 | if (!handle) {
16 | return false;
17 | }
18 | try {
19 | await handle.truncate(0);
20 | await handle.writeFile(d.join(os.EOL));
21 | return true;
22 | } catch {
23 | handle.close().catch(() => undefined);
24 | handle = null;
25 | return false;
26 | }
27 | };
28 | return { history, writeHistory };
29 | } catch {
30 | if (handle) {
31 | handle.close().catch(() => undefined);
32 | }
33 | return { history: [], writeHistory: () => false };
34 | }
35 | };
36 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | 'use strict';
4 |
5 | const { createInterface, clearScreenDown } = require('readline');
6 | const stripAnsi = require('strip-ansi');
7 | const { spawn } = require('child_process');
8 | const acorn = require('acorn-loose');
9 | const chalk = require('chalk');
10 | const { Session } = require('./inspector');
11 | const { isIdentifier, strEscape, underlineIgnoreANSI } = require('./util');
12 | const highlight = require('./highlight');
13 | const getHistory = require('./history');
14 |
15 | function makePrompt(i) {
16 | return chalk.green(`In [${chalk.bold(i)}]: `);
17 | }
18 |
19 | function makePromptOut(inspected, i) {
20 | if (/[\r\n\u2028\u2029]/u.test(inspected)) {
21 | return '';
22 | }
23 | return chalk.red(`Out[${chalk.bold(i)}]: `);
24 | }
25 |
26 | function promptLength(i) {
27 | return `In [${i}]: `.length;
28 | }
29 |
30 | async function start(wsUrl) {
31 | const session = await Session.create(wsUrl);
32 |
33 | session.post('Runtime.enable');
34 | const [{ context }] = await Session.once(session, 'Runtime.executionContextCreated');
35 | const { result: remoteGlobal } = await session.post('Runtime.evaluate', {
36 | expression: 'globalThis',
37 | });
38 |
39 | const getGlobalNames = () => Promise.all([
40 | session.post('Runtime.globalLexicalScopeNames')
41 | .then((r) => r.names),
42 | session.post('Runtime.getProperties', {
43 | objectId: remoteGlobal.objectId,
44 | }).then((r) => r.result.map((p) => p.name)),
45 | ]).then((r) => r.flat());
46 |
47 | const evaluate = (source, throwOnSideEffect) => {
48 | const wrapped = /^\s*{/.test(source) && !/;\s*$/.test(source)
49 | ? `(${source})`
50 | : source;
51 | return session.post('Runtime.evaluate', {
52 | expression: wrapped,
53 | throwOnSideEffect,
54 | replMode: true,
55 | timeout: throwOnSideEffect ? 200 : undefined,
56 | objectGroup: 'OBJECT_GROUP',
57 | });
58 | };
59 |
60 | const callFunctionOn = (f, args) => session.post('Runtime.callFunctionOn', {
61 | executionContextId: context.id,
62 | functionDeclaration: f,
63 | arguments: args,
64 | objectGroup: 'OBJECT_GROUP',
65 | });
66 |
67 | const completeLine = async (line) => {
68 | if (line.length === 0) {
69 | return getGlobalNames();
70 | }
71 |
72 | const statements = acorn.parse(line, { ecmaVersion: 2021 }).body;
73 | const statement = statements[statements.length - 1];
74 | if (!statement || statement.type !== 'ExpressionStatement') {
75 | return undefined;
76 | }
77 | let { expression } = statement;
78 | if (expression.operator === 'void') {
79 | expression = expression.argument;
80 | }
81 |
82 | let keys;
83 | let filter;
84 | if (expression.type === 'Identifier') {
85 | keys = await getGlobalNames();
86 | filter = expression.name;
87 |
88 | if (keys.includes(filter)) {
89 | return undefined;
90 | }
91 | } else if (expression.type === 'MemberExpression') {
92 | const expr = line.slice(expression.object.start, expression.object.end);
93 | if (expression.computed && expression.property.type === 'Literal') {
94 | filter = expression.property.raw;
95 | } else if (expression.property.type === 'Identifier') {
96 | if (expression.property.name === '✖') {
97 | filter = undefined;
98 | } else {
99 | filter = expression.property.name;
100 | if (expression.computed) {
101 | keys = await getGlobalNames();
102 | }
103 | }
104 | } else {
105 | return undefined;
106 | }
107 |
108 | if (!keys) {
109 | let evaluateResult = await evaluate(expr, true);
110 | if (evaluateResult.exceptionDetails) {
111 | return undefined;
112 | }
113 |
114 | // Convert inspection target to object.
115 | if (evaluateResult.result.type !== 'object'
116 | && evaluateResult.result.type !== 'undefined'
117 | && evaluateResult.result.subtype !== 'null') {
118 | evaluateResult = await evaluate(`Object(${expr})`, true);
119 | if (evaluateResult.exceptionDetails) {
120 | return undefined;
121 | }
122 | }
123 |
124 | const own = [];
125 | const inherited = [];
126 | (await session.post('Runtime.getProperties', {
127 | objectId: evaluateResult.result.objectId,
128 | generatePreview: true,
129 | }))
130 | .result
131 | .filter(({ symbol }) => !symbol)
132 | .forEach(({ isOwn, name }) => {
133 | if (isOwn) {
134 | own.push(name);
135 | } else {
136 | inherited.push(name);
137 | }
138 | });
139 |
140 | keys = [...own, ...inherited];
141 | if (keys.length === 0) {
142 | return undefined;
143 | }
144 |
145 | if (expression.computed) {
146 | if (line.endsWith(']')) {
147 | return undefined;
148 | }
149 |
150 | keys = keys.map((key) => {
151 | let r;
152 | if (`${+key}` === key) {
153 | r = key;
154 | } else {
155 | r = strEscape(key);
156 | }
157 | return `${r}]`;
158 | });
159 | } else {
160 | keys = keys.filter(isIdentifier);
161 | }
162 | }
163 | } else if (expression.type === 'CallExpression' || expression.type === 'NewExpression') {
164 | if (line[expression.end - 1] === ')') {
165 | return undefined;
166 | }
167 | if (!line.slice(expression.callee.end).includes('(')) {
168 | return undefined;
169 | }
170 | const callee = line.slice(expression.callee.start, expression.callee.end);
171 | const { result, exceptionDetails } = await evaluate(callee, true);
172 | if (exceptionDetails) {
173 | return undefined;
174 | }
175 | const { result: annotation } = await callFunctionOn(
176 | `function complete(fn, expression, line) {
177 | const { completeCall } = require('${require.resolve('./annotations')}');
178 | const a = completeCall(fn, expression, line);
179 | return a;
180 | }`,
181 | [result, { value: expression }, { value: line }],
182 | );
183 | if (annotation.type === 'string') {
184 | return { fillable: false, completions: [annotation.value] };
185 | }
186 | return undefined;
187 | }
188 |
189 | if (keys) {
190 | if (filter) {
191 | keys = keys
192 | .filter((k) => k.startsWith(filter) && k !== filter)
193 | .map((k) => k.slice(filter.length));
194 | }
195 | return { fillable: true, completions: keys };
196 | }
197 |
198 | return undefined;
199 | };
200 |
201 | const getPreview = (line) => evaluate(line, true)
202 | .then(({ result, exceptionDetails }) => {
203 | if (exceptionDetails) {
204 | throw new Error();
205 | }
206 | return callFunctionOn(
207 | `function inspect(v) {
208 | const i = util.inspect(v, {
209 | colors: false,
210 | breakLength: Infinity,
211 | compact: true,
212 | maxArrayLength: 10,
213 | depth: 1,
214 | });
215 | return i.split('\\n')[0].trim();
216 | }`,
217 | [result],
218 | );
219 | })
220 | .then(({ result }) => result.value)
221 | .catch(() => undefined);
222 |
223 | const rl = createInterface({
224 | input: process.stdin,
225 | output: process.stdout,
226 | prompt: makePrompt(1),
227 | completer(line, cb) {
228 | completeLine(line)
229 | .then((result) => {
230 | if (result.fillable) {
231 | cb(null, [(result.completions || []).map((l) => line + l), line]);
232 | } else {
233 | cb(null, [[], line]);
234 | }
235 | })
236 | .catch(() => {
237 | cb(null, [[], line]);
238 | });
239 | },
240 | postprocessor(line) {
241 | return highlight(line);
242 | },
243 | });
244 | rl.pause();
245 |
246 | // if node doesn't support postprocessor, force _refreshLine
247 | if (rl.postprocessor === undefined) {
248 | rl._insertString = (c) => {
249 | const beg = rl.line.slice(0, rl.cursor);
250 | const end = rl.line.slice(rl.cursor, rl.line.length);
251 | rl.line = beg + c + end;
252 | rl.cursor += c.length;
253 | rl._refreshLine();
254 | };
255 | }
256 |
257 | const history = await getHistory();
258 | rl.history = history.history;
259 |
260 | let MODE = 'NORMAL';
261 |
262 | let promptIndex = 1;
263 |
264 | let nextCtrlCKills = false;
265 | let nextCtrlDKills = false;
266 | rl.on('SIGINT', () => {
267 | nextCtrlDKills = false;
268 | if (MODE === 'REVERSE') {
269 | MODE = 'NORMAL';
270 | process.stdout.moveCursor(0, -1);
271 | process.stdout.cursorTo(0);
272 | rl._refreshLine();
273 | } else if (rl.line.length) {
274 | rl.line = '';
275 | rl.cursor = 0;
276 | rl._refreshLine();
277 | } else if (nextCtrlCKills) {
278 | process.exit();
279 | } else {
280 | nextCtrlCKills = true;
281 | process.stdout.write(`\n(To exit, press ^C again)\n${rl.getPrompt()}`);
282 | }
283 | });
284 |
285 | let completionCache;
286 | const ttyWrite = rl._ttyWrite.bind(rl);
287 | rl._ttyWrite = (d, key) => {
288 | if (!(key.ctrl && key.name === 'c')) {
289 | nextCtrlCKills = false;
290 | }
291 |
292 | if (key.ctrl && key.name === 'd') {
293 | if (nextCtrlDKills) {
294 | process.exit();
295 | }
296 | nextCtrlDKills = true;
297 | process.stdout.write(`\n(To exit, press ^D again)\n${rl.getPrompt()}`);
298 | return;
299 | }
300 | nextCtrlDKills = false;
301 |
302 | if (key.ctrl && key.name === 'r' && MODE === 'NORMAL') {
303 | MODE = 'REVERSE';
304 | process.stdout.write('\n');
305 | rl._refreshLine();
306 | return;
307 | }
308 |
309 | if (key.name === 'return' && MODE === 'REVERSE') {
310 | MODE = 'NORMAL';
311 | const match = rl.history.find((h) => h.includes(rl.line));
312 | process.stdout.moveCursor(0, -1);
313 | process.stdout.cursorTo(0);
314 | process.stdout.clearScreenDown();
315 | rl.cursor = match.indexOf(rl.line) + rl.line.length;
316 | rl.line = match;
317 | rl._refreshLine();
318 | return;
319 | }
320 |
321 | ttyWrite(d, key);
322 |
323 | if (key.name === 'right' && rl.cursor === rl.line.length) {
324 | if (completionCache) {
325 | rl._insertString(completionCache);
326 | }
327 | }
328 | };
329 |
330 | const countLines = (line) => {
331 | let count = 0;
332 | line.split(/\r?\n/).forEach((inner) => {
333 | inner = stripAnsi(inner);
334 | count += 1;
335 | if (inner.length > process.stdout.columns) {
336 | count += Math.floor(inner.length / process.stdout.columns);
337 | }
338 | });
339 | return count;
340 | };
341 |
342 | const refreshLine = rl._refreshLine.bind(rl);
343 | rl._refreshLine = () => {
344 | completionCache = undefined;
345 | const inspectedLine = rl.line;
346 |
347 | if (MODE === 'REVERSE') {
348 | process.stdout.moveCursor(0, -1);
349 | process.stdout.cursorTo(promptLength(promptIndex));
350 | clearScreenDown(process.stdout);
351 | let match;
352 | if (inspectedLine) {
353 | match = rl.history.find((h) => h.includes(inspectedLine));
354 | }
355 | if (match) {
356 | match = highlight(match);
357 | match = underlineIgnoreANSI(match, inspectedLine);
358 | }
359 | process.stdout.write(`${match || ''}\n(reverse-i-search): ${inspectedLine}`);
360 | process.stdout.cursorTo('(reverse-i-search): '.length + rl.cursor);
361 | return;
362 | }
363 |
364 | if (rl.postprocessor === undefined) {
365 | rl.line = highlight(inspectedLine);
366 | }
367 | refreshLine();
368 | rl.line = inspectedLine;
369 |
370 | // fix cursor offset because of ansi codes
371 | process.stdout.cursorTo(promptLength(promptIndex) + rl.cursor);
372 |
373 | if (inspectedLine !== '') {
374 | Promise.all([
375 | completeLine(inspectedLine),
376 | getPreview(inspectedLine),
377 | ])
378 | .then(([completion, preview]) => {
379 | if (rl.line !== inspectedLine) {
380 | return;
381 | }
382 |
383 | let rows = 0;
384 | if (completion && completion.completions.length > 0) {
385 | if (completion.fillable) {
386 | ([completionCache] = completion.completions);
387 | }
388 | process.stdout.cursorTo(promptLength(promptIndex) + rl.line.length);
389 | process.stdout.write(chalk.grey(completion.completions[0]));
390 | rows += countLines(completion.completions[0]) - 1;
391 | }
392 | if (preview) {
393 | process.stdout.write(chalk.grey(`\nOut[${promptIndex}]: ${preview}\n`));
394 | rows += countLines(preview) + 1;
395 | }
396 |
397 | process.stdout.cursorTo(promptLength(promptIndex) + rl.cursor);
398 | process.stdout.moveCursor(0, -rows);
399 | })
400 | .catch(() => {});
401 | }
402 | };
403 |
404 | process.stdout.write(`\
405 | Node.js ${process.versions.node} (V8 ${process.versions.v8})
406 | Prototype REPL - https://github.com/nodejs/repl
407 |
408 | `);
409 |
410 | rl.resume();
411 | rl.prompt();
412 | for await (const line of rl) {
413 | rl.pause();
414 | clearScreenDown(process.stdout);
415 |
416 | const { result, exceptionDetails } = await evaluate(line, false);
417 | const uncaught = !!exceptionDetails;
418 |
419 | const { result: inspected } = await callFunctionOn(
420 | 'function inspect(uncaught, line, value) { return globalThis[Symbol.for("nodejs.repl.updateInspect")](uncaught, line, value); }',
421 | [{ value: uncaught }, { value: promptIndex }, result],
422 | );
423 |
424 | process.stdout.write(`${makePromptOut(inspected.value, promptIndex)}${uncaught ? 'Uncaught ' : ''}${inspected.value}\n\n`);
425 |
426 | promptIndex += 1;
427 | rl.setPrompt(makePrompt(promptIndex));
428 |
429 | await Promise.all([
430 | session.post('Runtime.releaseObjectGroup', {
431 | objectGroup: 'OBJECT_GROUP',
432 | }),
433 | history.writeHistory(rl.history),
434 | ]);
435 |
436 | rl.resume();
437 | rl.prompt();
438 | }
439 | }
440 |
441 | const child = spawn(process.execPath, [
442 | '--inspect-publish-uid=http',
443 | ...process.execArgv,
444 | require.resolve('./stub.js'),
445 | ...process.argv,
446 | ], {
447 | cwd: process.cwd(),
448 | windowsHide: true,
449 | });
450 |
451 | child.stdout.on('data', (data) => {
452 | process.stdout.write(data);
453 | });
454 |
455 | child.stderr.on('data', (data) => {
456 | const s = data.toString();
457 | if (s.startsWith('__DEBUGGER_URL__')) {
458 | start(s.split(' ')[1]);
459 | } else if (s !== 'Debugger attached.\n') {
460 | process.stderr.write(data);
461 | }
462 | });
463 |
--------------------------------------------------------------------------------
/src/inspector.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const { EventEmitter } = require('events');
4 | const WebSocket = require('ws');
5 |
6 | class Session extends EventEmitter {
7 | constructor(url) {
8 | super();
9 |
10 | this.ws = new WebSocket(url);
11 | this.ws.on('message', (d) => {
12 | this.onMessage(d);
13 | });
14 | this.ws.on('open', () => {
15 | this.emit('open');
16 | });
17 |
18 | this.messageCounter = 0;
19 | this.messages = new Map();
20 | }
21 |
22 | static create(url) {
23 | return new Promise((resolve) => {
24 | const s = new Session(url);
25 | s.once('open', () => resolve(s));
26 | });
27 | }
28 |
29 | onMessage(d) {
30 | const { id, method, params, result, error } = JSON.parse(d);
31 | if (method) {
32 | this.emit(method, params);
33 | } else {
34 | const { resolve, reject } = this.messages.get(id);
35 | this.messages.delete(id);
36 | if (error) {
37 | const e = new Error(error.message);
38 | e.code = error.code;
39 | reject(e);
40 | } else {
41 | resolve(result);
42 | }
43 | }
44 | }
45 |
46 | post(method, params) {
47 | return new Promise((resolve, reject) => {
48 | const id = this.messageCounter;
49 | this.messageCounter += 1;
50 | const message = {
51 | method,
52 | params,
53 | id,
54 | };
55 | this.messages.set(id, { resolve, reject });
56 | this.ws.send(JSON.stringify(message));
57 | });
58 | }
59 | }
60 |
61 | module.exports = { Session };
62 |
--------------------------------------------------------------------------------
/src/stub.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const Module = require('module');
4 | const path = require('path');
5 | const inspector = require('inspector');
6 | const util = require('util');
7 |
8 | inspector.open(0, true);
9 | process.stderr.write(`__DEBUGGER_URL__ ${inspector.url()}`);
10 |
11 | if (process.platform !== 'win32') {
12 | util.inspect.styles.number = 'blue';
13 | util.inspect.styles.bigint = 'blue';
14 | }
15 |
16 | Module.builtinModules
17 | .filter((x) => !/^_|\//.test(x))
18 | .forEach((name) => {
19 | if (name === 'domain' || name === 'repl' || name === 'sys') {
20 | return;
21 | }
22 | Object.defineProperty(globalThis, name, {
23 | value: require(name),
24 | writable: true,
25 | enumerable: false,
26 | configurable: true,
27 | });
28 | });
29 |
30 | try {
31 | // Hack for require.resolve("./relative") to work properly.
32 | module.filename = path.resolve('repl');
33 | } catch (e) {
34 | // path.resolve('repl') fails when the current working directory has been
35 | // deleted. Fall back to the directory name of the (absolute) executable
36 | // path. It's not really correct but what are the alternatives?
37 | const dirname = path.dirname(process.execPath);
38 | module.filename = path.resolve(dirname, 'repl');
39 | }
40 |
41 | // Hack for repl require to work properly with node_modules folders
42 | module.paths = Module._nodeModulePaths(module.filename);
43 |
44 | const parentModule = module;
45 | {
46 | const module = new Module('');
47 | module.paths = Module._resolveLookupPaths('', parentModule, true) || [];
48 | module._compile('module.exports = require;', '');
49 |
50 | Object.defineProperty(globalThis, 'module', {
51 | writable: true,
52 | enumerable: false,
53 | configurable: true,
54 | value: module,
55 | });
56 |
57 | Object.defineProperty(globalThis, 'require', {
58 | writable: true,
59 | enumerable: false,
60 | configurable: true,
61 | value: module.exports,
62 | });
63 | }
64 |
65 | ['_', '__', '___', '_err'].forEach((prop) => {
66 | Object.defineProperty(globalThis, prop, {
67 | value: undefined,
68 | writable: true,
69 | enumerable: false,
70 | configurable: true,
71 | });
72 | });
73 |
74 | process.on('uncaughtException', (e) => {
75 | process.stdout.write(`Uncaught ${util.inspect(e)}\n`);
76 | });
77 |
78 | process.on('unhandledRejection', (reason) => {
79 | process.stdout.write(`Unhandled ${util.inspect(reason)}\n`);
80 | });
81 |
82 | globalThis[Symbol.for('nodejs.repl.updateInspect')] = (uncaught, line, value) => {
83 | if (uncaught) {
84 | globalThis._err = value;
85 | } else {
86 | globalThis.___ = globalThis.__;
87 | globalThis.__ = globalThis._;
88 | globalThis._ = value;
89 | Object.defineProperty(globalThis, `_${line}`, {
90 | value,
91 | writable: true,
92 | enumerable: false,
93 | configurable: true,
94 | });
95 | }
96 | return util.inspect(value, {
97 | colors: true,
98 | showProxy: true,
99 | });
100 | };
101 |
102 | // keep process alive using stdin
103 | process.stdin.on('data', () => {});
104 |
--------------------------------------------------------------------------------
/src/util.js:
--------------------------------------------------------------------------------
1 | // Copyright Node.js contributors. All rights reserved.
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a copy
4 | // of this software and associated documentation files (the "Software"), to
5 | // deal in the Software without restriction, including without limitation the
6 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 | // sell copies of the Software, and to permit persons to whom the Software is
8 | // furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19 | // IN THE SOFTWARE.
20 | //
21 | // https://github.com/nodejs/node/blob/master/lib/internal/util/inspect.js
22 | // https://github.com/nodejs/node/blob/master/lib/util.js
23 |
24 | 'use strict';
25 |
26 | const { isIdentifierStart, isIdentifierChar } = require('acorn');
27 |
28 | function isIdentifier(str) {
29 | if (str === '') {
30 | return false;
31 | }
32 | const first = str.codePointAt(0);
33 | if (!isIdentifierStart(first)) {
34 | return false;
35 | }
36 | const firstLen = first > 0xffff ? 2 : 1;
37 | for (let i = firstLen; i < str.length; i += 1) {
38 | const cp = str.codePointAt(i);
39 | if (!isIdentifierChar(cp)) {
40 | return false;
41 | }
42 | if (cp > 0xffff) {
43 | i += 1;
44 | }
45 | }
46 | return true;
47 | }
48 |
49 | /* eslint-disable no-control-regex */
50 | const strEscapeSequencesRegExp = /[\x00-\x1f\x27\x5c]/;
51 | const strEscapeSequencesReplacer = /[\x00-\x1f\x27\x5c]/g;
52 |
53 | const ansi = /[\u001B\u009B][[\]()#;?]*(?:(?:(?:[a-zA-Z\d]*(?:;[-a-zA-Z\d/#&.:=?%@~_]*)*)?\u0007)|(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-ntqry=><~]))/g;
54 | /* eslint-enable no-control-regex */
55 |
56 | // Escaped special characters. Use empty strings to fill up unused entries.
57 | const meta = [
58 | '\\u0000', '\\u0001', '\\u0002', '\\u0003', '\\u0004',
59 | '\\u0005', '\\u0006', '\\u0007', '\\b', '\\t',
60 | '\\n', '\\u000b', '\\f', '\\r', '\\u000e',
61 | '\\u000f', '\\u0010', '\\u0011', '\\u0012', '\\u0013',
62 | '\\u0014', '\\u0015', '\\u0016', '\\u0017', '\\u0018',
63 | '\\u0019', '\\u001a', '\\u001b', '\\u001c', '\\u001d',
64 | '\\u001e', '\\u001f', '', '', '',
65 | '', '', '', '', "\\'", '', '', '', '', '',
66 | '', '', '', '', '', '', '', '', '', '',
67 | '', '', '', '', '', '', '', '', '', '',
68 | '', '', '', '', '', '', '', '', '', '',
69 | '', '', '', '', '', '', '', '', '', '',
70 | '', '', '', '', '', '', '', '\\\\',
71 | ];
72 |
73 | const escapeFn = (str) => meta[str.charCodeAt(0)];
74 |
75 | const strEscape = (str) => {
76 | // Some magic numbers that worked out fine while benchmarking with v8 6.0
77 | if (str.length < 5000 && !strEscapeSequencesRegExp.test(str)) {
78 | return `'${str}'`;
79 | }
80 | if (str.length > 100) {
81 | return `'${str.replace(strEscapeSequencesReplacer, escapeFn)}'`;
82 | }
83 | let result = '';
84 | let last = 0;
85 | let i = 0;
86 | for (; i < str.length; i += 1) {
87 | const point = str.charCodeAt(i);
88 | if (point === 39 || point === 92 || point < 32) {
89 | if (last === i) {
90 | result += meta[point];
91 | } else {
92 | result += `${str.slice(last, i)}${meta[point]}`;
93 | }
94 | last = i + 1;
95 | }
96 | }
97 | if (last === 0) {
98 | result = str;
99 | } else if (last !== i) {
100 | result += str.slice(last);
101 | }
102 | return `'${result}'`;
103 | };
104 |
105 | const stripVTControlCharacters = (str) => str.replace(ansi, '');
106 |
107 | const isFullWidthCodePoint = (code) =>
108 | // Code points are partially derived from:
109 | // http://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt
110 | code >= 0x1100 && (
111 | code <= 0x115f // Hangul Jamo
112 | || code === 0x2329 // LEFT-POINTING ANGLE BRACKET
113 | || code === 0x232a // RIGHT-POINTING ANGLE BRACKET
114 | // CJK Radicals Supplement .. Enclosed CJK Letters and Months
115 | || (code >= 0x2e80 && code <= 0x3247 && code !== 0x303f)
116 | // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
117 | || (code >= 0x3250 && code <= 0x4dbf)
118 | // CJK Unified Ideographs .. Yi Radicals
119 | || (code >= 0x4e00 && code <= 0xa4c6)
120 | // Hangul Jamo Extended-A
121 | || (code >= 0xa960 && code <= 0xa97c)
122 | // Hangul Syllables
123 | || (code >= 0xac00 && code <= 0xd7a3)
124 | // CJK Compatibility Ideographs
125 | || (code >= 0xf900 && code <= 0xfaff)
126 | // Vertical Forms
127 | || (code >= 0xfe10 && code <= 0xfe19)
128 | // CJK Compatibility Forms .. Small Form Variants
129 | || (code >= 0xfe30 && code <= 0xfe6b)
130 | // Halfwidth and Fullwidth Forms
131 | || (code >= 0xff01 && code <= 0xff60)
132 | || (code >= 0xffe0 && code <= 0xffe6)
133 | // Kana Supplement
134 | || (code >= 0x1b000 && code <= 0x1b001)
135 | // Enclosed Ideographic Supplement
136 | || (code >= 0x1f200 && code <= 0x1f251)
137 | // Miscellaneous Symbols and Pictographs 0x1f300 - 0x1f5ff
138 | // Emoticons 0x1f600 - 0x1f64f
139 | || (code >= 0x1f300 && code <= 0x1f64f)
140 | // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
141 | || (code >= 0x20000 && code <= 0x3fffd)
142 | );
143 |
144 | const isZeroWidthCodePoint = (code) =>
145 | code <= 0x1F // C0 control codes
146 | || (code > 0x7F && code <= 0x9F) // C1 control codes
147 | || (code >= 0x300 && code <= 0x36F) // Combining Diacritical Marks
148 | || (code >= 0x200B && code <= 0x200F) // Modifying Invisible Characters
149 | || (code >= 0xFE00 && code <= 0xFE0F) // Variation Selectors
150 | || (code >= 0xFE20 && code <= 0xFE2F) // Combining Half Marks
151 | || (code >= 0xE0100 && code <= 0xE01EF); // Variation Selectors
152 |
153 | const getStringWidth = (str, removeControlChars = true) => {
154 | let width = 0;
155 |
156 | if (removeControlChars) {
157 | str = stripVTControlCharacters(str);
158 | }
159 |
160 | for (const char of str) {
161 | const code = char.codePointAt(0);
162 | if (isFullWidthCodePoint(code)) {
163 | width += 2;
164 | } else if (!isZeroWidthCodePoint(code)) {
165 | width += 1;
166 | }
167 | }
168 |
169 | return width;
170 | };
171 |
172 | const underlineIgnoreANSI = (str, needle) => {
173 | let start = -1;
174 | outer: // eslint-disable-line no-labels
175 | while (true) { // eslint-disable-line no-constant-condition
176 | start = str.indexOf(needle[0], start + 1);
177 | if (start === -1) {
178 | return str;
179 | }
180 | let strIndex = start;
181 | for (let i = 0; i < needle.length; i += 1) {
182 | if (needle[i] !== str[strIndex]) {
183 | // eslint-disable-next-line no-continue
184 | continue outer; // eslint-disable-line no-labels
185 | }
186 | strIndex += 1;
187 | if (str[strIndex] === '\u001b') {
188 | // assumes this ansi escape is a mode override (m)
189 | strIndex = str.indexOf('m', strIndex) + 1;
190 | }
191 | }
192 | const u = `\u001b[4m${str.slice(start, strIndex)}\u001b[24m`;
193 | return str.slice(0, start) + u + str.slice(strIndex);
194 | }
195 | };
196 |
197 | module.exports = {
198 | isIdentifier,
199 | strEscape,
200 | getStringWidth,
201 | underlineIgnoreANSI,
202 | };
203 |
--------------------------------------------------------------------------------