* Check if the file exists and is not a directory if using `--preserve-symlinks` and `isMain` is false or * `--preserve-symlinks-main` and `isMain` is true , keep symlinks intact, otherwise resolve to the absolute realpath. * @param {string} requestPath The path to the file to load. * @param {boo
(requestPath, isMain)
| 589 | * @returns {string|undefined} |
| 590 | */ |
| 591 | function tryFile(requestPath, isMain) { |
| 592 | const rc = _stat(requestPath); |
| 593 | if (rc !== 0) { return; } |
| 594 | if (getOptionValue(isMain ? '--preserve-symlinks-main' : '--preserve-symlinks')) { |
| 595 | return path.resolve(requestPath); |
| 596 | } |
| 597 | return toRealPath(requestPath); |
| 598 | } |
| 599 | |
| 600 | /** |
| 601 | * Given a path, check if the file exists with any of the set extensions. |
no test coverage detected
searching dependent graphs…