Class: FirstName
Representation of a first name with some extra functionality.
Extends
Constructors
Constructor
new FirstName(
value, ...more):FirstName
Creates an extended version of Name and flags it as a first name type.
Some may consider more additional name parts of a given name as their
first names, but not as their middle names. Though it may mean the same,
more provides the freedom to do it as it pleases.
Parameters
value
string
more
...string[]
Returns
FirstName
Overrides
Properties
capsRange
protectedcapsRange:CapsRange
Inherited from
initial
protectedinitial:string
Inherited from
type
readonlytype:Namon
Inherited from
Accessors
asNames
Get Signature
get asNames():
Name[]
Returns a combined version of the value and more if any.
Returns
Name[]
hasMore
Get Signature
get hasMore():
boolean
Determines whether a first name has more name parts.
Returns
boolean
isFirstName
Get Signature
get isFirstName():
boolean
Whether the name is a first name.
Returns
boolean
Inherited from
isLastName
Get Signature
get isLastName():
boolean
Whether the name is a last name.
Returns
boolean
Inherited from
isMiddleName
Get Signature
get isMiddleName():
boolean
Whether the name is a middle name.
Returns
boolean
Inherited from
isPrefix
Get Signature
get isPrefix():
boolean
Whether the name is a prefix.
Returns
boolean
Inherited from
isSuffix
Get Signature
get isSuffix():
boolean
Whether the name is a suffix.
Returns
boolean
Inherited from
length
Get Signature
get length():
number
The length of the name.
Returns
number
Overrides
more
Get Signature
get more():
string[]
The additional name parts of the first name.
Returns
string[]
value
Get Signature
get value():
string
The piece of string treated as a name.
Returns
string
Set Signature
set value(
newValue):void
Parameters
newValue
string
Returns
void
Inherited from
Methods
caps()
caps(
range?):FirstName
Capitalizes the name.
Parameters
range?
Returns
FirstName
Overrides
copyWith()
copyWith(
values?):FirstName
Makes a copy of the current name.
Parameters
values?
first?
string
more?
string[]
Returns
FirstName
decaps()
decaps(
range?):FirstName
De-capitalizes the name.
Parameters
range?
Returns
FirstName
Overrides
equal()
equal(
other):boolean
Returns true if the other is equal to this name.
Parameters
other
unknown
Returns
boolean
Inherited from
initials()
initials(
withMore?):string[]
Gets the initials (first character) of this name.
Parameters
withMore?
boolean
Returns
string[]
Overrides
toString()
toString(
withMore?):string
String representation of this object.
Parameters
withMore?
boolean
Returns
string
Overrides
validate()
protectedvalidate(name?):void
Parameters
name?
string
Returns
void
Inherited from
first()
staticfirst(value):Name
Creates a first name.
Parameters
value
string
Returns
Inherited from
last()
staticlast(value):Name
Creates a last name.
Parameters
value
string
Returns
Inherited from
middle()
staticmiddle(value):Name
Creates a middle name.
Parameters
value
string
Returns
Inherited from
prefix()
staticprefix(value):Name
Creates a prefix.
Parameters
value
string
Returns
Inherited from
suffix()
staticsuffix(value):Name
Creates a suffix.
Parameters
value
string