Skip to content

Commit

Permalink
refactor(import_map): rename resolveSimple as resolveInner
Browse files Browse the repository at this point in the history
  • Loading branch information
hasundue committed Nov 9, 2023
1 parent 19ff379 commit 17c7582
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/import_map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface ImportMap {
// TODO: Accept a remote URL
specifier: URI<"file">;
resolve(specifier: string, referrer: string): Maybe<ImportMapResolveResult>;
resolveSimple(specifier: string, referrer: string): string;
resolveInner(specifier: string, referrer: string): string;
}

export const ImportMap = {
Expand Down Expand Up @@ -77,6 +77,6 @@ async function readFromJson(specifier: URI<"file">): Promise<Maybe<ImportMap>> {
...replacement,
};
},
resolveSimple: inner.resolve.bind(inner),
resolveInner: inner.resolve.bind(inner),
};
}
4 changes: 2 additions & 2 deletions lib/import_map_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe("resolve()", () => {
});
});

describe("resolveSimple()", () => {
describe("resolveInner()", () => {
let importMap: ImportMap;
beforeAll(async () => {
const maybe = await ImportMap.readFromJson(
Expand All @@ -126,7 +126,7 @@ describe("resolveSimple()", () => {
});
it("resolve an absolute path", () => {
assertEquals(
importMap.resolveSimple(
importMap.resolveInner(
"/lib.ts",
URI.from("test/fixtures/import-map/mod.ts"),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export async function collect(

const graph = await createGraph(specifiers, {
load,
resolve: importMap ? importMap.resolveSimple : undefined,
resolve: importMap ? importMap.resolveInner : undefined,
});

const updates: DependencyUpdate[] = [];
Expand Down

0 comments on commit 17c7582

Please sign in to comment.