"use strict";

Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.isGlobal = exports.isDocument = exports.isError = exports.isNull = exports.isUndefined = exports.isDate = exports.isSymbol = exports.isBoolean = exports.isRegExp = exports.isNumber = exports.isString = exports.isArray = exports.isFunction = exports.isObject = exports.isIt = exports.judgeType = void 0;

const judgeType = value => {
    switch (Object.prototype.toString.call(value)) {
      case "[object Object]":
        return "object";

      case "[object Function]":
        return "function";

      case "[object Array]":
        return "array";

      case "[object String]":
        return "string";

      case "[object Number]":
        return "number";

      case "[object RegExp]":
        return "regExp";

      case "[object Boolean]":
        return "boolean";

      case "[object Symbol]":
        return "symbol";

      case "[object Date]":
        return "date";

      case "[object Undefined]":
        return "undefined";

      case "[object Null]":
        return "null";

      case "[object Error]":
        return "error";

      case "[object HTMLDocument]":
        return "document";

      case "[object global]":
        return "global";

      default:
        return null;
    }
};

exports.judgeType = judgeType;

const isIt = (v, type) => (0, exports.judgeType)(v) === type;

exports.isIt = isIt;

const isObject = v => (0, exports.isIt)(v, "object");

exports.isObject = isObject;

const isFunction = v => (0, exports.isIt)(v, "function");

exports.isFunction = isFunction;

const isArray = v => (0, exports.isIt)(v, "array");

exports.isArray = isArray;

const isString = v => (0, exports.isIt)(v, "string");

exports.isString = isString;

const isNumber = v => (0, exports.isIt)(v, "number");

exports.isNumber = isNumber;

const isRegExp = v => (0, exports.isIt)(v, "regExp");

exports.isRegExp = isRegExp;

const isBoolean = v => (0, exports.isIt)(v, "boolean");

exports.isBoolean = isBoolean;

const isSymbol = v => (0, exports.isIt)(v, "symbol");

exports.isSymbol = isSymbol;

const isDate = v => (0, exports.isIt)(v, "date");

exports.isDate = isDate;

const isUndefined = v => (0, exports.isIt)(v, "undefined");

exports.isUndefined = isUndefined;

const isNull = v => (0, exports.isIt)(v, "null");

exports.isNull = isNull;

const isError = v => (0, exports.isIt)(v, "error");

exports.isError = isError;

const isDocument = v => (0, exports.isIt)(v, "document");

exports.isDocument = isDocument;

const isGlobal = v => (0, exports.isIt)(v, "global");

exports.isGlobal = isGlobal;
//# sourceMappingURL=isx.js.map