Interface: NameLike
Methods
format()
format(format): string;
Formats a name into a string based on the available output formats.
The default separator is .
Parameters
format
Returns
string
isSln()
isSln(): boolean;
Returns whether this name is a second-level name (Ex. test.iota)
Returns
boolean
isSubname()
isSubname(): boolean;
Returns whether this name is a subname (Ex. sub.test.iota)
Returns
boolean
label()
label(index): string | undefined;
Get the label at the given index
Parameters
index
number
Returns
string | undefined
labels()
labels(): string[];
Get all of the labels. NOTE: These are in reverse order starting with the top-level name and proceeding to subnames.
Returns
string[]
numLabels()
numLabels(): number;
Returns the number of labels including TLN.
Returns
number
parent()
parent(): NameLike | undefined;
parents; second-level names return None.
Returns
NameLike | undefined