toType
[ Function ]
Version 1.8
public static toType(
value: any,
typeString: string
): any | null;
Version 1.12
public static toType(
value: any,
typeName: string,
options?: {
readonly convertDirection?: ValueConverter.ConvertDirection;
}
): any | null;
Converts any compatible value to a type defined by a type schema.
Parameter
Name | Type | Description |
---|---|---|
value | The value to convert. | |
Version 1.8 typeString Version 1.12 typeName | The name of the type schema. | |
options [ optional ] Available from version 1.12
| { | Settings |
Return value
Type | Description |
---|---|
The value corresponding to the type schema name or null in the event of an error. |
Available from 1.8 |