export function isNull ( value ) { return value === null ; } export function isObject ( value ) { return value ? typeof value === 'object' && ! Array . isArray ( value ) && ! isNull ( value ) : false ; } export function isFunction ( value ) { return value ? typeof value === 'function' : false ; } export function isString ( value ) { return typeof value === 'string' ; } export function isNumber ( value ) { return typeof value === 'number' ; } export function isBoolean ( value ) { return typeof value === 'boolean' ; } export function isArray ( value ) { return Array . isArray ( value ) ; } export function isArrayOfStrings ( value ) { if ( ! isArray ( value ) ) return false ; for ( let i = 0 ; i < value . length ; i ++ ) { if ( ! isString ( value [ i ] ) ) return false ; } return true ; } export function isUndefined ( value ) { return value === undefined ; } export function objectKeyValuesAreStrings ( value ) { if ( ! isObject ( value ) ) { return false ; } const entries = Object . entries ( value ) ; for ( let i = 0 ; i < entries . length ; i ++ ) { const [ key , entryValue ] = entries [ i ] ; if ( ! isString ( key ) || ! isString ( entryValue ) ) { return false ; } } return true ; } param value returns { boolean } const AlphaNumericUnderscore = /^[a-zA-Z0-9_]+$/ ; export function isAlphaNumericUnderscore ( value ) { return AlphaNumericUnderscore . test ( value ) ; } param url returns { boolean } const IS_VALID_URL_REGEX = /^(http|https):\/\/[^ "]+$/ ; export function isValidUrl ( url ) { return IS_VALID_URL_REGEX . test ( url ) ; } export function isValidEnum ( value , enumType ) { if ( ! Object . values ( enumType ) . includes ( value ) ) { return false ; } return true ; }