Skip to content

[Export Audit] Unused exported types in src/domain-patterns.ts: DomainProtocol, ParsedDomain #2452

@github-actions

Description

@github-actions

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

  1. Remove the export keyword from the DomainProtocol type declaration at src/domain-patterns.ts:32.
  2. 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 ·

  • expires on Jun 2, 2026, 11:22 PM UTC

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions