Skip to main content
System
Gender
string
code reference

Definition

The gender transformer randomly selects a gender value from a predefined list of genders. Here is the list:

GenderAbbreviation
malem
femalef
nonbinaryn
undefinedu

By default, the gender transformer does not abbreviate the gender. If you'd like to return an abbreviated gender, pass in the abbreviate config.

Configurations

Depending on your validations, you may want to configure the output gender. The gender transformer has the following configurations:

NameDescriptionDefaultExample InputExample Output
AbbreviateAbbreviate will abbreviate the output gender so that it is only one character. falseN/Au

Examples

There are several ways you can mix-and-match configurations to get different full name formats. Here are some possible combinations:

AbbreviateExample InputExample Output
falseN/Amale
trueN/Af
falsefemalenonbinary