MCPcopy Create free account
hub / github.com/R-js/libRmath.js / rankPaths

Function rankPaths

scripts/helpers.mjs:37–53  ·  view source on GitHub ↗
(paths)

Source from the content-addressed store, hash-verified

35}
36
37export function rankPaths(paths) {
38 // search for paths with no '*'
39 const names = Object.keys(paths);
40
41 const exactPaths = names.filter(path => /\*/.test(path) === false);
42 if (exactPaths.length){
43 // sort on lengt
44 exactPaths.sort(sortOnStringLengthDescending);
45 }
46
47 const wildCardPaths = names.filter(path => /\*/.test(path) === true);
48 if (wildCardPaths.length){
49 // sort on lengt
50 wildCardPaths.sort(sortOnStringLengthDescending);
51 }
52 return { exactPaths, wildCardPaths };
53}
54
55function isRelativeImport(path){
56 return path.startsWith('./') || path.startsWith('../');

Callers 1

createCompilerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected