Class: Mononym
A single word name or mononym.
This is a special case of FullName that is used to represent mononyms. This contradicts
the original purpose of this library such as shaping and organizing name pieces accordingly.
When enabled via Config.mono, this becomes the full name of a human. And as a single name,
most of the Namefully methods become irrelevant.
Extends
Constructors
Constructor
new Mononym(
name,options?):Mononym
Constructs a mononym from a piece of string.
Parameters
name
string | Name
to be used to construct the mononym.
options?
Partial<Config>
Returns
Mononym
Overrides
Accessors
config
Get Signature
get config():
Config
A snapshot of the configuration used to set up this full name.
Returns
Inherited from
firstName
Get Signature
get firstName():
FirstName
The first name part of the full name.
Returns
Inherited from
isMono
Get Signature
get isMono():
boolean
Whether the full name is a single word name.
Returns
boolean
Inherited from
lastName
Get Signature
get lastName():
LastName
The last name part of the full name.
Returns
Inherited from
middleName
Get Signature
get middleName():
Name[]
The middle name part of the full name.
Returns
Name[]
Inherited from
prefix
Get Signature
get prefix():
Name
The prefix part of the full name.
Returns
Inherited from
suffix
Get Signature
get suffix():
Name
The suffix part of the full name.
Returns
Inherited from
type
Get Signature
get type():
Namon
The type of name being used to represent the mononym.
Returns
Set Signature
set type(
type):void
Re-assigns which name type is being used to represent the mononym.
Ideally, this doesn't really matter as the mononym is always a single piece of name.
When used as string, it must be a valid Namon type or else it will default to
Namon.FIRST_NAME.
Parameters
type
string | Namon
of name to use.
Returns
void
value
Get Signature
get value():
string
The piece of string treated as a name.
Returns
string
Methods
[iterator]()
[iterator]():
Iterator<Name>
Returns the default iterator for this name set (enabling for-of statements).
Returns
Iterator<Name>
Inherited from
has()
has(
key):boolean
Returns true if a namon has been set.
Parameters
key
string | Namon
Returns
boolean
Inherited from
setFirstName()
setFirstName(
name):FullName
Parameters
name
string | FirstName
Returns
Inherited from
setLastName()
setLastName(
name):FullName
Parameters
name
string | LastName
Returns
Inherited from
setMiddleName()
setMiddleName(
names):FullName
Parameters
names
Name[] | string[]
Returns
Inherited from
setPrefix()
setPrefix(
name):FullName
Parameters
name
string | Name
Returns
Inherited from
setSuffix()
setSuffix(
name):FullName
Parameters
name
string | Name
Returns
Inherited from
toIterable()
toIterable(
flat?):Iterable<Name>
Returns an Iterable of existing Names.
Parameters
flat?
boolean
Returns
Iterable<Name>
Inherited from
toString()
toString():
string
Returns
string
Inherited from
parse()
staticparse(json,config?):FullName
Parses a JSON name into a full name.
Parameters
json
parsable name element
config?
for additional features.