Skip to content

lib: add tsconfig internal contributions #38042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/internal/bootstrap/loaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ const legacyWrapperList = new SafeSet([
}

// Set up internalBinding() in the closure.
/**
* @type {InternalBinding}
*/
let internalBinding;
{
const bindingObj = ObjectCreate(null);
Expand Down
6 changes: 5 additions & 1 deletion lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,11 @@ function makeNodeErrorWithCode(Base, key) {
};
}

// This function removes unnecessary frames from Node.js core errors.
/**
* This function removes unnecessary frames from Node.js core errors.
* @template {(...args: any[]) => any} T
* @type {(fn: T) => T}
*/
function hideStackFrames(fn) {
// We rename the functions that will be hidden to cut off the stacktrace
// at the outermost one
Expand Down
3 changes: 3 additions & 0 deletions lib/internal/per_context/primordials.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ const copyProps = (src, dest) => {
});
};

/**
* @type {typeof primordials.makeSafe}
*/
const makeSafe = (unsafe, safe) => {
if (SymbolIterator in unsafe.prototype) {
const dummy = new unsafe();
Expand Down
84 changes: 84 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"include": ["lib","doc"],
"exclude": ["src","tools","out"],
"files": [
"./typings/internalBinding.d.ts",
"./typings/primordials.d.ts"
],
"compilerOptions": {
"allowJs": true,
"checkJs": false,
"noEmit": true,
"lib": ["ESNext"],
"target": "ESNext",
"module": "CommonJS",
"baseUrl": ".",
"paths": {
"_http_agent": ["./lib/_http_agent.js"],
"_http_client": ["./lib/_http_client.js"],
"_http_common": ["./lib/_http_common.js"],
"_http_incoming": ["./lib/_http_incoming.js"],
"_http_outgoing": ["./lib/_http_outgoing.js"],
"_http_server": ["./lib/_http_server.js"],
"_stream_duplex": ["./lib/_stream_duplex.js"],
"_stream_passthrough": ["./lib/_stream_passthrough.js"],
"_stream_readable": ["./lib/_stream_readable.js"],
"_stream_transform": ["./lib/_stream_transform.js"],
"_stream_wrap": ["./lib/_stream_wrap.js"],
"_stream_writable": ["./lib/_stream_writable.js"],
"_tls_common": ["./lib/_tls_common.js"],
"_tls_wrap": ["./lib/_tls_wrap.js"],
"assert": ["./lib/assert.js"],
"assert/strict": ["./lib/assert/strict.js"],
"async_hooks": ["./lib/async_hooks.js"],
"buffer": ["./lib/buffer.js"],
"child_process": ["./lib/child_process.js"],
"cluster": ["./lib/cluster.js"],
"console": ["./lib/console.js"],
"constants": ["./lib/constants.js"],
"crypto": ["./lib/crypto.js"],
"dgram": ["./lib/dgram.js"],
"diagnostics_channel": ["./lib/diagnostics_channel.js"],
"dns": ["./lib/dns.js"],
"dns/promises": ["./lib/dns/promises.js"],
"domain": ["./lib/domain.js"],
"events": ["./lib/events.js"],
"fs": ["./lib/fs.js"],
"fs/promises": ["./lib/fs/promises.js"],
"http": ["./lib/http.js"],
"http2": ["./lib/http2.js"],
"https": ["./lib/https.js"],
"inspector": ["./lib/inspector.js"],
"internal/*": ["./lib/internal/*"],
"module": ["./lib/module.js"],
"net": ["./lib/net.js"],
"os": ["./lib/os.js"],
"path": ["./lib/path.js"],
"path/posix": ["./lib/path/posix.js"],
"path/win32": ["./lib/path/win32.js"],
"perf_hooks": ["./lib/perf_hooks.js"],
"process": ["./lib/process.js"],
"punycode": ["./lib/punycode.js"],
"querystring": ["./lib/querystring.js"],
"readline": ["./lib/readline.js"],
"repl": ["./lib/repl.js"],
"stream": ["./lib/stream.js"],
"stream/promises": ["./lib/stream/promises.js"],
"string_decoder": ["./lib/string_decoder.js"],
"sys": ["./lib/sys.js"],
"timers": ["./lib/timers.js"],
"timers/promises": ["./lib/timers/promises.js"],
"tls": ["./lib/tls.js"],
"trace_events": ["./lib/trace_events.js"],
"tty": ["./lib/tty.js"],
"url": ["./lib/url.js"],
"util": ["./lib/util.js"],
"util/types": ["./lib/util/types.js"],
"v8": ["./lib/v8.js"],
"vm": ["./lib/vm.js"],
"wasi": ["./lib/wasi.js"],
"worker_threads": ["./lib/worker_threads.js"],
"zlib": ["./lib/zlib.js"],
}
}
}
Loading