var f = [
  "innerHTML",
  "ownerDocument",
  "style",
  "attributes",
  "nodeValue"
], s = [
  "Array",
  "ArrayBuffer",
  "AsyncFunction",
  "AsyncGenerator",
  "AsyncGeneratorFunction",
  "Date",
  "Error",
  "Function",
  "Generator",
  "GeneratorFunction",
  "HTMLElement",
  "Map",
  "Object",
  "Promise",
  "RegExp",
  "Set",
  "WeakMap",
  "WeakSet"
], a = [
  "bigint",
  "boolean",
  "null",
  "number",
  "string",
  "symbol",
  "undefined"
];
function u(n) {
  var t = Object.prototype.toString.call(n).slice(8, -1);
  if (/HTML\w+Element/.test(t))
    return "HTMLElement";
  if (y(t))
    return t;
}
function r(n) {
  return function(t) {
    return u(t) === n;
  };
}
function y(n) {
  return s.includes(n);
}
function i(n) {
  return function(t) {
    return typeof t === n;
  };
}
function b(n) {
  return a.includes(n);
}
function e(n) {
  if (n === null)
    return "null";
  switch (typeof n) {
    case "bigint":
      return "bigint";
    case "boolean":
      return "boolean";
    case "number":
      return "number";
    case "string":
      return "string";
    case "symbol":
      return "symbol";
    case "undefined":
      return "undefined";
  }
  if (e.array(n))
    return "Array";
  if (e.plainFunction(n))
    return "Function";
  var t = u(n);
  return t || "Object";
}
e.array = Array.isArray;
e.arrayOf = function(n, t) {
  return !e.array(n) && !e.function(t) ? !1 : n.every(function(o) {
    return t(o);
  });
};
e.asyncGeneratorFunction = function(n) {
  return u(n) === "AsyncGeneratorFunction";
};
e.asyncFunction = r("AsyncFunction");
e.bigint = i("bigint");
e.boolean = function(n) {
  return n === !0 || n === !1;
};
e.date = r("Date");
e.defined = function(n) {
  return !e.undefined(n);
};
e.domElement = function(n) {
  return e.object(n) && !e.plainObject(n) && n.nodeType === 1 && e.string(n.nodeName) && f.every(function(t) {
    return t in n;
  });
};
e.empty = function(n) {
  return e.string(n) && n.length === 0 || e.array(n) && n.length === 0 || e.object(n) && !e.map(n) && !e.set(n) && Object.keys(n).length === 0 || e.set(n) && n.size === 0 || e.map(n) && n.size === 0;
};
e.error = r("Error");
e.function = i("function");
e.generator = function(n) {
  return e.iterable(n) && e.function(n.next) && e.function(n.throw);
};
e.generatorFunction = r("GeneratorFunction");
e.instanceOf = function(n, t) {
  return !n || !t ? !1 : Object.getPrototypeOf(n) === t.prototype;
};
e.iterable = function(n) {
  return !e.nullOrUndefined(n) && e.function(n[Symbol.iterator]);
};
e.map = r("Map");
e.nan = function(n) {
  return Number.isNaN(n);
};
e.null = function(n) {
  return n === null;
};
e.nullOrUndefined = function(n) {
  return e.null(n) || e.undefined(n);
};
e.number = function(n) {
  return i("number")(n) && !e.nan(n);
};
e.numericString = function(n) {
  return e.string(n) && n.length > 0 && !Number.isNaN(Number(n));
};
e.object = function(n) {
  return !e.nullOrUndefined(n) && (e.function(n) || typeof n == "object");
};
e.oneOf = function(n, t) {
  return e.array(n) ? n.indexOf(t) > -1 : !1;
};
e.plainFunction = r("Function");
e.plainObject = function(n) {
  if (u(n) !== "Object")
    return !1;
  var t = Object.getPrototypeOf(n);
  return t === null || t === Object.getPrototypeOf({});
};
e.primitive = function(n) {
  return e.null(n) || b(typeof n);
};
e.promise = r("Promise");
e.propertyOf = function(n, t, o) {
  if (!e.object(n) || !t)
    return !1;
  var c = n[t];
  return e.function(o) ? o(c) : e.defined(c);
};
e.regexp = r("RegExp");
e.set = r("Set");
e.string = i("string");
e.symbol = i("symbol");
e.undefined = i("undefined");
e.weakMap = r("WeakMap");
e.weakSet = r("WeakSet");
export {
  e as default,
  u as getObjectType
};
//# sourceMappingURL=index.js.map
