https://github.com/glennreyes/map-keys-deep
🔑 Maps object keys recursively
https://github.com/glennreyes/map-keys-deep
lodash loop utilities
Last synced: 11 months ago
JSON representation
🔑 Maps object keys recursively
- Host: GitHub
- URL: https://github.com/glennreyes/map-keys-deep
- Owner: glennreyes
- License: mit
- Created: 2018-07-04T18:58:29.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T01:27:01.000Z (about 3 years ago)
- Last Synced: 2025-02-28T20:58:05.836Z (12 months ago)
- Topics: lodash, loop, utilities
- Language: JavaScript
- Size: 1.01 MB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# map-keys-deep
[](https://travis-ci.org/glennreyes/map-keys-deep) [](https://coveralls.io/github/glennreyes/map-keys-deep?branch=master)
🔑 Maps object keys recursively, like [`mapKeys`](https://lodash.com/docs/#mapKeys) by Lodash but recursive.
# Usage
## Install
```
yarn add map-keys-deep
```
## Simple sample usage
```js
import mapKeysDeep from 'map-keys-deep';
mapKeysDeep({ Hello: { World: true } }, keys => keys.toLowerCase());
// { hello: { world: true } }
```
## FP style
```js
import { camelCase } from 'lodash/fp';
import mapKeysDeep from 'map-keys-deep/fp';
mapKeysDeep(camelCase)({ hello_world: { bye_world: true } });
// { helloWorld: { byeWorld: true } }
mapKeysDeep(keys => keys.toLowerCase())({ Hello: { World: true } });
// { hello: { world: true } }
```
## Test
```js
yarn jest
```
# License
MIT