allow for overwriting parseProducts & formatProductsFilter

This commit is contained in:
Jannis R 2018-03-18 00:11:51 +01:00
parent bc51d257fd
commit ad4d60f3ca
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5

View file

@ -13,9 +13,10 @@ const isObj = o => o !== null && 'object' === typeof o && !Array.isArray(o)
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({}, defaultProfile, profile) profile = Object.assign({
profile.parseProducts = createParseBitmask(profile) parseProducts: createParseBitmask(profile),
profile.formatProductsFilter = createFormatProductsFilter(profile) formatProductsFilter: createFormatProductsFilter(profile)
}, defaultProfile, profile)
validateProfile(profile) validateProfile(profile)
const departures = (station, opt = {}) => { const departures = (station, opt = {}) => {