diff --git a/modules/_createSizePropertyCheck.js b/modules/_createSizePropertyCheck.js index cc38007bc..2d18c4205 100644 --- a/modules/_createSizePropertyCheck.js +++ b/modules/_createSizePropertyCheck.js @@ -1,9 +1,15 @@ -import { MAX_ARRAY_INDEX } from './_setup.js'; +import { MAX_ARRAY_INDEX } from "./_setup.js"; +import isFunction from "./isFunction"; // Common internal logic for `isArrayLike` and `isBufferLike`. export default function createSizePropertyCheck(getSizeProperty) { - return function(collection) { + return function (collection) { var sizeProperty = getSizeProperty(collection); - return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX; - } + return ( + !isFunction(collection) && + typeof sizeProperty == "number" && + sizeProperty >= 0 && + sizeProperty <= MAX_ARRAY_INDEX + ); + }; }