LiteralConverter

Hierarchy

  • LiteralConverter

Implements

Index

Methods

Methods

convert

convert(reflectedType: tsruntimeTypes.ReflectedType): Equals

Converts reflected valued literal type for validation.

Parameters:

NameTypeDescription
reflectedTypetsruntimeTypes.ReflectedTypeReflected type.

Returns: Equals

Returns converted reflected value literal type wrapped with Equals pattern.


isConvertible

isConvertible(reflectedType: tsruntimeTypes.ReflectedType): boolean

Evaluates if provided reflected type is valued literal(has value).

Parameters:

NameTypeDescription
reflectedTypetsruntimeTypes.ReflectedTypeReflected type.

Returns: boolean

Returns true if reflected type is valued literal, else false.


reflect

reflect(reflectedType: tsruntimeTypes.ReflectedType): string | number | boolean

Reflects valued literal type.

Parameters:

NameTypeDescription
reflectedTypetsruntimeTypes.ReflectedTypeReflected type.

Returns: string | number | boolean

Returns reflected valued literal type as literal string|number|true|false.