Skip to content

refactor(location): deprecate streetName #2071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/guide/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ The `faker.address.*` methods will continue to work as an alias in v8 and v9, bu
| `faker.address.stateAbbr` | `faker.location.stateAbbr` |
| `faker.address.street` | `faker.location.street` |
| `faker.address.streetAddress` | `faker.location.streetAddress` |
| `faker.address.streetName` | `faker.location.streetName` |
| `faker.address.streetName` | `faker.location.street` |
| `faker.address.timeZone` | `faker.location.timeZone` |
| `faker.address.zipCode` | `faker.location.zipCode` |
| `faker.address.zipCodeByState` | `faker.location.zipCodeByState` |
Expand Down
10 changes: 10 additions & 0 deletions src/modules/location/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,22 @@ export class LocationModule {
/**
* Returns a random localized street name.
*
* @see faker.location.street()
*
* @example
* fakerDE.location.streetName() // 'Cavill Avenue'
*
* @since 8.0.0
*
* @deprecated Use `faker.location.street()` instead.
*/
streetName(): string {
deprecated({
deprecated: 'faker.location.streetName',
proposed: 'faker.location.street',
since: '8.0',
until: '9.0',
});
return this.faker.helpers.arrayElement(
this.faker.definitions.location.street_name
);
Expand Down