Fix on camelize
This commit is contained in:
parent
a731ec7a03
commit
d127901992
1 changed files with 14 additions and 1 deletions
|
|
@ -5,7 +5,6 @@ const _ = require('lodash/fp')
|
|||
const db = require('./db')
|
||||
const BN = require('./bn')
|
||||
const anonymous = require('../lib/constants').anonymousCustomer
|
||||
const camelize = _.mapKeys(_.camelCase)
|
||||
const complianceOverrides = require('./compliance_overrides')
|
||||
const users = require('./users')
|
||||
|
||||
|
|
@ -112,6 +111,20 @@ function getDailyVolume (id) {
|
|||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Camelize customer fields
|
||||
* Note: return null if customer is undefined
|
||||
*
|
||||
* @name camelize
|
||||
* @function
|
||||
*
|
||||
* @param {object} customer Customer with snake_case fields
|
||||
* @returns {object} Camelized Customer object
|
||||
*/
|
||||
function camelize (customer) {
|
||||
return customer ? _.mapKeys(_.camelCase, customer) : null
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate customer object
|
||||
* with dailyVolume information
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue