CharacterName

CharacterName

new CharacterName()

Description:
  • Represents a character's name with various attributes.

Source:
Properties:
Name Type Attributes Description
given String

The given (first) name of the character.

nickname String <optional>

The nickname or alternative name of the character.

family String <optional>

The family (last) name of the character.

heritage String <optional>

The heritage of the character (anglo or latino)

gender String <optional>

The gender of the character.

born String <optional>

The maiden name of the character.

Example
const name = new CharacterName({
  given: 'Jane',
  family: 'Doe',
  nickname: 'Janey',
  heritage: 'anglo',
  gender: 'male',
  born: 'Smith'
});
name.toString();
=> "Janey"
name.toLastNameString();
=> "Doe (born Smith)"

Methods

toLastNameString() → {String}

Source:
Returns:

the family name, with the born (maiden) name if present

Type
String

toString() → {String}

Source:
Returns:

the full name, preferring nickname if present

Type
String

CharacterName

new CharacterName(paramsopt)

Description:
  • Creates an instance of CharacterName.

Source:
Parameters:
Name Type Attributes Description
params Object <optional>
Properties
Name Type Attributes Description
given String <optional>

The given (first) name of the character.

nickname String <optional>

The nickname or alternative name of the character.

family String <optional>

The family (last) name of the character.

heritage String <optional>

The heritage of the character (anglo or latino)

gender String <optional>

The gender of the character.

born String <optional>

The maiden name of the character.

Methods

toLastNameString() → {String}

Source:
Returns:

the family name, with the born (maiden) name if present

Type
String

toString() → {String}

Source:
Returns:

the full name, preferring nickname if present

Type
String