(projectRoot: string)
| 443 | const cachedAuthors = new Map<string, string>(); |
| 444 | |
| 445 | export function trailAuthor(projectRoot: string): string { |
| 446 | const key = authorCacheKey(projectRoot); |
| 447 | const cached = cachedAuthors.get(key); |
| 448 | if (cached !== undefined) return cached; |
| 449 | const author = gitUserName(projectRoot) ?? osUserName() ?? ''; |
| 450 | cachedAuthors.set(key, author); |
| 451 | return author; |
| 452 | } |
| 453 | |
| 454 | /** Test seam: forget the cached author. */ |
| 455 | export function resetTrailAuthor(): void { |
no test coverage detected