mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
let parseProducts and formatProductsFilter get the real profile 🐛
This commit is contained in:
parent
854b0bd35e
commit
ccd2dc0783
1 changed files with 8 additions and 4 deletions
12
index.js
12
index.js
|
@ -12,10 +12,14 @@ const _request = require('./lib/request')
|
|||
|
||||
const isNonEmptyString = str => 'string' === typeof str && str.length > 0
|
||||
|
||||
const createClient = (profile, request = _request) => {
|
||||
profile = Object.assign({
|
||||
parseProducts: createParseBitmask(profile),
|
||||
formatProductsFilter: createFormatProductsFilter(profile)
|
||||
const createClient = (_profile, request = _request) => {
|
||||
profile = Object.assign({}, defaultProfile, profile)
|
||||
if (!profile.parseProducts) {
|
||||
profile.parseProducts = createParseBitmask(profile)
|
||||
}
|
||||
if (!profile.formatProductsFilter) {
|
||||
profile.formatProductsFilter = createFormatProductsFilter(profile)
|
||||
}
|
||||
}, defaultProfile, profile)
|
||||
validateProfile(profile)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue