"Annotate" exported object to fix named / namespace imports of our API in Node ESM (#57133)

This commit is contained in:
Jake Bailey
2024-03-04 13:06:41 -08:00
committed by GitHub
parent 6d458e81cd
commit 320e17f122
4 changed files with 50 additions and 29 deletions

View File

@@ -2743,12 +2743,8 @@ export function skipWhile<T, U extends T>(array: readonly T[] | undefined, predi
export function isNodeLikeSystem(): boolean {
// This is defined here rather than in sys.ts to prevent a cycle from its
// use in performanceCore.ts.
//
// We don't use the presence of `require` to check if we are in Node;
// when bundled using esbuild, this function will be rewritten to `__require`
// and definitely exist.
return typeof process !== "undefined"
&& !!process.nextTick
&& !(process as any).browser
&& typeof module === "object";
&& typeof require !== "undefined";
}

View File

@@ -2,7 +2,6 @@ import {
Debug,
LogLevel,
} from "./_namespaces/ts";
import * as ts from "./_namespaces/ts";
// enable deprecation logging
declare const console: any;
@@ -23,4 +22,4 @@ if (typeof console !== "undefined") {
};
}
export = ts;
export * from "./_namespaces/ts";