You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
740 B
34 lines
740 B
2 years ago
|
import isArrayLike from './isArrayLike.js';
|
||
|
import isObjectLike from './isObjectLike.js';
|
||
|
|
||
|
/**
|
||
|
* This method is like `_.isArrayLike` except that it also checks if `value`
|
||
|
* is an object.
|
||
|
*
|
||
|
* @static
|
||
|
* @memberOf _
|
||
|
* @since 4.0.0
|
||
|
* @category Lang
|
||
|
* @param {*} value The value to check.
|
||
|
* @returns {boolean} Returns `true` if `value` is an array-like object,
|
||
|
* else `false`.
|
||
|
* @example
|
||
|
*
|
||
|
* _.isArrayLikeObject([1, 2, 3]);
|
||
|
* // => true
|
||
|
*
|
||
|
* _.isArrayLikeObject(document.body.children);
|
||
|
* // => true
|
||
|
*
|
||
|
* _.isArrayLikeObject('abc');
|
||
|
* // => false
|
||
|
*
|
||
|
* _.isArrayLikeObject(_.noop);
|
||
|
* // => false
|
||
|
*/
|
||
|
function isArrayLikeObject(value) {
|
||
|
return isObjectLike(value) && isArrayLike(value);
|
||
|
}
|
||
|
|
||
|
export default isArrayLikeObject;
|