import { Types , UtilObject } from '../types/utils' ; const toString = Object . prototype . toString ; const typeOf = ( val , typeName ) => has ( toString . call ( val ) , typeName ) ; export function isNumber ( val ) { return typeOf ( val , 'Number' ) && ! Number . isNaN ( val ) ; } export function isObject < T = UtilObject > ( val ) { return typeOf ( val , 'Object' ) ; } export function isDate ( val ) { return typeOf ( val , 'Date' ) ; } export function isFunc < T = string > ( val ) { return typeOf ( val , 'Function' ) ; } export function isString ( val ) { return typeOf ( val , 'String' ) ; } export function isBoolean ( val ) { return typeOf ( val , 'Boolean' ) ; } export function isArray < T = unknown > ( val ) { return Array . isArray ( val ) ; } export function has < T extends string > ( target , val ) { if ( isArray ( val ) ) return val . some ( ( v ) => has ( target , v ) ) ; return target . indexOf ( val as never ) > - 1 ; } export function not ( target , val ) { if ( isArray ( val ) ) return val . every ( ( v ) => ! has ( target , v ) ) ; return ! has ( target , val ) ; }