humanize-keys
Convert object keys to humanized words using
humanize-string
Install
$ npm install humanize-keys
Usage
const humanizeKeys = ; // Convert an object;//=> {'Foo bar': true} // Convert an array of objects;//=> [{'Foo bar': true}, {'Bar foo': false}] ;//=> {'Foo bar': true, nested: {'Unicorn rainbow': true}}
const humanizeKeys = ; const argv = processargv;//=> {_: [], 'foo-bar': true} ;//=> {_: [], 'Foo bar': true}
API
humanizeKeys(input, [options])
input
Type: Object
Object[]
Object or array of objects to humanize.
options
Type: Object
exclude
Type: Array<string|RegExp>
Default: []
Exclude keys from being humanized.
deep
Type: boolean
Default: false
Recurse nested objects and objects in arrays.
Related
License
MIT © Danier R.