Version 1
[yaffs-website] / node_modules / uncss / node_modules / lodash / isObjectLike.js
1 /**
2  * Checks if `value` is object-like. A value is object-like if it's not `null`
3  * and has a `typeof` result of "object".
4  *
5  * @static
6  * @memberOf _
7  * @category Lang
8  * @param {*} value The value to check.
9  * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
10  * @example
11  *
12  * _.isObjectLike({});
13  * // => true
14  *
15  * _.isObjectLike([1, 2, 3]);
16  * // => true
17  *
18  * _.isObjectLike(_.noop);
19  * // => false
20  *
21  * _.isObjectLike(null);
22  * // => false
23  */
24 function isObjectLike(value) {
25   return !!value && typeof value == 'object';
26 }
27
28 module.exports = isObjectLike;