c871080666cd7b48ccb439735e95ea9ecdb0a337
[yaffs-website] / node_modules / uncss / node_modules / lodash / isObject.js
1 /**
2  * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
3  * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
4  *
5  * @static
6  * @memberOf _
7  * @category Lang
8  * @param {*} value The value to check.
9  * @returns {boolean} Returns `true` if `value` is an object, else `false`.
10  * @example
11  *
12  * _.isObject({});
13  * // => true
14  *
15  * _.isObject([1, 2, 3]);
16  * // => true
17  *
18  * _.isObject(_.noop);
19  * // => true
20  *
21  * _.isObject(null);
22  * // => false
23  */
24 function isObject(value) {
25   // Avoid a V8 JIT bug in Chrome 19-20.
26   // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
27   var type = typeof value;
28   return !!value && (type == 'object' || type == 'function');
29 }
30
31 module.exports = isObject;