Class: LastName
Representation of a last name with some extra functionality.
Extends
Constructors
Constructor
new LastName(
father,mother?,format?):LastName
Creates an extended version of Name and flags it as a last name type.
Some people may keep their
Parameters
father
string
mother?
string
format?
Surname | "father" | "mother" | "hyphenated" | "all"
Returns
LastName
Overrides
Properties
capsRange
protectedcapsRange:CapsRange
Inherited from
format
readonlyformat:Surname|"father"|"mother"|"hyphenated"|"all"
initial
protectedinitial:string
Inherited from
type
readonlytype:Namon
Inherited from
Accessors
asNames
Get Signature
get asNames():
Name[]
Returns a combined version of the father and mother if any.
Returns
Name[]
father
Get Signature
get father():
string
The surname inherited from the father side.
Returns
string
hasMother
Get Signature
get hasMother():
boolean
Returns true if the mother's surname is defined.
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
mother
Get Signature
get mother():
string
The surname inherited from the mother side.
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?):LastName
Capitalizes the name.
Parameters
range?
Returns
LastName
Overrides
copyWith()
copyWith(
values?):LastName
Makes a copy of the current name.
Parameters
values?
father?
string
format?
mother?
string
Returns
LastName
decaps()
decaps(
range?):LastName
De-capitalizes the name.
Parameters
range?
Returns
LastName
Overrides
equal()
equal(
other):boolean
Returns true if the other is equal to this name.
Parameters
other
unknown
Returns
boolean
Inherited from
initials()
initials(
format?):string[]
Gets the initials (first character) of this name.
Parameters
format?
Surname | "father" | "mother" | "hyphenated" | "all"
Returns
string[]
Overrides
toString()
toString(
format?):string
String representation of this object.
Parameters
format?
Surname | "father" | "mother" | "hyphenated" | "all"
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