'use strict';

const isObject = (val) => val !== null && typeof val === 'object';
const isPromise = (val) => {
    return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
};
// eslint-disable-next-line @typescript-eslint/ban-types
const isFunction = (val) => typeof val === 'function';
const isDate = (val) => toTypeString(val) === '[object Date]';
const toTypeString = (value) => objectToString.call(value);
const objectToString = Object.prototype.toString;
const { isArray } = Array;
const isMap = (val) => toTypeString(val) === '[object Map]';
const isSet = (val) => toTypeString(val) === '[object Set]';
const isRegExp = (val) => toTypeString(val) === '[object RegExp]';
const isString = (val) => typeof val === 'string';
const isSymbol = (val) => typeof val === 'symbol';
const isPlainObject = (val) => toTypeString(val) === '[object Object]';

exports.isArray = isArray;
exports.isDate = isDate;
exports.isFunction = isFunction;
exports.isMap = isMap;
exports.isObject = isObject;
exports.isPlainObject = isPlainObject;
exports.isPromise = isPromise;
exports.isRegExp = isRegExp;
exports.isSet = isSet;
exports.isString = isString;
exports.isSymbol = isSymbol;
exports.objectToString = objectToString;
exports.toTypeString = toTypeString;
//# sourceMappingURL=is-type.js.map
