Skip to content

mapKeys

mapKeys(f): <A>(data) => Readonly<Record<string, A>>

Defined in: Utils/Rec.ts:241

Transforms each key while preserving values. If two keys map to the same new key, the last one wins.

(key) => string

<A>(data): Readonly<Record<string, A>>

A

Readonly<Record<string, A>>

Readonly<Record<string, A>>

pipe({ firstName: "Alice", lastName: "Smith" }, Rec.mapKeys(k => k.toUpperCase()));
// { FIRSTNAME: "Alice", LASTNAME: "Smith" }