Module: util/type-checks-basic

A module with functions that perform runtime type checks. There are very simple checks such as isString(), there also are complex checks.

Source:

Methods

(static) isObject(thing) → {boolean}

Parameters:
Name Type Description
thing *
Source:
Returns:

Type: boolean

(static) isString(thing) → {boolean}

Parameters:
Name Type Description
thing *
Source:
Returns:

Type: boolean

(static) isSymbol(thing) → {boolean}

Parameters:
Name Type Description
thing *
Source:
Returns:

Type: boolean

(static) isNumber(thing) → {boolean}

Parameters:
Name Type Description
thing *
Source:
Returns:

Type: boolean

(static) isInteger(thing) → {boolean}

Parameters:
Name Type Description
thing *

Type-safety adding front end for Number.isInteger.

The reason for not simply using Number.isInteger as-is is that this function adds the type safety. When we only use Number.isInteger directly we still got "can be undefined" errors from the tested value in an && chain conditional expression.

Source:
Returns:

Type: boolean

(static) isFunction(thing) → {boolean}

Parameters:
Name Type Description
thing *
Source:
Returns:

Type: boolean

(static) getObjTypeName(o) → {string}

Parameters:
Name Type Description
o *

Any object or value

Returns the value of an object's Symbol.toStringTag http://2ality.com/2015/09/well-known-symbols-es6.html#symboltostringtag-string

Source:
Returns:

Type: string