Skip to content

[Export Audit] Unused export EMPTY_STATS in test-helpers.test-utils.ts #3648

@github-actions

Description

@github-actions

API Surface Issue

Category

Unused export

Summary

  • File: src/commands/test-helpers.test-utils.ts
  • Symbol: EMPTY_STATS
  • Issue: Exported constant that is only used internally within the same file

Evidence

The EMPTY_STATS constant is exported on line 11 but is never imported by any other module:

export const EMPTY_STATS: AggregatedStats = {
  totalRequests: 0,
  allowedRequests: 0,
  deniedRequests: 0,
  uniqueDomains: 0,
  byDomain: new Map(),
  timeRange: null,
};

Internal usage only: The constant is used within the same file on line 22 in the createEmptyStats() helper function:

function createEmptyStats(): AggregatedStats {
  return {
    ...EMPTY_STATS,
    byDomain: new Map(),
  };
}

Verification: A comprehensive search across the codebase confirms no external imports:

$ grep -r "import.*EMPTY_STATS" src/ tests/ --include="*.ts"
(no results)

Recommended Fix

Remove the export keyword from the constant declaration since it's only used internally:

const EMPTY_STATS: AggregatedStats = {
  totalRequests: 0,
  allowedRequests: 0,
  deniedRequests: 0,
  uniqueDomains: 0,
  byDomain: new Map(),
  timeRange: null,
};

This keeps the internal helper clean while removing unnecessary API surface area.

Impact

  • Dead code risk: Low — The constant is being used, just not exported
  • Maintenance burden: Low — Simple one-word fix
  • API clarity: Medium — Reduces public API surface by removing unused export

Detected by Export Audit workflow. Triggered by push to main on 2026-05-23

Generated by API Surface & Export Audit · ● 5M ·

  • expires on Jun 22, 2026, 5: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