@@ -95,31 +95,6 @@ export function createMultiCompilerHost(fs: Package): MultiCompilerHost {
9595 return compilerHosts [ moduleResolution ] . getSourceFile ( fileName , languageVersion ) ;
9696 }
9797
98- function getImpliedNodeFormatForFile (
99- fileName : string ,
100- moduleResolution : ResolutionOption
101- ) : ts . ModuleKind . ESNext | ts . ModuleKind . CommonJS | undefined {
102- return ts . getImpliedNodeFormatForFile (
103- toPath ( fileName ) ,
104- moduleResolutionCaches [ moduleResolution ] [ 0 ] . getPackageJsonInfoCache ( ) ,
105- compilerHosts [ moduleResolution ] ,
106- compilerOptions [ moduleResolution ]
107- ) ;
108- }
109-
110- function getPackageScopeForPath ( fileName : string ) : ts . PackageJsonInfo | undefined {
111- // Which compiler options get used here is irrelevant.
112- // Use the node16 cache because package.json it should be a hit.
113- return ts . getPackageScopeForPath (
114- fileName ,
115- ts . getTemporaryModuleResolutionState (
116- moduleResolutionCaches . node16 [ 0 ] . getPackageJsonInfoCache ( ) ,
117- compilerHosts . node16 ,
118- compilerOptions . node16
119- )
120- ) ;
121- }
122-
12398 function getModuleKindForFile ( fileName : string , moduleResolution : "node16" ) : ModuleKind ;
12499 function getModuleKindForFile ( fileName : string , moduleResolution : ResolutionOption ) : ModuleKind | undefined ;
125100 function getModuleKindForFile ( fileName : string , moduleResolution : ResolutionOption ) : ModuleKind | undefined {
@@ -241,6 +216,31 @@ export function createMultiCompilerHost(fs: Package): MultiCompilerHost {
241216 } ;
242217 }
243218
219+ function getImpliedNodeFormatForFile (
220+ fileName : string ,
221+ moduleResolution : ResolutionOption
222+ ) : ts . ModuleKind . ESNext | ts . ModuleKind . CommonJS | undefined {
223+ return ts . getImpliedNodeFormatForFile (
224+ toPath ( fileName ) ,
225+ moduleResolutionCaches [ moduleResolution ] [ 0 ] . getPackageJsonInfoCache ( ) ,
226+ compilerHosts [ moduleResolution ] ,
227+ compilerOptions [ moduleResolution ]
228+ ) ;
229+ }
230+
231+ function getPackageScopeForPath ( fileName : string ) : ts . PackageJsonInfo | undefined {
232+ // Which compiler options get used here is irrelevant.
233+ // Use the node16 cache because package.json it should be a hit.
234+ return ts . getPackageScopeForPath (
235+ fileName ,
236+ ts . getTemporaryModuleResolutionState (
237+ moduleResolutionCaches . node16 [ 0 ] . getPackageJsonInfoCache ( ) ,
238+ compilerHosts . node16 ,
239+ compilerOptions . node16
240+ )
241+ ) ;
242+ }
243+
244244 function createTraceCollector ( ) {
245245 const traces : string [ ] = [ ] ;
246246 return {
0 commit comments