object-casing
object-casing
is a package that walks throught an object using a callback function to convert the object key, returning a new object with new keys.
Install
npm i -S object-casing
Example
/*obj = { id: 1, firstName: 'some name', lastName: 'last', createdAt: new Date(),}*/ /*objToDb = { id: 1, first_name: 'some name', last_name: 'last', created_at: new Date(),}*/