-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Weight genders in faker.person.gender() #1730
Copy link
Copy link
Open
Labels
c: refactorPR that affects the runtime behavior, but doesn't add new features or fixes bugsPR that affects the runtime behavior, but doesn't add new features or fixes bugsm: personSomething is referring to the person moduleSomething is referring to the person modules: waiting for user interestWaiting for more users interested in this featureWaiting for more users interested in this feature
Milestone
Metadata
Metadata
Assignees
Labels
c: refactorPR that affects the runtime behavior, but doesn't add new features or fixes bugsPR that affects the runtime behavior, but doesn't add new features or fixes bugsm: personSomething is referring to the person moduleSomething is referring to the person modules: waiting for user interestWaiting for more users interested in this featureWaiting for more users interested in this feature
Clear and concise description of the problem
faker.person.gender()pulls from a list of genders at https://github.com/faker-js/faker/blob/next/src/locales/en/person/gender.tsThis is a very inclusive list, however I feel it makes the function less realistic to have all values returned with equal probability. In reality, even in fairly LGBTQ-friendly countries, the percentage of people who define as non-cis-gender is fairly low https://www.bbc.com/news/uk-64184736
Suggested solution
Now that we have
faker.helpers.weightedArrayElementi think we could change this so for example it returns "Man" 45% of the time, "Woman" 45% of the time, and one of the other genders 10% of the time (divided equally between the other 73 options)Alternative
Keep current behavior (unrealistic)
Only return Man or Woman (non-inclusive)
Additional context
No response