From 9161a069d06d17f62b6b6d904251fd2102299064 Mon Sep 17 00:00:00 2001 From: DivisionByZero Date: Fri, 21 Apr 2023 18:45:52 +0200 Subject: refactor(location): deprecate cityName (#2070) --- src/modules/location/index.ts | 10 ++++++++++ src/modules/random/index.ts | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/modules') 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(), -- cgit v1.2.3