UNPKG

haw-utils

Version:

一个基于业务场景的工具方法库

46 lines (45 loc) 1.4 kB
(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { factory(exports); } else { var mod = { exports: {} }; factory(mod.exports); global.isObject = mod.exports; } })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports["default"] = void 0; function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } /** * 检查值是否为Object * * @static * @alias module:Type.isObject * @since 1.1.0 * @param {*} value 检查值 * @returns {Boolean} 是否为Object * @example * * isObject({}) * // => true * * isObject([1,2,3]) * // => true * * isObject(null) * // => false */ function isObject(value) { var type = _typeof(value); return value != null && (type === 'object' || type === 'function'); } var _default = isObject; _exports["default"] = _default; });