decamelize-keys-deep2

0.0.2 • Public • Published

decamelize-keys-deep2

Deeply convert the camelized keys of an object into a lowercased one with a custom separator
Example: {unicornRainbow: {fooBar: 1}}{unicorn_rainbow: {foo_bar: 1}}

Install

$ npm install --save decamelize-keys-deep2
or
$ yarn add decamelize-keys-deep2

Usage

const decamelizeKeysDeep = require('decamelize-keys-deep2');

decamelizeKeysDeep({unicornRainbow: {fooBar: 1}});
//=> {unicorn_rainbow: {foo_bar: 1}}

decamelizeKeysDeep({unicornRainbow: {fooBar: 1}}, '-');
//=> {unicorn-rainbow: {foo-bar: 1}}

API

decamelizeKeysDeep2(input, [separator])

input

Type: object

separator

Type: string
Default: _

Related

See camelcase-keys-deep for the inverse.

License

MIT © Rafael Xavier de Souza

Package Sidebar

Install

npm i decamelize-keys-deep2

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

2.85 kB

Total Files

3

Last publish

Collaborators

  • fclemonschool