"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.isDataTypeOf = exports.getDataType = 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); }

var dataTypes = {
  "number": "number",
  "array": "array",
  "string": "string",
  "object": "object",
  "bigint": "bigint",
  "symbol": "symbol",
  "undefined": "undefined",
  "function": "function",
  "boolean": "boolean"
};

var getDataType = function getDataType(data) {
  var typeofData = _typeof(data);

  var isArrayDataType = Array.isArray(data);

  if (isArrayDataType) {
    return dataTypes.array;
  } else {
    return dataTypes[typeofData];
  }
};

exports.getDataType = getDataType;

var isDataTypeOf = function isDataTypeOf(data, type) {
  return getDataType(data) === type;
};

exports.isDataTypeOf = isDataTypeOf;
var _default = dataTypes;
exports["default"] = _default;