https://github.com/mits87/transform-keys-deep
Deeply transform object keys to camelCase or snake_case.
https://github.com/mits87/transform-keys-deep
Last synced: about 1 year ago
JSON representation
Deeply transform object keys to camelCase or snake_case.
- Host: GitHub
- URL: https://github.com/mits87/transform-keys-deep
- Owner: mits87
- Created: 2020-01-04T21:53:49.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T04:52:34.000Z (over 3 years ago)
- Last Synced: 2025-03-18T15:03:50.774Z (about 1 year ago)
- Language: JavaScript
- Size: 630 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# transform-keys-deep
> Deeply convert object keys from snakecase to camelcase and and other way around
> Example: `{unicornRainbow: {fooBar: 1}}` → `{unicorn_rainbow: {foo_bar: 1}}`
## Install
```
$ npm install --save transform-keys-deep
```
## Usage
```js
const { camelcaseKeysDeep, snakecaseKeysDeep } = require('transform-keys-deep');
snakecaseKeysDeep({unicornRainbow: {fooBar: 1}});
//=> {unicorn_rainbow: {foo_bar: 1}}
camelcaseKeysDeep({unicorn_rainbow: {foo_bar: 1}});
//=> {unicornRainbow: {fooBar: 1}}
```