let parseProducts and formatProductsFilter get the real profile 🐛

This commit is contained in:
Jannis R 2018-03-18 00:17:10 +01:00
parent 854b0bd35e
commit ccd2dc0783
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5

View file

@ -12,10 +12,14 @@ const _request = require('./lib/request')
const isNonEmptyString = str => 'string' === typeof str && str.length > 0 const isNonEmptyString = str => 'string' === typeof str && str.length > 0
const createClient = (profile, request = _request) => { const createClient = (_profile, request = _request) => {
profile = Object.assign({ profile = Object.assign({}, defaultProfile, profile)
parseProducts: createParseBitmask(profile), if (!profile.parseProducts) {
formatProductsFilter: createFormatProductsFilter(profile) profile.parseProducts = createParseBitmask(profile)
}
if (!profile.formatProductsFilter) {
profile.formatProductsFilter = createFormatProductsFilter(profile)
}
}, defaultProfile, profile) }, defaultProfile, profile)
validateProfile(profile) validateProfile(profile)