const camelCase = require('lodash/camelCase');
/**
* Force object key to camelCase
* @param {object} obj
* @return {object} newObj
*/
const toCamelCase = obj => reduce(obj, (newObj, value, key) => {
newObj[camelCase(key)] = value;
return newObj;
}, {});
Created
January 24, 2018 14:17
-
-
Save Ugarz/d21742050df9495bf67615519a6e178b to your computer and use it in GitHub Desktop.
Javascript tricks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment