MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / resolvePackageUri

Function resolvePackageUri

src/shared/pub/package_map.ts:60–79  ·  view source on GitHub ↗
(uri: string)

Source from the content-addressed store, hash-verified

58 }
59
60 public resolvePackageUri(uri: string): string | undefined {
61 if (!uri)
62 return undefined;
63
64 let name: string = uri;
65 if (name.startsWith("package:"))
66 name = name.substring(8);
67 const index = name.indexOf("/");
68 if (index === -1)
69 return undefined;
70
71 const rest = name.substring(index + 1);
72 name = name.substring(0, index);
73
74 const location = this.getPackagePath(name);
75 if (location)
76 return path.join(location, rest);
77 else
78 return undefined;
79 }
80}
81
82export class MissingPackageMap extends PackageMap {

Callers

nothing calls this directly

Calls 1

getPackagePathMethod · 0.45

Tested by

no test coverage detected