Skip to content

Commit 611b6f2

Browse files
authored
Merge pull request #93 from asfktz/fix-createMapper
Fix createMapper with inherit as plain object
2 parents 42f918c + 64aed86 commit 611b6f2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/mapParentConfig.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,20 @@ import { safeClone } from './utils';
1212

1313
const defaultExclude = ['plugins'];
1414

15-
const createDefaultMapper = ({ exclude }) => parentConfig => {
16-
return omit(parentConfig, exclude);
17-
};
15+
const createDefaultMapper = exclude => parentConfig => omit(parentConfig, exclude);
1816

1917
const createMapper = inherit => {
2018
if (isFunction(inherit)) {
2119
return inherit;
2220
}
2321

2422
if (isPlainObject(inherit)) {
25-
let exclude = isArray(inherit.exclude) ? inherit.exclude : defaultExclude;
23+
const exclude = isArray(inherit.exclude) ? inherit.exclude : defaultExclude;
2624
return createDefaultMapper(exclude);
2725
}
2826

2927
if (inherit === true) {
30-
return createDefaultMapper({ exclude: defaultExclude });
28+
return createDefaultMapper(defaultExclude);
3129
}
3230

3331
// do not inherit

0 commit comments

Comments
 (0)