export function rowToObject ( obj ) { return Object . keys ( obj ) . reduce ( ( acc , key ) => ( { ... acc , [ snakeToCamelCase ( key ) ] : obj [ key ] } ) , { } ) ; } function snakeToCamelCase ( input ) { const [ first , ... parts ] = input . split ( '_' ) ; const titleCased = parts . map ( s => { const [ init , ... rest ] = Array . from ( s ) ; return [ init . toUpperCase ( ) , ... rest ] . join ( '' ) ; } ) ; return [ first , ... titleCased ] . join ( '' ) ; }