API Surface Issue
Category
Unused export
Summary
- File:
src/domain-patterns.ts
- Symbols:
DomainProtocol, ParsedDomain
- Issue: Both are exported but never imported by any other module. They are only referenced internally within
domain-patterns.ts itself.
Evidence
$ grep -rn "\bDomainProtocol\b" src/ tests/ --include="*.ts"
src/domain-patterns.ts:32:export type DomainProtocol = 'http' | 'https' | 'both';
src/domain-patterns.ts:41: protocol: DomainProtocol;
src/domain-patterns.ts:235: protocol: DomainProtocol;
src/domain-patterns.ts:243: protocol: DomainProtocol;
# No external imports found.
$ grep -rn "\bParsedDomain\b" src/ tests/ --include="*.ts"
src/domain-patterns.ts:37:export interface ParsedDomain {
src/domain-patterns.ts:48: * `@returns` ParsedDomain with the domain and protocol restriction
src/domain-patterns.ts:55:export function parseDomainWithProtocol(input: string): ParsedDomain {
# No external imports found.
parseDomainWithProtocol is used by callers (e.g., src/squid-config.ts), but callers never reference ParsedDomain by name — they rely on structural typing. Similarly, DomainProtocol is used as a field type in DomainPattern and PlainDomainEntry within the same file, but no external module references it by name.
Recommended Fix
- Remove the
export keyword from the DomainProtocol type declaration at src/domain-patterns.ts:32.
- Remove the
export keyword from the ParsedDomain interface declaration at src/domain-patterns.ts:37.
Both symbols can remain as unexported internal types since they are still needed within the file.
Note: ParsedDomainList (a related unused export in the same file) is already tracked in #2448.
Impact
- Dead code risk: Low
- Maintenance burden: Low-Medium —
domain-patterns.ts is in the security-relevant path (domain ACL enforcement), so keeping the API surface minimal reduces the chance of unintended consumers relying on these type shapes.
Detected by Export Audit workflow. Triggered by push to main on 2026-05-03
Generated by API Surface & Export Audit · ● 471K · ◷
API Surface Issue
Category
Unused export
Summary
src/domain-patterns.tsDomainProtocol,ParsedDomaindomain-patterns.tsitself.Evidence
parseDomainWithProtocolis used by callers (e.g.,src/squid-config.ts), but callers never referenceParsedDomainby name — they rely on structural typing. Similarly,DomainProtocolis used as a field type inDomainPatternandPlainDomainEntrywithin the same file, but no external module references it by name.Recommended Fix
exportkeyword from theDomainProtocoltype declaration atsrc/domain-patterns.ts:32.exportkeyword from theParsedDomaininterface declaration atsrc/domain-patterns.ts:37.Both symbols can remain as unexported internal types since they are still needed within the file.
Note:
ParsedDomainList(a related unused export in the same file) is already tracked in #2448.Impact
domain-patterns.tsis in the security-relevant path (domain ACL enforcement), so keeping the API surface minimal reduces the chance of unintended consumers relying on these type shapes.Detected by Export Audit workflow. Triggered by push to main on 2026-05-03