@unction/mapkeys
TypeScript icon, indicating that this package has built-in type declarations

10.13.0 • Public • Published

@unction/mapKeys

Tests Stability Dependencies

MapperFunctionType<A, B> => Array | Set | Record<string | number | symbol, B> | Map<B, A> | string => KeyedArray | Set | Record<string | number | symbol, unknown> | Map<B, unknown> | string

Map over a keyed functor's keys and return a new keyed functor having mapped the keys

const attributes = {
  name: "Kurtis Rainbolt-Greene",
  createdAt: new Date()
}

mapKeys(kebab)(attributes)

Would return:

{
  name: "Kurtis Rainbolt-Greene",
  "created-at": new Date()
}

Readme

Keywords

Package Sidebar

Install

npm i @unction/mapkeys

Weekly Downloads

5

Version

10.13.0

License

SEE LICENSE IN LICENSE

Unpacked Size

16.7 kB

Total Files

7

Last publish

Collaborators

  • krainboltgreene