Let AutoImportProviderProject resolve JS when allowJs and maxNodeModulesJsDepth allows (#45524)

* Let AutoImportProviderProject resolve JS when allowJs and maxNodeModulesJsDepth allows

* Simplify function
This commit is contained in:
Andrew Branch
2021-08-25 15:06:14 -07:00
committed by GitHub
parent db0576c251
commit 30103de1dd
9 changed files with 93 additions and 17 deletions

View File

@@ -1078,9 +1078,8 @@ namespace ts {
}
/* @internal */
export function tryResolveJSModule(moduleName: string, initialDir: string, host: ModuleResolutionHost): string | undefined {
const { resolvedModule } = tryResolveJSModuleWorker(moduleName, initialDir, host);
return resolvedModule && resolvedModule.resolvedFileName;
export function tryResolveJSModule(moduleName: string, initialDir: string, host: ModuleResolutionHost) {
return tryResolveJSModuleWorker(moduleName, initialDir, host).resolvedModule;
}
const jsOnlyExtensions = [Extensions.JavaScript];