Skip to content

Commit

Permalink
Fix createMapper with inherit as plain object
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-suhas committed Dec 13, 2017
1 parent 42f918c commit 64aed86
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/mapParentConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,20 @@ 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)) {
return 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
Expand Down

0 comments on commit 64aed86

Please sign in to comment.