lamassu-server/packages/server/lib/utils.js
2025-05-12 15:35:00 +01:00

10 lines
308 B
JavaScript

const _ = require('lodash')
const camelize = obj =>
_.transform(obj, (acc, value, key, target) => {
const camelKey = _.isArray(target) ? key : _.camelCase(key.toString())
acc[camelKey] =
_.isObject(value) && !(value instanceof Date) ? camelize(value) : value
})
module.exports = camelize