object-key-transformer
v0.0.5
Published
object key transformer
Downloads
6
Maintainers
Readme
Object key transformer
Changing object keys
How to use
import objectTransformer from '@/index'
import {capitalize} from 'lodash'
const result = objectTransformer({
foo: 'foo',
bar: 'bar',
john: [
{
foo: 'foo',
bar: 'bar'
}
]
}, capitalize, true) // last argument is for deeply transforming objects
console.log(result) // -> {Foo: 'foo', Bar: 'bar', John: {Foo: 'foo', Bar: 'bar'}}
js Files
CDN
<script type="text/javascript" src="https://unpkg.com/object-key-transformer@${npm version}/dist
/index.umd.js
"></script>
<script>
var result = ObjectKeyTransformer({/* ... */})
</script>
module
import objectKeyTransformer from 'object-key-transformer'
const result = objectKeyTransformer({/* ... */})