From c02beeadd49e48656a0307451517e9751e3118c3 Mon Sep 17 00:00:00 2001 From: Suyash Gulati Date: Tue, 29 Oct 2024 21:18:32 +0530 Subject: feat(animal): add petName method (#3196) --- src/modules/animal/index.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/modules') 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 + ); + } } -- cgit v1.2.3