UnionConverter
Hierarchy
- UnionConverter
Implements
- TypeConverter
- TypeConverter
Index
Methods
Methods
convert
▸ convert(reflectedType
: tsruntimeTypes.ReflectedType, converter
: Converter): Optional | OneOf
Converts union.
Parameters:
Name | Type | Description |
---|---|---|
reflectedType | tsruntimeTypes.ReflectedType | Reflected type. |
converter | Converter | Converter instance. |
Returns converted union as an instance of OneOf
pattern or instance of Optional
pattern(for class properties defined with question mark symbol or matching pattern[undefined, any]
).
isConvertible
▸ isConvertible(reflectedType
: tsruntimeTypes.ReflectedType): boolean
Evaluates if provided reflected type is an union.
Parameters:
Name | Type | Description |
---|---|---|
reflectedType | tsruntimeTypes.ReflectedType | Reflected type. |
Returns: boolean
Returns true
if reflected type is an union, else false
.
reflect
▸ reflect(reflectedType
: tsruntimeTypes.ReflectedType, converter
: Converter): any[]
Reflects union.
Parameters:
Name | Type | Description |
---|---|---|
reflectedType | tsruntimeTypes.ReflectedType | Reflected type. |
converter | Converter | Converter instance. |
Returns: any[]
Returns reflected union as an Array
.