Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed Feb 19, 2022
1 parent 281f169 commit 6d7230d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ export function create(rawOptions: CreateOptions = {}): Service {
const projectLocalResolveHelper =
createProjectLocalResolveHelper(relativeToPath);
const compiler = projectLocalResolveHelper(name || 'typescript', true);
const ts: typeof _ts = attemptRequireWithV8CompileCache(require, compiler);
const ts: TSCommon = attemptRequireWithV8CompileCache(require, compiler);
return { compiler, ts, projectLocalResolveHelper };
}

Expand Down
7 changes: 5 additions & 2 deletions src/resolver-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { ProjectLocalResolveHelper } from './util';
* In a factory because these are shared across both CompilerHost and LanguageService codepaths
*/
export function createResolverFunctions(kwargs: {
ts: TSCommon & TSInternal;
ts: TSCommon;
host: TSCommon.ModuleResolutionHost;
cwd: string;
getCanonicalFileName: (filename: string) => string;
Expand Down Expand Up @@ -140,7 +140,10 @@ export function createResolverFunctions(kwargs: {
const nameIsString = typeof typeDirectiveName === 'string';
const mode = nameIsString
? undefined
: ts.getModeForFileReference!(typeDirectiveName, containingFileMode);
: (ts as any as TSInternal).getModeForFileReference!(
typeDirectiveName,
containingFileMode
);
const strName = nameIsString
? typeDirectiveName
: typeDirectiveName.fileName.toLowerCase();
Expand Down

0 comments on commit 6d7230d

Please sign in to comment.