Skip to content

Commit 2a6f578

Browse files
authored
refactor(location): deprecate streetName (#2071)
1 parent bf67a21 commit 2a6f578

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

docs/guide/upgrading.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ The `faker.address.*` methods will continue to work as an alias in v8 and v9, bu
182182
| `faker.address.stateAbbr` | `faker.location.stateAbbr` |
183183
| `faker.address.street` | `faker.location.street` |
184184
| `faker.address.streetAddress` | `faker.location.streetAddress` |
185-
| `faker.address.streetName` | `faker.location.streetName` |
185+
| `faker.address.streetName` | `faker.location.street` |
186186
| `faker.address.timeZone` | `faker.location.timeZone` |
187187
| `faker.address.zipCode` | `faker.location.zipCode` |
188188
| `faker.address.zipCodeByState` | `faker.location.zipCodeByState` |

src/modules/location/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,22 @@ export class LocationModule {
199199
/**
200200
* Returns a random localized street name.
201201
*
202+
* @see faker.location.street()
203+
*
202204
* @example
203205
* fakerDE.location.streetName() // 'Cavill Avenue'
204206
*
205207
* @since 8.0.0
208+
*
209+
* @deprecated Use `faker.location.street()` instead.
206210
*/
207211
streetName(): string {
212+
deprecated({
213+
deprecated: 'faker.location.streetName',
214+
proposed: 'faker.location.street',
215+
since: '8.0',
216+
until: '9.0',
217+
});
208218
return this.faker.helpers.arrayElement(
209219
this.faker.definitions.location.street_name
210220
);

0 commit comments

Comments
 (0)