diff --git a/lib/index.js b/lib/index.js index 70cf7f5..51cf607 100644 --- a/lib/index.js +++ b/lib/index.js @@ -27,14 +27,10 @@ var _lodash3 = require('lodash.throttle'); var _lodash4 = _interopRequireDefault(_lodash3); -var _lodash5 = require('lodash.isarray'); +var _lodash5 = require('lodash.isfunction'); var _lodash6 = _interopRequireDefault(_lodash5); -var _lodash7 = require('lodash.isfunction'); - -var _lodash8 = _interopRequireDefault(_lodash7); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } @@ -61,7 +57,7 @@ var styles = { */ function convertChildrenToArray(children) { if (!children) return []; - if (!(0, _lodash6.default)(children)) return [children]; + if (!Array.isArray(children)) return [children]; return children; } @@ -130,7 +126,7 @@ var ResizeDetector = function (_PureComponent) { return convertChildrenToArray(children).filter(function (child) { return !!child; }).map(function (child, key) { - if ((0, _lodash8.default)(child)) return (0, _react.cloneElement)(child(width, height), { key: key }); + if ((0, _lodash6.default)(child)) return (0, _react.cloneElement)(child(width, height), { key: key }); if ((0, _react.isValidElement)(child)) return (0, _react.cloneElement)(child, { width: width, height: height, key: key }); return child; }); diff --git a/package.json b/package.json index e7c621f..7bd8e59 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,6 @@ }, "dependencies": { "lodash.debounce": "^4.0.8", - "lodash.isarray": "^4.0.0", "lodash.isfunction": "^3.0.9", "lodash.throttle": "^4.1.1", "prop-types": "^15.6.1", diff --git a/src/index.js b/src/index.js index f2520a8..8a86473 100644 --- a/src/index.js +++ b/src/index.js @@ -3,7 +3,6 @@ import PropTypes from 'prop-types'; import ResizeObserver from 'resize-observer-polyfill'; import debounce from 'lodash.debounce'; import throttle from 'lodash.throttle'; -import isArray from 'lodash.isarray'; import isFunction from 'lodash.isfunction'; const listMode = { debounce, throttle }; @@ -22,7 +21,7 @@ const styles = { */ function convertChildrenToArray(children) { if (!children) return []; - if (!isArray(children)) return [children]; + if (!Array.isArray(children)) return [children]; return children; }