Changing object keys
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'}}
<script type="text/javascript" src="https://unpkg.com/object-key-transformer@${npm version}/dist
/index.umd.js
"></script>
<script>
var result = ObjectKeyTransformer({/* ... */})
</script>
import objectKeyTransformer from 'object-key-transformer'
const result = objectKeyTransformer({/* ... */})