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

Function isAliasedPath

scripts/helpers.mjs:59–76  ·  view source on GitHub ↗
(path, exact, wildcard)

Source from the content-addressed store, hash-verified

57}
58
59function isAliasedPath(path, exact, wildcard){
60 if (exact.includes(path)){
61 return true;
62 }
63 for (const wc of wildcard){
64 const toMatch = wc.slice(0, -1); // strip off the '*'
65 if (path.startsWith(toMatch)){
66 return true;
67 }
68 // could be a directory import
69 if (toMatch[toMatch.length - 1] === '/'){
70 if (path.startsWith(toMatch.slice(0, -1))){
71 return true;
72 }
73 }
74 }
75 return false;
76}
77
78function walkDirPath(subPaths, basePath, possibleExtensions) {
79 // if subPaths is empty on entry it is possible directory import

Callers 1

resolveToFullPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected