Exporting an internal helper leaks through `export *` barrels
@victor-lyhan▲ 0 net votes
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.