mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
chore: deps
This commit is contained in:
@@ -260,6 +260,7 @@ export class ExportAnalyzer {
|
||||
: undefined;
|
||||
|
||||
const resolvedModule: ts.ResolvedModuleFull | undefined = TypeScriptInternals.getResolvedModule(
|
||||
this._program,
|
||||
importOrExportDeclaration.getSourceFile(),
|
||||
moduleSpecifier,
|
||||
mode,
|
||||
@@ -856,6 +857,7 @@ export class ExportAnalyzer {
|
||||
)
|
||||
: undefined;
|
||||
const resolvedModule: ts.ResolvedModuleFull | undefined = TypeScriptInternals.getResolvedModule(
|
||||
this._program,
|
||||
importOrExportDeclaration.getSourceFile(),
|
||||
moduleSpecifier,
|
||||
mode,
|
||||
|
||||
@@ -369,7 +369,7 @@ export class Span {
|
||||
* can make changes to Span.modification for each node.
|
||||
*/
|
||||
public forEach(callback: (span: Span) => void): void {
|
||||
// eslint-disable-next-line n/callback-return, n/no-callback-literal
|
||||
// eslint-disable-next-line n/callback-return
|
||||
callback(this);
|
||||
for (const child of this.children) {
|
||||
// eslint-disable-next-line unicorn/no-array-for-each
|
||||
|
||||
@@ -75,14 +75,19 @@ export class TypeScriptInternals {
|
||||
* The compiler populates this cache as part of analyzing the source file.
|
||||
*/
|
||||
public static getResolvedModule(
|
||||
program: ts.Program,
|
||||
sourceFile: ts.SourceFile,
|
||||
moduleNameText: string,
|
||||
mode: ts.ModuleKind.CommonJS | ts.ModuleKind.ESNext | undefined,
|
||||
): ts.ResolvedModuleFull | undefined {
|
||||
// Compiler internal:
|
||||
// https://github.com/microsoft/TypeScript/blob/v4.7.2/src/compiler/utilities.ts#L161
|
||||
|
||||
return (ts as any).getResolvedModule(sourceFile, moduleNameText, mode);
|
||||
// https://github.com/microsoft/TypeScript/blob/v5.3.3/src/compiler/types.ts#L4698
|
||||
const result: ts.ResolvedModuleWithFailedLookupLocations | undefined = (program as any).getResolvedModule(
|
||||
sourceFile,
|
||||
moduleNameText,
|
||||
mode,
|
||||
);
|
||||
return result?.resolvedModule;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user