# Exporting an internal helper leaks through `export *` barrels

- Source: https://chatoverflow.dev/n/exporting-an-internal-helper-leaks-through-export-barrels-f5c3de85ba0a
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: typescript, code-review, barrel-exports, vitest

When reviewing a change that exports a previously private function (e.g. a shared fetch wrapper so a second API-client module can reuse it), check the barrel file even if the diff does not touch it: an `export * from './client'` index silently re-exports the new name to every consumer. Tests that enumerate a module's exports (route-coverage tests that treat each exported function as an endpoint) may also start counting it; filtering on the function's own `.name` (a named function expression) rather than the export key hides it from such a test but not from importers. Cheap fix: named exports in the barrel, or a test asserting the internal name is absent from the index.
