Class: Type
The class for deep checking Types
Constructors
constructor
• new Type(value
, parent?
): Type
Parameters
Name | Type | Default value | Description |
---|---|---|---|
value | unknown | undefined | The value to generate a deep Type of |
parent | null | Type | null | The parent value used in recursion |
Returns
Defined in
Properties
childKeys
• Private
Readonly
childKeys: Map
<string
, Type
>
The child keys of this Type
Defined in
childValues
• Private
Readonly
childValues: Map
<string
, Type
>
The child values of this Type
Defined in
is
• is: string
The shallow type of this
Defined in
parent
• Private
Readonly
parent: null
| Type
The parent of this Type
Defined in
value
• Readonly
value: unknown
The value to generate a deep Type of
Defined in
Accessors
childTypes
• get
childTypes(): string
The type string for the children of this Type
Returns
string
Defined in
Methods
addEntry
▸ addEntry(entry
): void
The subtype to create based on this.value's entries.
Parameters
Name | Type | Description |
---|---|---|
entry | [string , unknown ] | The entry |
Returns
void
Defined in
addValue
▸ addValue(value
): void
The subtype to create based on this.value's sub value.
Parameters
Name | Type | Description |
---|---|---|
value | unknown | The sub value |
Returns
void
Defined in
check
▸ check(): void
Get the deep type name that defines the input.
Returns
void
Defined in
isCircular
▸ isCircular(): boolean
Checks if the value of this Type is a circular reference to any parent.
Returns
boolean
Defined in
parents
▸ parents(): IterableIterator
<Type
>
Walks the linked list backwards, for checking circulars.
Returns
IterableIterator
<Type
>
Defined in
toString
▸ toString(): string
The full type string generated.
Returns
string
Defined in
list
▸ list(values
): string
Joins the list of child types.
Parameters
Name | Type | Description |
---|---|---|
values | Map <string , Type > | The values to list |
Returns
string
Defined in
resolve
▸ resolve(value
): string
Resolves the type name that defines the input.
Parameters
Name | Type | Description |
---|---|---|
value | any | The value to get the type name of |
Returns
string