Converts value into an object type specified by Type Code or returns null when conversion is not possible.
the TypeCode for the data type into which 'value' is to be converted.
the value to convert.
object value of type corresponding to TypeCode, or null when conversion is not supported.
Converts a TypeCode into its string name.
the TypeCode to convert into a string.
the name of the TypeCode passed as a string value.
Converts value into an object type specified by Type Code or returns type default when conversion is not possible.
the TypeCode for the data type into which 'value' is to be converted.
the value to convert.
object value of type corresponding to TypeCode, or type default when conversion is not supported.
Gets TypeCode for specific value.
value whose TypeCode is to be resolved.
the TypeCode that corresponds to the passed object's type.
Converts value into an object type specified by Type Code or returns default value when conversion is not possible.
the TypeCode for the data type into which 'value' is to be converted.
the value to convert.
the default value to return if conversion is not possible (returns null).
object value of type corresponding to TypeCode, or default value when conversion is not supported.
Generated using TypeDoc
Converts arbitrary values into objects specific by TypeCodes. For each TypeCode this class calls corresponding converter which applies extended conversion rules to convert the values.
TypeCode
Example
let value1 = TypeConverter.toType(TypeCode.Integer, "123.456"); // Result: 123 let value2 = TypeConverter.toType(TypeCode.DateTime, 123); // Result: Date(123) let value3 = TypeConverter.toType(TypeCode.Boolean, "F"); // Result: false