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

docs(phone): improve deprecation and see message #2517

Merged
merged 2 commits into from Oct 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/modules/phone/index.ts
Expand Up @@ -17,6 +17,9 @@ export class PhoneModule {
/**
* Generates a random phone number.
*
* @see faker.string.numeric(): For generating a random string of numbers.
* @see faker.helpers.fromRegExp(): For generating a phone number matching a regular expression.
*
* @example
* faker.phone.number() // '961-770-7727'
*
Expand All @@ -28,20 +31,26 @@ export class PhoneModule {
*
* @param format Format of the phone number.
*
* @see faker.string.numeric(): For generating a random string of numbers.
* @see faker.helpers.fromRegExp(): For generating a phone number matching a regular expression.
*
* @example
* faker.phone.number('501-###-###') // '501-039-841'
* faker.phone.number('+48 91 ### ## ##') // '+48 91 463 61 70'
*
* @since 7.3.0
*
* @deprecated Use `faker.phone.number()` without an argument instead.
* @deprecated Use `faker.phone.number()` without an argument, `faker.string.numeric()` or `faker.helpers.fromRegExp()` instead.
*/
number(format: string): string;
/**
* Generates a random phone number.
*
* @param format Format of the phone number. Defaults to a random phone number format.
*
* @see faker.string.numeric(): For generating a random string of numbers.
* @see faker.helpers.fromRegExp(): For generating a phone number matching a regular expression.
*
* @example
* faker.phone.number() // '961-770-7727'
*
Expand All @@ -52,7 +61,8 @@ export class PhoneModule {
if (format != null) {
deprecated({
deprecated: 'faker.phone.number(format)',
proposed: 'faker.phone.number()',
proposed:
'faker.phone.number(), faker.string.numeric() or faker.helpers.fromRegExp()',
since: '8.1',
until: '9.0',
});
Expand Down