const isUndefined = (val) => typeof val === "undefined";
const isNull = (val) => val === null;
const isNil = (val) => isUndefined(val) || isNull(val);
const isDefined = (val) => !isNil(val);
const isString = (val) => typeof val === "string";
const hasLength = (val) => isDefined(val) && val.length > 0;
const isStringFull = (val) => isString(val) && hasLength(val);
const isArrayFull = (val) => Array.isArray(val) && hasLength(val);
const isObject = (val) => typeof val === "object" && !isNull(val);
const isObjectFull = (val) => isObject(val) && hasLength(Object.keys(val));
const isNumber = (val) => typeof val === "number" && !Number.isNaN(val) && Number.isFinite(val);
const isNumeric = (val) => isString(val) && /^[+-]?([0-9]*[.])?[0-9]+$/.test(val);
const isNumberLike = (val) => isNumber(val) || isNumeric(val);
const isFunction = (val) => typeof val === "function";

export { hasLength, isArrayFull, isDefined, isFunction, isNil, isNull, isNumber, isNumberLike, isNumeric, isObject, isObjectFull, isString, isStringFull, isUndefined };
