stack

Home > @infiniteobjects/core-library-web > Cast

Cast class

Utilities to cast values.

Signature:

export declare class Cast 

Methods

Method Modifiers Description
asArray(val) static Cast the given value to an array if is needed.
asBoolean(val) static Cast the given value as a boolean
asEnumeration(val, enumeration) static Cast the given value to an enumeration value.
asNumber(val, integer) static Cast the given value as a number
asPlainObject(obj) static Cast the given value as a plain object, You can use Generic types to assert an specific Type
asString(val) static Cast the given value as a string