| 57 | } |
| 58 | |
| 59 | function 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 | |
| 78 | function walkDirPath(subPaths, basePath, possibleExtensions) { |
| 79 | // if subPaths is empty on entry it is possible directory import |