Ya he tenido una función funcionando correctamente.
const camelizeKeys = (obj: any): any => { if (Array.isArray(obj)) { return obj.map((v) => camelizeKeys(v)) // camelizeKeys is a function in lodash. } else if (obj != null && obj.constructor === Object) { return Object.keys(obj).reduce( (result, key) => ({ ...result, [camelCase(key)]: camelizeKeys(obj[key]) }), {} ) } return obj }Sin embargo, usó any explícito en el tipo de parámetro y valor de retorno. ¿Es posible expresar el tipo de una mejor manera (por ejemplo, inferir el tipo de valor de retorno del tipo de parámetro)?