namespace Utils { const _undefined = 'undefined' ; const _object = 'object' ; const _function = 'function' ; const _string = 'string' ; const _number = 'number' ; const _boolean = 'boolean' ; export function isPrimitive ( o , excludeWrappers ? ) { switch ( typeof o ) { case _undefined : case _string : case _number : case _boolean : return true ; case _object : return ( ( o == null ) || ( ( ! excludeWrappers ) && ( isWrapper ( o ) ) ) ) ; default : return false ; } } export function isWrapper ( o ) { return ( ( o instanceof String ) || ( o instanceof Number ) || ( o instanceof Boolean ) ) ; } export function isDefined ( o ) { return ( typeof o !== _undefined ) ; } export function isObject ( o , includeWrappers ? ) { return ( ( typeof o === _object ) && ( ( includeWrappers ) || ( ! isWrapper ( o ) ) ) ) ; } export function isFunction ( o ) { return ( typeof o === _function ) ; } export function isString ( o ) { return ( ( typeof o === _string ) || ( o instanceof String ) ) ; } export function isNumber ( o ) { return ( ( typeof o === _number ) || ( o instanceof Number ) ) ; } export function isBoolean ( o ) { return ( ( typeof o === _boolean ) || ( o instanceof Boolean ) ) ; } export function isArray ( o ) { return ( o . constructor === Array ) ; } export function isNode ( o , nodeType ? ) { if ( ( typeof o !== _object ) || ( ( < Node > o ) . nodeName === undefined ) ) return false ; return ( nodeType == null ) ? ( typeof ( < Node > o ) . nodeType === _number ) : ( ( < Node > o ) . nodeType === nodeType ) ; } export function isElement ( o ) { return isNode ( o , 1 ) ; } }