Skip to content

Commit

Permalink
Merge pull request #93 from asfktz/fix-createMapper
Browse files Browse the repository at this point in the history
Fix createMapper with inherit as plain object
  • Loading branch information
asfktz committed Dec 13, 2017
2 parents 42f918c + 64aed86 commit 611b6f2
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 611b6f2

Please sign in to comment.