()
| 476 | } |
| 477 | |
| 478 | function getCallingFile() { |
| 479 | const stack = getStackTrace(); |
| 480 | let callingFile = /** @type {string} */ (stack[2].getFileName()); // [here, withCodSpeed, actual caller] |
| 481 | const gitDir = getGitDir(callingFile); |
| 482 | if (gitDir === undefined) { |
| 483 | throw new Error("Could not find a git repository"); |
| 484 | } |
| 485 | if (callingFile.startsWith("file://")) { |
| 486 | callingFile = fileURLToPath(callingFile); |
| 487 | } |
| 488 | return path.relative(gitDir, callingFile); |
| 489 | } |
| 490 | |
| 491 | /** @typedef {{ uri: string, fn: Fn, options: FnOptions | undefined }} TaskMeta */ |
| 492 | /** @typedef {Map<string, TaskMeta>} URIMap */ |
no test coverage detected