/**
 * Checks whether given value's type is one of a few Error or Error-like
 *  isError .
 *
 *  param wat returns import { getGlobalObject } from './misc' ; const global = getGlobalObject ( ) ; export function isError ( wat ) { switch ( Object . prototype . toString . call ( wat ) ) { case '[object Error]' : return true ; case '[object Exception]' : return true ; case '[object DOMException]' : return true ; default : return isInstanceOf ( wat , Error ) ; } } /**
 * Checks whether given value's type is ErrorEvent
 *  isErrorEvent .
 *
 *  param wat returns export function isErrorEvent ( wat ) { return Object . prototype . toString . call ( wat ) === '[object ErrorEvent]' ; } /**
 * Checks whether given value's type is DOMError
 *  isDOMError .
 *
 *  param wat returns export function isDOMError ( wat ) { return Object . prototype . toString . call ( wat ) === '[object DOMError]' ; } /**
 * Checks whether given value's type is DOMException
 *  isDOMException .
 *
 *  param wat returns export function isDOMException ( wat ) { return Object . prototype . toString . call ( wat ) === '[object DOMException]' ; } /**
 * Checks whether given value's type is a string
 *  isString .
 *
 *  param wat returns export function isString ( wat ) { return Object . prototype . toString . call ( wat ) === '[object String]' ; } /**
 * Checks whether given value's is a primitive (undefined, null, number, boolean, string)
 *  isPrimitive .
 *
 *  param wat returns export function isPrimitive ( wat ) { return wat === null || ( typeof wat !== 'object' && typeof wat !== 'function' ) ; } /**
 * Checks whether given value's type is an object literal
 *  isPlainObject .
 *
 *  param wat returns export function isPlainObject ( wat ) { return Object . prototype . toString . call ( wat ) === '[object Object]' ; } /**
 * Checks whether given value's type is an Event instance
 *  isEvent .
 *
 *  param wat returns export function isEvent ( wat ) { return typeof Event !== 'undefined' && isInstanceOf ( wat , Event ) ; } /**
 * Checks whether given value's type is an Element instance
 *  isElement .
 *
 *  param wat returns export function isElement ( wat ) { return typeof Element !== 'undefined' && isInstanceOf ( wat , Element ) ; } /**
 * Checks whether given value's type is an regexp
 *  isRegExp .
 *
 *  param wat returns export function isRegExp ( wat ) { return Object . prototype . toString . call ( wat ) === '[object RegExp]' ; } param wat export function isThenable ( wat ) { return Boolean ( wat && wat . then && typeof wat . then === 'function' ) ; } /**
 * Checks whether given value's type is a SyntheticEvent
 *  isSyntheticEvent .
 *
 *  param wat returns export function isSyntheticEvent ( wat ) { return isPlainObject ( wat ) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat ; } /**
 * Checks whether given value's type is an instance of provided constructor.
 *  isInstanceOf .
 *
 *  param wat param base returns export function isInstanceOf ( wat , base ) { try { return wat instanceof base ; } catch ( _e ) { return false ; } } export function is ( o ) { return Object . prototype . toString . call ( o ) . slice ( 8 , - 1 ) ; } export function isSameOrigin ( url ) { try { const loc = global . location ; const a = document . createElement ( 'a' ) ; a . href = url ; return a . hostname == loc . hostname && a . port == loc . port && a . protocol == loc . protocol ; } catch ( e ) { return false ; } }