aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorShinigami <[email protected]>2022-08-22 16:02:45 +0800
committerGitHub <[email protected]>2022-08-22 08:02:45 +0000
commitf684a14ddc3729c74f8434db68324269ae9a640f (patch)
treeee0cd2b5dae756d71abe39f5b67b2055d8819afb /src/modules
parent23adcc03231a6be2c727c1482e6336f5796eabae (diff)
downloadfaker-f684a14ddc3729c74f8434db68324269ae9a640f.tar.xz
faker-f684a14ddc3729c74f8434db68324269ae9a640f.zip
feat(name): add sexType method (#1289)
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/name/index.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/modules/name/index.ts b/src/modules/name/index.ts
index b42de3db..a61442e0 100644
--- a/src/modules/name/index.ts
+++ b/src/modules/name/index.ts
@@ -285,6 +285,16 @@ export class Name {
}
/**
+ * Returns a random sex type.
+ *
+ * @example
+ * faker.name.sexType() // Sex.Female
+ */
+ sexType(): SexType {
+ return this.faker.helpers.objectValue(Sex);
+ }
+
+ /**
* Returns a random name prefix.
*
* @param sex The optional sex to use. Can be either `'female'` or `'male'`.