PrimitiveConverter
Hierarchy
- PrimitiveConverter
Implements
- TypeConverter
- TypeConverter
Index
Methods
Object literals
Methods
convert
▸ convert(reflectedType
: tsruntimeTypes.ReflectedType): InstanceOf
Converts reflected type to primitive type constructor or value wrapped in pattern for validation.
Parameters:
Name | Type | Description |
---|---|---|
reflectedType | tsruntimeTypes.ReflectedType | Reflected type. |
Returns: InstanceOf
Returns converted reflected type as primitive constructor wrapped in InstanceOf
pattern.
isConvertible
▸ isConvertible(reflectedType
: tsruntimeTypes.ReflectedType): boolean
Evaluates if provided reflected type is a primitive type constructor.
Parameters:
Name | Type | Description |
---|---|---|
reflectedType | tsruntimeTypes.ReflectedType | Reflected type. |
Returns: boolean
Returns true
if reflected type is a primitive type constructor, else false
.
reflect
▸ reflect(reflectedType
: tsruntimeTypes.ReflectedType): string | number | boolean | symbol
Reflects type to primitive type constructor.
Parameters:
Name | Type | Description |
---|---|---|
reflectedType | tsruntimeTypes.ReflectedType | Reflected type. |
Returns: string | number | boolean | symbol
Returns primitive type constructor.
Object literals
Static
MAPPINGS
▪ MAPPINGS: object
10
• 10: SymbolConstructor = Symbol
2
• 2: StringConstructor = String
3
• 3: NumberConstructor = Number
4
• 4: BooleanConstructor = Boolean