From ad4d60f3ca63874fec4f490ab7428b9195fa97ed Mon Sep 17 00:00:00 2001 From: Jannis R Date: Sun, 18 Mar 2018 00:11:51 +0100 Subject: [PATCH] allow for overwriting parseProducts & formatProductsFilter --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 4ea95c84..395f4ab0 100644 --- a/index.js +++ b/index.js @@ -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 createClient = (profile, request = _request) => { - profile = Object.assign({}, defaultProfile, profile) - profile.parseProducts = createParseBitmask(profile) - profile.formatProductsFilter = createFormatProductsFilter(profile) + profile = Object.assign({ + parseProducts: createParseBitmask(profile), + formatProductsFilter: createFormatProductsFilter(profile) + }, defaultProfile, profile) validateProfile(profile) const departures = (station, opt = {}) => {