MCPcopy
hub / github.com/winjs/winjs / normalize

Function normalize

src/js/amd.js:31–51  ·  view source on GitHub ↗
(id, dependencies)

Source from the content-addressed store, hash-verified

29 // WinJS/Core depends on ./Core/_Base
30 // should return WinJS/Core/_Base
31 function normalize(id, dependencies) {
32 id = id || "";
33 var parent = id.split('/');
34 parent.pop();
35 return dependencies.map(function (dep) {
36 if (dep[0] === '.') {
37 var parts = dep.split('/');
38 var current = parent.slice(0);
39 parts.forEach(function (part) {
40 if (part === '..') {
41 current.pop();
42 } else if (part !== '.') {
43 current.push(part);
44 }
45 });
46 return current.join('/');
47 } else {
48 return dep;
49 }
50 });
51 }
52
53 function resolve(dependencies, parent, exports) {
54 return dependencies.map(function (depName) {

Callers 2

amd.jsFile · 0.85
resolveFunction · 0.85

Calls 7

splitMethod · 0.65
popMethod · 0.65
mapMethod · 0.65
sliceMethod · 0.65
forEachMethod · 0.65
pushMethod · 0.65
joinMethod · 0.65

Tested by

no test coverage detected