Skip to content
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

Improve deprecation message for faker.phone.number(format) #2413

Closed
matthewmayer opened this issue Sep 22, 2023 · 4 comments · Fixed by #2517
Closed

Improve deprecation message for faker.phone.number(format) #2413

matthewmayer opened this issue Sep 22, 2023 · 4 comments · Fixed by #2517
Assignees
Labels
c: docs Improvements or additions to documentation deprecation A deprecation was made in the PR m: phone Something is referring to the phone module p: 2-high Fix main branch
Milestone

Comments

@matthewmayer
Copy link
Contributor

          > It would be nice if at least a few options were available before the deprecation took effect. We have an simple use case like `faker.phone.number('##########')`, which I think would be hard to replicate until this is complete?

the direct replacement for faker.phone.number('##########') is faker.helpers.replaceSymbolWithNumber('##########') - maybe the deprecation message should be modified to make that clearer?

Originally posted by @matthewmayer in #1542 (comment)

@ST-DDT ST-DDT added c: docs Improvements or additions to documentation p: 1-normal Nothing urgent m: phone Something is referring to the phone module deprecation A deprecation was made in the PR labels Sep 22, 2023
@ST-DDT ST-DDT added this to the v8 - This Major Version milestone Sep 22, 2023
@ST-DDT
Copy link
Member

ST-DDT commented Sep 22, 2023

FFR:

* @deprecated Use `faker.phone.number()` without an argument instead.

if (format != null) {
deprecated({
deprecated: 'faker.phone.number(format)',
proposed: 'faker.phone.number()',
since: '8.1',
until: '9.0',
});
}

@ST-DDT
Copy link
Member

ST-DDT commented Sep 22, 2023

This should potentially list faker.numeric() and faker.helpers.fromRegexp() as alternatives.

@brandon-pereira
Copy link

brandon-pereira commented Sep 25, 2023

I had faker.phone.number("+1 (403) ###-####"), and I use the phone package to validate phone numbers. After removing the formatter, phone numbers like 347.494.6136 x4935 which are returned were failing the validation, so I ended up using faker.helpers.replaceSymbolWithNumber("+1 (403) ###-####") instead and it seems to work, but YMMV

@ST-DDT
Copy link
Member

ST-DDT commented Oct 10, 2023

Team Decision

  • We will implement this for v8.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: docs Improvements or additions to documentation deprecation A deprecation was made in the PR m: phone Something is referring to the phone module p: 2-high Fix main branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants