Skip to content

Commit

Permalink
docs(phone): improve deprecation and see message (#2517)
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT authored Oct 31, 2023
1 parent 2d591de commit 18bbc3a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/modules/phone/index.ts
Original file line number Diff line number Diff line change
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

0 comments on commit 18bbc3a

Please sign in to comment.