()
| 89 | export const getCurrentDirPath = () => path.dirname(getCurrentFilePath()); |
| 90 | |
| 91 | export const getRepoRootDir = () => { |
| 92 | const currentFilePath = getCurrentFilePath(); |
| 93 | const index = currentFilePath.lastIndexOf(PACKAGE_SEGMENT); |
| 94 | if (index === -1) { |
| 95 | throw new Error( |
| 96 | `Unable to determine repo root from ${currentFilePath} (missing ${PACKAGE_SEGMENT}).`, |
| 97 | ); |
| 98 | } |
| 99 | return currentFilePath.slice(0, index); |
| 100 | }; |
| 101 | |
| 102 | export const isMainModule = () => { |
| 103 | const entryScript = process.argv.at(1); |
no test coverage detected