MCPcopy
hub / github.com/systemjs/systemjs / applyPackages

Function applyPackages

src/common.js:175–189  ·  view source on GitHub ↗
(id, packages)

Source from the content-addressed store, hash-verified

173}
174
175function applyPackages (id, packages) {
176 var pkgName = getMatch(id, packages);
177 if (pkgName) {
178 var pkg = packages[pkgName];
179 if (pkg === null) return;
180 if (id.length > pkgName.length && pkg[pkg.length - 1] !== '/') {
181 if (process.env.SYSTEM_PRODUCTION)
182 targetWarning('W2', pkgName, pkg);
183 else
184 targetWarning('W2', pkgName, pkg, "should have a trailing '/'");
185 }
186 else
187 return pkg + id.slice(pkgName.length);
188 }
189}
190
191function targetWarning (code, match, target, msg) {
192 console.warn(errMsg(code, process.env.SYSTEM_PRODUCTION ? [target, match].join(', ') : "Package target " + msg + ", resolving target '" + target + "' for " + match));

Callers 1

resolveImportMapFunction · 0.85

Calls 2

getMatchFunction · 0.85
targetWarningFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…