1- import { ResolutionContext , VisitorContext } from " ../types" ;
1+ import { ResolutionContext , VisitorContext } from ' ../types' ;
22import {
3- baseName , dirName , isBaseDir , isURL , joinPaths , maybeAddRelativeLocalPrefix , normalizeSlashes , relativePath ,
4- removeSuffix
5- } from "../utils" ;
6- import { Node , Pattern , removeFileExtension , ResolvedModuleFull , SourceFile } from "typescript" ;
7- import { getOutputPathForSourceFile , getOutputExtension } from "../ts" ;
8- import { getOutputPathDetail , OutputPathDetail } from "./output-path-detail" ;
9- import { IndexFlags } from "./index-checker" ;
3+ baseName ,
4+ dirName ,
5+ isBaseDir ,
6+ isURL ,
7+ joinPaths ,
8+ maybeAddRelativeLocalPrefix ,
9+ normalizeSlashes ,
10+ relativePath ,
11+ removeSuffix ,
12+ } from '../utils' ;
13+ import { Node , Pattern , removeFileExtension , ResolvedModuleFull , SourceFile } from 'typescript' ;
14+ import { getOutputPathForSourceFile , getOutputExtension } from '../ts' ;
15+ import { getOutputPathDetail , OutputPathDetail } from './output-path-detail' ;
16+ import { IndexFlags } from './index-checker' ;
1017
1118/* ****************************************************************************************************************** */
1219// region: Types
@@ -64,7 +71,7 @@ function getReturnPath(ctx: GetReturnPathContext) {
6471 config : { outputExtensions, outputIndexes } ,
6572 compilerOptions,
6673 tsInstance,
67- isDeclarationFile
74+ isDeclarationFile,
6875 } = ctx . visitorContext ;
6976 const { suppliedExt, resolvedPath, isImplicitExtension, indexDetail, isExternalLibraryImport } = ctx . pathDetail ?? { } ;
7077
@@ -98,7 +105,8 @@ function getReturnPath(ctx: GetReturnPathContext) {
98105 if ( resolver ) {
99106 const { moduleName, node, visitorContext, isURL, resolvedModule } = ctx ;
100107 const { resolvedFileName, originalPath } = resolvedModule ?? { } ;
101- const { packageName, suppliedPackageName, tsPathsKey, packageFileName, isExternalLibraryImport } = ctx . pathDetail ?? { } ;
108+ const { packageName, suppliedPackageName, tsPathsKey, packageFileName, isExternalLibraryImport } =
109+ ctx . pathDetail ?? { } ;
102110
103111 const resolutionContext : ResolutionContext = {
104112 moduleExtName : suppliedExt ,
@@ -186,7 +194,8 @@ export function resolveModuleName(
186194 const { suppliedPackageName, suppliedPackagePath, indexDetail } = pathDetail ;
187195
188196 let outputPath = joinPaths ( suppliedPackageName , suppliedPackagePath && removeFileExtension ( suppliedPackagePath ) ) ;
189- if ( indexDetail . flags & IndexFlags . Implicit ) outputPath = joinPaths ( outputPath , removeFileExtension ( indexDetail . indexPath ! ) ) ;
197+ if ( indexDetail . flags & IndexFlags . Implicit )
198+ outputPath = joinPaths ( outputPath , removeFileExtension ( indexDetail . indexPath ! ) ) ;
190199
191200 return getReturnPath ( {
192201 moduleName,
@@ -195,7 +204,7 @@ export function resolveModuleName(
195204 resolvedModule,
196205 resolvedSourceFile,
197206 pathDetail,
198- outputPath
207+ outputPath,
199208 } ) ;
200209 }
201210
0 commit comments