Skip to content

Commit

Permalink
Use Array.isArray instead of lodash/isArray (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
wtgtybhertgeghgtwtg authored and sudo-suhas committed Dec 25, 2017
1 parent 929aafb commit 82f6ec0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/mapParentConfig.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import omit from 'lodash/omit';
import isArray from 'lodash/isArray';
import isFunction from 'lodash/isFunction';
import cloneDeep from 'lodash/cloneDeep';
import isEqual from 'lodash/isEqual';
Expand All @@ -20,7 +19,7 @@ const createMapper = inherit => {
}

if (isPlainObject(inherit)) {
const exclude = isArray(inherit.exclude) ? inherit.exclude : defaultExclude;
const exclude = Array.isArray(inherit.exclude) ? inherit.exclude : defaultExclude;
return createDefaultMapper(exclude);
}

Expand Down
3 changes: 1 addition & 2 deletions src/normalizeEntry.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import keys from 'lodash/keys';
import isArray from 'lodash/isArray';
import isPlainObject from 'lodash/isPlainObject';

// The point of normalizeEntry is to be a little bit more forgiving than how webpack treats its entries.
Expand All @@ -11,7 +10,7 @@ const normalizeEntry = entries => {
}

return keys(entries).reduce((validEntries, key) => {
if (isArray(entries[key]) && entries[key].length) {
if (Array.isArray(entries[key]) && entries[key].length) {
validEntries[key] = entries[key];
}

Expand Down
3 changes: 1 addition & 2 deletions src/utils/safeClone.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import cloneDeepWith from 'lodash/cloneDeepWith';
import isObject from 'lodash/isObject';
import isPlainObject from 'lodash/isPlainObject';
import isArray from 'lodash/isArray';

const safeClone = config => {
return cloneDeepWith(config, value => {
if (isObject(value) && (!isPlainObject(value) && !isArray(value))) {
if (isObject(value) && (!isPlainObject(value) && !Array.isArray(value))) {
return value;
}
});
Expand Down

0 comments on commit 82f6ec0

Please sign in to comment.