PrimitiveConverter

Hierarchy

  • PrimitiveConverter

Implements

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:

NameTypeDescription
reflectedTypetsruntimeTypes.ReflectedTypeReflected 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:

NameTypeDescription
reflectedTypetsruntimeTypes.ReflectedTypeReflected 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:

NameTypeDescription
reflectedTypetsruntimeTypes.ReflectedTypeReflected 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