API Surface Issue
Category
Unused export
Summary
- File:
src/logs/log-parser.ts
- Symbol:
extractDomain (line 108)
- Issue:
extractDomain is exported as a public API symbol but is never imported by any production code — only log-parser.test.ts references it.
Evidence
$ grep -rw "extractDomain" src --include="*.ts"
src/logs/log-parser.ts:108:export function extractDomain(url: string, host: string, method: string): string {
src/logs/log-parser.ts: (used internally via parseLogLine and parseAuditJsonlLine calls within the same file)
src/logs/log-parser.test.ts: (test-only imports and direct calls)
The function is called internally within log-parser.ts itself (inside parseLogLine and parseAuditJsonlLine) but is not imported by any other production module. The src/logs/index.ts barrel was cleaned up (issue #3025) and does not re-export it, but the export keyword on the definition itself remains.
Recommended Fix
Remove the export keyword from extractDomain in src/logs/log-parser.ts:
// Before
export function extractDomain(url: string, host: string, method: string): string {
// After
function extractDomain(url: string, host: string, method: string): string {
The test in log-parser.test.ts that directly calls extractDomain should be updated to test the behaviour indirectly via parseLogLine instead — this keeps the implementation detail internal and tests the public contract.
Impact
- Dead code risk: Low (function executes correctly, but unnecessarily widens the public contract)
- Maintenance burden: Low (small function, but every unnecessary public export must be preserved across refactors)
Detected by Export Audit workflow. Triggered by push to main on 2026-05-25
Generated by API Surface & Export Audit · sonnet46 2.1M · ◷
API Surface Issue
Category
Unused export
Summary
src/logs/log-parser.tsextractDomain(line 108)extractDomainis exported as a public API symbol but is never imported by any production code — onlylog-parser.test.tsreferences it.Evidence
The function is called internally within
log-parser.tsitself (insideparseLogLineandparseAuditJsonlLine) but is not imported by any other production module. Thesrc/logs/index.tsbarrel was cleaned up (issue #3025) and does not re-export it, but theexportkeyword on the definition itself remains.Recommended Fix
Remove the
exportkeyword fromextractDomaininsrc/logs/log-parser.ts:The test in
log-parser.test.tsthat directly callsextractDomainshould be updated to test the behaviour indirectly viaparseLogLineinstead — this keeps the implementation detail internal and tests the public contract.Impact
Detected by Export Audit workflow. Triggered by push to main on 2026-05-25