(filePath, binField)
| 13 | const NODE_SHEBANG_PATTERN = /#!\/usr\/bin\/env node(?: [^\r\n]+?)?\n/u |
| 14 | |
| 15 | function simulateNodeResolutionAlgorithm(filePath, binField) { |
| 16 | const possibilities = [filePath] |
| 17 | let newFilePath = filePath.replace(/\.js$/u, "") |
| 18 | possibilities.push(newFilePath) |
| 19 | newFilePath = newFilePath.replace(/[/\\]index$/u, "") |
| 20 | possibilities.push(newFilePath) |
| 21 | return possibilities.includes(binField) |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Checks whether or not a given path is a `bin` file. |
no outgoing calls
no test coverage detected
searching dependent graphs…