Definition
The gender transformer randomly selects a gender value from a predefined list of genders. Here is the list:
Gender | Abbreviation |
---|---|
male | m |
female | f |
nonbinary | n |
undefined | u |
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:
Name | Description | Default | Example Input | Example Output |
---|---|---|---|---|
Abbreviate | Abbreviate will abbreviate the output gender so that it is only one character. | false | N/A | u |
Examples
There are several ways you can mix-and-match configurations to get different full name formats. Here are some possible combinations:
Abbreviate | Example Input | Example Output |
---|---|---|
false | N/A | male |
true | N/A | f |
false | female | nonbinary |