Skip to content

Commit

Permalink
refactor(lib/update): simplify map property
Browse files Browse the repository at this point in the history
  • Loading branch information
hasundue committed Mar 1, 2024
1 parent 226b1fa commit 2d4a93f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions lib/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import {
type ModuleJson,
} from "./x/deno_graph.ts";
import { findFileUp, toPath, toUrl } from "./path.ts";
import { ImportMap, tryReadFromJson } from "./import_map.ts";
import {
ImportMap,
ImportMapResolveResult,
tryReadFromJson,
} from "./import_map.ts";
import {
type Dependency,
parse,
Expand Down Expand Up @@ -43,11 +47,7 @@ export interface DependencyUpdate {
/** The full path to the import map used to resolve the dependency.
* @example "/path/to/import_map.json" */
source: string;
/** The string in the dependency specifier being replaced */
key?: string;
/** The fully resolved specifier (URL) of the dependency. */
resolved: string;
};
} & ImportMapResolveResult;
}

class DenoGraph {
Expand Down Expand Up @@ -233,8 +233,7 @@ async function create(
map: mapped
? {
source: options!.importMap!.path,
key: mapped.key,
resolved: mapped.resolved,
...mapped,
}
: undefined,
};
Expand Down

0 comments on commit 2d4a93f

Please sign in to comment.