Miss any of our Open RFC calls?Watch the recordings here! »

paramcase-keys

0.1.0 • Public • Published

paramcase-keys

Convert object keys to paramCase using param-case

Install

$ npm install paramcase-keys

Usage

const paramcaseKeys = require("paramcase-keys")
 
// Convert an object
paramcaseKeys({ fooBar: true })
//=> { "foo-bar": true }
 
// Convert an array of objects
paramcaseKeys([{ fooBar: true }, { barFoo: false }])
//=> [{ "foo-bar": true }, { "bar-foo": false }]
 
paramcaseKeys({ fooBar: true, nested: { unicorn_rainbow: true } }, { deep: true })
//=> { "foo-bar": true, nested: { "unicorn-rainbow": true } }

API

paramcaseKeys(input, [options])

input

Type: Object Object[]

Object or array of objects to paramCase.

options

Type: Object

exclude

Type: Array<string|RegExp>
Default: []

Exclude keys from being paramCased.

deep

Type: boolean
Default: false

Recurse nested objects and objects in arrays.

Related

License

MIT

Install

npm i paramcase-keys

DownloadsWeekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

3.08 kB

Total Files

3

Last publish

Collaborators

  • avatar