map-keys-deep

0.0.2 • Public • Published

map-keys-deep

Build Status Coverage Status

🔑 Maps object keys recursively, like mapKeys by Lodash but recursive.

Usage

Install

yarn add map-keys-deep

Simple sample usage

import mapKeysDeep from 'map-keys-deep';
 
mapKeysDeep({ Hello: { World: true } }, keys => keys.toLowerCase());
// { hello: { world: true } }

FP style

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

yarn jest

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i map-keys-deep

Weekly Downloads

533

Version

0.0.2

License

MIT

Unpacked Size

3.16 kB

Total Files

6

Last publish

Collaborators

  • glennreyes