MCPcopy
hub / github.com/apache/echarts / resolvePath

Function resolvePath

test/lib/simpleRequire.js:113–132  ·  view source on GitHub ↗
(p)

Source from the content-addressed store, hash-verified

111 }
112
113 function resolvePath(p) {
114 var paths = requireCfg.paths || {};
115
116 for (var key in paths) {
117 if (paths.hasOwnProperty(key)) {
118 if (p.indexOf(key) === 0) {
119 p = p.replace(key, paths[key]);
120 break;
121 }
122 }
123 }
124
125 var ext = getExt(p);
126 // Add .js ext automatically
127 if (ALLOWED_EXTS.indexOf(ext) < 0) {
128 p = p + '.js';
129 }
130
131 return p;
132 }
133
134 function getExt(str) {
135 return str.split('.').pop();

Callers 1

loadModFunction · 0.85

Calls 1

getExtFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…