Skip to content

streetSuffix - suffix abbreviation (US) #3703

@michael-hart-github

Description

@michael-hart-github

Clear and concise description of the problem

Note

I haven't made many public-facing issues before. If it's hard to figure out what I'm requesting, please let me know! 😄

When creating fake addresses, I may not want values of 123 Fake Street or 123 Fake.

Instead, I might specifically want/need:

  • 123 Fake St
  • Or, 123 Fake St.

Suggested solution

Some kind of modification to streetAddress(), or street(), that allows for abbreviated suffixes would be great.

Calling faker.location.streetAddress({ useSuffixAbbreviate: true }) returns something like 123 Fake St
And if it's set to ({ useSuffixAbbreviate: false }), it could return 123 Fake St. instead.

This would apply to multiple street name suffixes, such as:
Avenue = Ave
Center = Ctr
Circle = Cir
Street = St
Etc.

function streetAddress(
  options:
    | boolean
    | {
        useFullAddress?: boolean;
      } = {}
    | {
        useSuffixAbbreviate?: boolean;
      } = {}
): string;

So examples would look something like:

faker.location.streetAddress() // '0917 O'Conner Estates'
faker.location.streetAddress(false) // '34830 Erdman Hollow'
faker.location.streetAddress(true) // '3393 Ronny Way Apt. 742'
faker.location.streetAddress({ useFullAddress: true }) // '7917 Miller Park Apt. 410'
faker.location.streetAddress({ useSuffixAbbreviate: true }) // '732 Forest Rd'
faker.location.streetAddress({ useFullAddress: true }, { useSuffixAbbreviate: true }) // '347 Maple Ave Apt. 99'

Alternative

An alternative might be a new listing under location, called streetSuffix() would work, if its easier to implement.

It would just be good to have some way to get street addresses, with abbreviated suffixes both with, and without periods.

Additional context

Reference material

A full list of US street suffixes and standardized abbreviations are available here via USPS.

For cases where multiple listings are possible (Example: AVENUE = AV, AVE, AVN, etc.) the Postal Service Standard Suffix Abbreviation (should probably?) win any tie breakers. The logic being that the work being done will presumably in some way relate to mailing or legal addresses, so following USPS standards would be generally preferable for the sake of standardization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: featureRequest for new featurehas workaroundWorkaround provided or linkedm: locationSomething is referring to the location modules: waiting for user interestWaiting for more users interested in this feature
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions