1
- import { ResolutionContext , VisitorContext } from " ../types" ;
1
+ import { ResolutionContext , VisitorContext } from ' ../types' ;
2
2
import {
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' ;
10
17
11
18
/* ****************************************************************************************************************** */
12
19
// region: Types
@@ -64,7 +71,7 @@ function getReturnPath(ctx: GetReturnPathContext) {
64
71
config : { outputExtensions, outputIndexes } ,
65
72
compilerOptions,
66
73
tsInstance,
67
- isDeclarationFile
74
+ isDeclarationFile,
68
75
} = ctx . visitorContext ;
69
76
const { suppliedExt, resolvedPath, isImplicitExtension, indexDetail, isExternalLibraryImport } = ctx . pathDetail ?? { } ;
70
77
@@ -98,7 +105,8 @@ function getReturnPath(ctx: GetReturnPathContext) {
98
105
if ( resolver ) {
99
106
const { moduleName, node, visitorContext, isURL, resolvedModule } = ctx ;
100
107
const { resolvedFileName, originalPath } = resolvedModule ?? { } ;
101
- const { packageName, suppliedPackageName, tsPathsKey, packageFileName, isExternalLibraryImport } = ctx . pathDetail ?? { } ;
108
+ const { packageName, suppliedPackageName, tsPathsKey, packageFileName, isExternalLibraryImport } =
109
+ ctx . pathDetail ?? { } ;
102
110
103
111
const resolutionContext : ResolutionContext = {
104
112
moduleExtName : suppliedExt ,
@@ -186,7 +194,8 @@ export function resolveModuleName(
186
194
const { suppliedPackageName, suppliedPackagePath, indexDetail } = pathDetail ;
187
195
188
196
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 ! ) ) ;
190
199
191
200
return getReturnPath ( {
192
201
moduleName,
@@ -195,7 +204,7 @@ export function resolveModuleName(
195
204
resolvedModule,
196
205
resolvedSourceFile,
197
206
pathDetail,
198
- outputPath
207
+ outputPath,
199
208
} ) ;
200
209
}
201
210
0 commit comments