Skip to content

Instantly share code, notes, and snippets.

✌️
What's happening?

Gregorio Galante gregogalante

✌️
What's happening?
Block or report user

Report or block gregogalante

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gregogalante
gregogalante / SnakeToCamelCase.js
Last active Mar 5, 2018 — forked from emcmanus/snakeToCamelCase.js
ES6 module to recursively convert snake case keys in an object to camel case using lodash.
View SnakeToCamelCase.js
export function camelCaseKeys(object) {
let camelCaseObject = _.cloneDeep(object)
if (_.isArray(camelCaseObject)) {
return _.map(camelCaseObject, camelCaseKeys)
}
if (_.isString(camelCaseObject)) {
return camelCaseObject
}
camelCaseObject = _.mapKeys(camelCaseObject, (value, key) => _.camelCase(key))
You can’t perform that action at this time.