32 lines
797 B
JavaScript
32 lines
797 B
JavaScript
|
"use strict";
|
||
|
// @ts-nocheck
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
/**
|
||
|
* Checks if `value` is the
|
||
|
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
||
|
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
||
|
*
|
||
|
* @since 0.1.0
|
||
|
* @category Lang
|
||
|
* @param {*} value The value to check.
|
||
|
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
||
|
* @example
|
||
|
*
|
||
|
* isObject({})
|
||
|
* // => true
|
||
|
*
|
||
|
* isObject([1, 2, 3])
|
||
|
* // => true
|
||
|
*
|
||
|
* isObject(Function)
|
||
|
* // => true
|
||
|
*
|
||
|
* isObject(null)
|
||
|
* // => false
|
||
|
*/
|
||
|
function isObject(value) {
|
||
|
const type = typeof value;
|
||
|
return value != null && (type === "object" || type === "function");
|
||
|
}
|
||
|
exports.default = isObject;
|