Home > @infiniteobjects/core-library > Cast
Utilities to cast values.
Signature:
export declare class Cast
| 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 |