Skip to content

Commit 804aef5

Browse files
committed
TS: Remove unneeded alias PackageLocationMap
1 parent 542ce81 commit 804aef5

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

javascript/extractor/lib/typescript/src/common.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@ export class Project {
1414
private host: ts.CompilerHost;
1515
private resolutionCache: ts.ModuleResolutionCache;
1616

17-
constructor(public tsConfig: string, public config: ts.ParsedCommandLine, public typeTable: TypeTable, public packageLocations: PackageLocationMap,
17+
constructor(
18+
public tsConfig: string,
19+
public config: ts.ParsedCommandLine,
20+
public typeTable: TypeTable,
21+
public packageEntryPoints: Map<string, string>,
1822
public virtualSourceRoot: VirtualSourceRoot) {
23+
1924
this.resolveModuleNames = this.resolveModuleNames.bind(this);
2025

2126
this.resolutionCache = ts.createModuleResolutionCache(pathlib.dirname(tsConfig), ts.sys.realpath, config.options);
@@ -75,7 +80,7 @@ export class Project {
7580
let packageName = packageNameMatch[0];
7681

7782
// Get the overridden location of this package, if one exists.
78-
let packageEntryPoint = this.packageLocations.get(packageName);
83+
let packageEntryPoint = this.packageEntryPoints.get(packageName);
7984
if (packageEntryPoint == null) {
8085
// The package is not overridden, but we have established that it begins with a valid package name.
8186
// Do a lookup in the virtual source root (where dependencies are installed) by changing the 'containing file'.
@@ -116,5 +121,3 @@ export class Project {
116121
return null;
117122
}
118123
}
119-
120-
export type PackageLocationMap = Map<string, string>;

javascript/extractor/lib/typescript/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import * as readline from "readline";
3737
import * as ts from "./typescript";
3838
import * as ast_extractor from "./ast_extractor";
3939

40-
import { Project, PackageLocationMap } from "./common";
40+
import { Project } from "./common";
4141
import { TypeTable } from "./type_table";
4242
import { VirtualSourceRoot } from "./virtual_source_root";
4343

0 commit comments

Comments
 (0)