}
};
+/** Returns whether the provided value is arraylike. */
+export const isArraylikeObject = ($) => {
+ if (type($) !== "object") {
+ return false;
+ } else {
+ try {
+ lengthOfArraylike($); // throws if not arraylike
+ return true;
+ } catch {
+ return false;
+ }
+ }
+};
+
/**
* Returns whether the provided object is a collection.
*
* This can produce larger lengths than can actually be stored in
* arrays, because no such restrictions exist on arraylike methods.
*/
-export const lengthOfArrayLike = ({ length }) => toLength(length);
+export const lengthOfArraylike = ({ length }) => toLength(length);
/**
* Returns the result of mapping the provided value with the provided