MCPcopy
hub / github.com/systemjs/systemjs / resolveImportMap

Function resolveImportMap

src/common.js:195–205  ·  view source on GitHub ↗
(importMap, resolvedOrPlain, parentUrl)

Source from the content-addressed store, hash-verified

193}
194
195export function resolveImportMap (importMap, resolvedOrPlain, parentUrl) {
196 var scopes = importMap.scopes;
197 var scopeUrl = parentUrl && getMatch(parentUrl, scopes);
198 while (scopeUrl) {
199 var packageResolution = applyPackages(resolvedOrPlain, scopes[scopeUrl]);
200 if (packageResolution)
201 return packageResolution;
202 scopeUrl = getMatch(scopeUrl.slice(0, scopeUrl.lastIndexOf('/')), scopes);
203 }
204 return applyPackages(resolvedOrPlain, importMap.imports) || resolvedOrPlain.indexOf(':') !== -1 && resolvedOrPlain;
205}

Callers 3

doResolveImportMapFunction · 0.90
resolve.jsFile · 0.90

Calls 2

getMatchFunction · 0.85
applyPackagesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…