aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorDivisionByZero <[email protected]>2023-04-21 18:45:52 +0200
committerGitHub <[email protected]>2023-04-21 16:45:52 +0000
commit9161a069d06d17f62b6b6d904251fd2102299064 (patch)
tree2491e770bcc07b109b4109a9bf87794f96eaa138 /src/modules
parent2a6f578149aebdb5c375378a778383249e9819f3 (diff)
downloadfaker-9161a069d06d17f62b6b6d904251fd2102299064.tar.xz
faker-9161a069d06d17f62b6b6d904251fd2102299064.zip
refactor(location): deprecate cityName (#2070)
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/location/index.ts10
-rw-r--r--src/modules/random/index.ts1
2 files changed, 10 insertions, 1 deletions
diff --git a/src/modules/location/index.ts b/src/modules/location/index.ts
index 76b3e100..97423b83 100644
--- a/src/modules/location/index.ts
+++ b/src/modules/location/index.ts
@@ -156,13 +156,23 @@ export class LocationModule {
/**
* Returns a random city name from a list of real cities for the locale.
*
+ * @see faker.location.city()
+ *
* @example
* faker.location.cityName() // 'San Rafael'
* fakerDE.location.cityName() // 'Nürnberg'
*
* @since 8.0.0
+ *
+ * @deprecated Use `faker.location.city()` instead.
*/
cityName(): string {
+ deprecated({
+ deprecated: 'faker.location.cityName',
+ proposed: 'faker.location.city',
+ since: '8.0',
+ until: '9.0',
+ });
return this.faker.helpers.arrayElement(
this.faker.definitions.location.city_name
);
diff --git a/src/modules/random/index.ts b/src/modules/random/index.ts
index 03f126f8..d0544119 100644
--- a/src/modules/random/index.ts
+++ b/src/modules/random/index.ts
@@ -53,7 +53,6 @@ export class RandomModule {
const wordMethods = [
() => this.faker.location.cardinalDirection(),
- this.faker.location.cityName,
this.faker.location.country,
this.faker.location.county,
() => this.faker.location.direction(),