Bug Report
Description
The documentation at https://es-toolkit.dev/reference/map/keyBy.html lists keyBy under the map category, which implies it should be importable via the es-toolkit/map subpath. However, attempting to do so produces a TypeScript error:
import { keyBy } from "es-toolkit/map";
// Module '"es-toolkit/map"' has no exported member 'keyBy'.ts(2305)
Steps to Reproduce
- Install
es-toolkit@1.45.1
- Import
keyBy from the map subpath:
import { keyBy } from "es-toolkit/map";
- Observe TS error:
Module '"es-toolkit/map"' has no exported member 'keyBy'.ts(2305)
Root Cause
Inspecting dist/map/index.d.ts (and .d.mts) in the published package, keyBy is not re-exported:
export { every } from './every.js';
export { filter } from './filter.js';
export { findKey } from './findKey.js';
export { findValue } from './findValue.js';
export { hasValue } from './hasValue.js';
export { mapKeys } from './mapKeys.js';
export { mapValues } from './mapValues.js';
export { reduce } from './reduce.js';
export { some } from './some.js';
// ← keyBy is missing
There is also no keyBy.d.ts / keyBy.js file under dist/map/.
Environment
|
|
es-toolkit version |
1.45.1 |
| Node.js version |
v25.8.0 |
| TypeScript |
latest |
| Package manager |
pnpm |
Bug Report
Description
The documentation at https://es-toolkit.dev/reference/map/keyBy.html lists
keyByunder themapcategory, which implies it should be importable via thees-toolkit/mapsubpath. However, attempting to do so produces a TypeScript error:Steps to Reproduce
es-toolkit@1.45.1keyByfrom themapsubpath:Module '"es-toolkit/map"' has no exported member 'keyBy'.ts(2305)Root Cause
Inspecting
dist/map/index.d.ts(and.d.mts) in the published package,keyByis not re-exported:There is also no
keyBy.d.ts/keyBy.jsfile underdist/map/.Environment
es-toolkitversion1.45.1v25.8.0pnpm