diff options
| author | Suyash Gulati <[email protected]> | 2024-10-29 21:18:32 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-10-29 16:48:32 +0100 |
| commit | c02beeadd49e48656a0307451517e9751e3118c3 (patch) | |
| tree | 96ec1e3294b510acea9e733807ce1b9959b38034 /src/modules | |
| parent | 081a795411887a8b67bc0718eb5149e1bb5e5dfb (diff) | |
| download | faker-c02beeadd49e48656a0307451517e9751e3118c3.tar.xz faker-c02beeadd49e48656a0307451517e9751e3118c3.zip | |
feat(animal): add petName method (#3196)
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/animal/index.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/modules/animal/index.ts b/src/modules/animal/index.ts index 5a885bbd..bb200a31 100644 --- a/src/modules/animal/index.ts +++ b/src/modules/animal/index.ts @@ -201,4 +201,18 @@ export class AnimalModule extends ModuleBase { type(): string { return this.faker.helpers.arrayElement(this.faker.definitions.animal.type); } + + /** + * Returns a random pet name. + * + * @example + * faker.animal.petName() // 'Coco' + * + * @since 9.2.0 + */ + petName(): string { + return this.faker.helpers.arrayElement( + this.faker.definitions.animal.pet_name + ); + } } |
