Class: Name
Representation of a string type name with some extra capabilities.
Extended by
Constructors
Constructor
new Name(
value,type,capsRange?):Name
Creates augmented names by adding extra functionality to a string name.
Parameters
value
string
type
must be indicated to categorize the name so it can be treated accordingly.
capsRange?
determines how the name should be capitalized initially.
Returns
Name
Properties
capsRange
protectedcapsRange:CapsRange
initial
protectedinitial:string
type
readonlytype:Namon
Accessors
isFirstName
Get Signature
get isFirstName():
boolean
Whether the name is a first name.
Returns
boolean
isLastName
Get Signature
get isLastName():
boolean
Whether the name is a last name.
Returns
boolean
isMiddleName
Get Signature
get isMiddleName():
boolean
Whether the name is a middle name.
Returns
boolean
isPrefix
Get Signature
get isPrefix():
boolean
Whether the name is a prefix.
Returns
boolean
isSuffix
Get Signature
get isSuffix():
boolean
Whether the name is a suffix.
Returns
boolean
length
Get Signature
get length():
number
The length of the name.
Returns
number
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
Methods
caps()
caps(
range?):Name
Capitalizes the name.
Parameters
range?
Returns
Name
decaps()
decaps(
range?):Name
De-capitalizes the name.
Parameters
range?
Returns
Name
equal()
equal(
other):boolean
Returns true if the other is equal to this name.
Parameters
other
unknown
Returns
boolean
initials()
initials():
string[]
Gets the initials (first character) of this name.
Returns
string[]
toString()
toString():
string
String representation of this object.
Returns
string
validate()
protectedvalidate(name?):void
Parameters
name?
string
Returns
void
first()
staticfirst(value):Name
Creates a first name.
Parameters
value
string
Returns
Name
last()
staticlast(value):Name
Creates a last name.
Parameters
value
string
Returns
Name
middle()
staticmiddle(value):Name
Creates a middle name.
Parameters
value
string
Returns
Name
prefix()
staticprefix(value):Name
Creates a prefix.
Parameters
value
string
Returns
Name
suffix()
staticsuffix(value):Name
Creates a suffix.
Parameters
value
string
Returns
Name