Convert an object to camel case
const camelcasify = require('camelcasify');
const src = {
content_id: 123,
parent_content: {
nested_attr: {
nested_nested_attr: [
{
content_id: 1
},
{
content_types: ['movie', 'episode']
}
]
}
}
};
console.log(camelcasify(src));
// output
/**
{
contentId: 123,
parentContent: {
nestedAttr: {
nestedNestedAttr: [
{
contentId: 1
},
{
contentTypes: ['movie', 'episode']
}
]
}
}
};
**/
MIT