From 4056ab09c64be40d41562284ec64e7531fbaff41 Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Sat, 12 Oct 2024 14:39:42 +0100 Subject: feat(location): add `continent` method (#3162) --- src/modules/location/index.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/modules') diff --git a/src/modules/location/index.ts b/src/modules/location/index.ts index 4aabdd8d..4a49e029 100644 --- a/src/modules/location/index.ts +++ b/src/modules/location/index.ts @@ -216,6 +216,20 @@ export class LocationModule extends ModuleBase { ); } + /** + * Returns a random continent name. + * + * @example + * faker.location.continent() // 'Asia' + * + * @since 9.1.0 + */ + continent(): string { + return this.faker.helpers.arrayElement( + this.faker.definitions.location.continent + ); + } + /** * Returns a random [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code. * -- cgit v1.2.3