UNPKG

haw-utils

Version:

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

36 lines (34 loc) 983 B
(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.isType = 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; var toString = Object.prototype.toString; /** * 检测值的 `toString` 类型 * * @private * @since 1.1.0 * @param {*} value 检查值 * @param {String} typename 类型名称 * @returns {Boolean} 返回值的 `toString` 类型是否匹配 */ function isType(value, typename) { return toString.call(value) === "[object ".concat(typename, "]"); } var _default = isType; _exports["default"] = _default; });