From 64aed86b462222c9b7baa74bd4ee2af5a9df8dc8 Mon Sep 17 00:00:00 2001 From: Suhas Karanth Date: Wed, 13 Dec 2017 08:52:15 +0530 Subject: [PATCH] Fix createMapper with inherit as plain object --- src/mapParentConfig.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/mapParentConfig.js b/src/mapParentConfig.js index f2afe32..14dcd15 100644 --- a/src/mapParentConfig.js +++ b/src/mapParentConfig.js @@ -12,9 +12,7 @@ import { safeClone } from './utils'; const defaultExclude = ['plugins']; -const createDefaultMapper = ({ exclude }) => parentConfig => { - return omit(parentConfig, exclude); -}; +const createDefaultMapper = exclude => parentConfig => omit(parentConfig, exclude); const createMapper = inherit => { if (isFunction(inherit)) { @@ -22,12 +20,12 @@ const createMapper = inherit => { } if (isPlainObject(inherit)) { - let exclude = isArray(inherit.exclude) ? inherit.exclude : defaultExclude; + const exclude = isArray(inherit.exclude) ? inherit.exclude : defaultExclude; return createDefaultMapper(exclude); } if (inherit === true) { - return createDefaultMapper({ exclude: defaultExclude }); + return createDefaultMapper(defaultExclude); } // do not inherit