Skip to content

Commit e130549

Browse files
authored
feat(phone)!: add new style parameter (#2578)
1 parent aade09b commit e130549

File tree

303 files changed

+2249
-156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

303 files changed

+2249
-156
lines changed

docs/guide/upgrading_v9/2578.md

Lines changed: 15 additions & 0 deletions

src/definitions/phone_number.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,18 @@ export type PhoneNumberDefinition = LocaleEntry<{
1212
*
1313
* @see faker.helpers.replaceSymbolWithNumber(format): For more information about how the patterns are used.
1414
*/
15-
formats: string[];
15+
format: {
16+
/**
17+
* Formats for a human-input phone number, e.g. `555-770-7727` or `555.770.7727 x1234`
18+
*/
19+
human: string[];
20+
/**
21+
* Formats for a phone number in a standardized national format, e.g. `(555) 123-4567`.
22+
*/
23+
national: string[];
24+
/**
25+
* Formats for a phone number in the standardised E.123 format, e.g. `+15551234567`
26+
*/
27+
international: string[];
28+
};
1629
}>;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* This file is automatically generated.
3+
* Run 'pnpm run generate:locales' to update.
4+
*/
5+
import type { PhoneNumberDefinition } from '../../../..';
6+
import human from './human';
7+
import international from './international';
8+
import national from './national';
9+
10+
const format: PhoneNumberDefinition['format'] = {
11+
human,
12+
international,
13+
national,
14+
};
15+
16+
export default format;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default [
2+
'+271#########',
3+
'+272#########',
4+
'+273#########',
5+
'+274#########',
6+
'+275#########',
7+
'+27800######',
8+
'+27860######',
9+
];
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default [
2+
'1#########',
3+
'2#########',
4+
'3#########',
5+
'4#########',
6+
'5#########',
7+
'080 0## ####',
8+
'0860 ### ###',
9+
];

src/locales/af_ZA/phone_number/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* Run 'pnpm run generate:locales' to update.
44
*/
55
import type { PhoneNumberDefinition } from '../../..';
6-
import formats from './formats';
6+
import format from './format';
77

88
const phone_number: PhoneNumberDefinition = {
9-
formats,
9+
format,
1010
};
1111

1212
export default phone_number;

src/locales/ar/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import location from './location';
1111
import lorem from './lorem';
1212
import metadata from './metadata';
1313
import person from './person';
14-
import phone_number from './phone_number';
1514
import team from './team';
1615
import vehicle from './vehicle';
1716

@@ -24,7 +23,6 @@ const ar: LocaleDefinition = {
2423
lorem,
2524
metadata,
2625
person,
27-
phone_number,
2826
team,
2927
vehicle,
3028
};

src/locales/ar/phone_number/formats.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/locales/ar/phone_number/index.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* This file is automatically generated.
3+
* Run 'pnpm run generate:locales' to update.
4+
*/
5+
import type { PhoneNumberDefinition } from '../../../..';
6+
import human from './human';
7+
import international from './international';
8+
import national from './national';
9+
10+
const format: PhoneNumberDefinition['format'] = {
11+
human,
12+
international,
13+
national,
14+
};
15+
16+
export default format;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default ['+9949#########'];
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default ['9#########'];

src/locales/az/phone_number/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* Run 'pnpm run generate:locales' to update.
44
*/
55
import type { PhoneNumberDefinition } from '../../..';
6-
import formats from './formats';
6+
import format from './format';
77

88
const phone_number: PhoneNumberDefinition = {
9-
formats,
9+
format,
1010
};
1111

1212
export default phone_number;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* This file is automatically generated.
3+
* Run 'pnpm run generate:locales' to update.
4+
*/
5+
import type { PhoneNumberDefinition } from '../../../..';
6+
import human from './human';
7+
import international from './international';
8+
import national from './national';
9+
10+
const format: PhoneNumberDefinition['format'] = {
11+
human,
12+
international,
13+
national,
14+
};
15+
16+
export default format;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default [
2+
'+420601######',
3+
'+420737######',
4+
'+420736######',
5+
'+420#########',
6+
];
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default ['601 ### ###', '737 ### ###', '736 ### ###', '### ### ###'];

src/locales/cs_CZ/phone_number/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* Run 'pnpm run generate:locales' to update.
44
*/
55
import type { PhoneNumberDefinition } from '../../..';
6-
import formats from './formats';
6+
import format from './format';
77

88
const phone_number: PhoneNumberDefinition = {
9-
formats,
9+
format,
1010
};
1111

1212
export default phone_number;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* This file is automatically generated.
3+
* Run 'pnpm run generate:locales' to update.
4+
*/
5+
import type { PhoneNumberDefinition } from '../../../..';
6+
import human from './human';
7+
import international from './international';
8+
import national from './national';
9+
10+
const format: PhoneNumberDefinition['format'] = {
11+
human,
12+
international,
13+
national,
14+
};
15+
16+
export default format;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default ['+45!#######'];
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default ['!# ## ## ##'];

src/locales/da/phone_number/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* Run 'pnpm run generate:locales' to update.
44
*/
55
import type { PhoneNumberDefinition } from '../../..';
6-
import formats from './formats';
6+
import format from './format';
77

88
const phone_number: PhoneNumberDefinition = {
9-
formats,
9+
format,
1010
};
1111

1212
export default phone_number;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* This file is automatically generated.
3+
* Run 'pnpm run generate:locales' to update.
4+
*/
5+
import type { PhoneNumberDefinition } from '../../../..';
6+
import human from './human';
7+
import international from './international';
8+
import national from './national';
9+
10+
const format: PhoneNumberDefinition['format'] = {
11+
human,
12+
international,
13+
national,
14+
};
15+
16+
export default format;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default ['+49############', '+49###########', '+49##########'];
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default ['0#### ########', '0#### #######', '0#### ######'];

src/locales/de/phone_number/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* Run 'pnpm run generate:locales' to update.
44
*/
55
import type { PhoneNumberDefinition } from '../../..';
6-
import formats from './formats';
6+
import format from './format';
77

88
const phone_number: PhoneNumberDefinition = {
9-
formats,
9+
format,
1010
};
1111

1212
export default phone_number;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* This file is automatically generated.
3+
* Run 'pnpm run generate:locales' to update.
4+
*/
5+
import type { PhoneNumberDefinition } from '../../../..';
6+
import human from './human';
7+
import international from './international';
8+
import national from './national';
9+
10+
const format: PhoneNumberDefinition['format'] = {
11+
human,
12+
international,
13+
national,
14+
};
15+
16+
export default format;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default ['+431#######', '+43########', '+43#########'];
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default ['01 #######', '0#### ####', '0#### #####'];

src/locales/de_AT/phone_number/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* Run 'pnpm run generate:locales' to update.
44
*/
55
import type { PhoneNumberDefinition } from '../../..';
6-
import formats from './formats';
6+
import format from './format';
77

88
const phone_number: PhoneNumberDefinition = {
9-
formats,
9+
format,
1010
};
1111

1212
export default phone_number;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* This file is automatically generated.
3+
* Run 'pnpm run generate:locales' to update.
4+
*/
5+
import type { PhoneNumberDefinition } from '../../../..';
6+
import human from './human';
7+
import international from './international';
8+
import national from './national';
9+
10+
const format: PhoneNumberDefinition['format'] = {
11+
human,
12+
international,
13+
national,
14+
};
15+
16+
export default format;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default [
2+
'+41800######',
3+
'+41#########',
4+
'+41900######',
5+
'+4176#######',
6+
'+4178#######',
7+
'+4179#######',
8+
];
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default [
2+
'0800 ### ###',
3+
'0## ### ## ##',
4+
'0900 ### ###',
5+
'076 ### ## ##',
6+
'078 ### ## ##',
7+
'079 ### ## ##',
8+
];

src/locales/de_CH/phone_number/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* Run 'pnpm run generate:locales' to update.
44
*/
55
import type { PhoneNumberDefinition } from '../../..';
6-
import formats from './formats';
6+
import format from './format';
77

88
const phone_number: PhoneNumberDefinition = {
9-
formats,
9+
format,
1010
};
1111

1212
export default phone_number;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* This file is automatically generated.
3+
* Run 'pnpm run generate:locales' to update.
4+
*/
5+
import type { PhoneNumberDefinition } from '../../../..';
6+
import human from './human';
7+
import international from './international';
8+
import national from './national';
9+
10+
const format: PhoneNumberDefinition['format'] = {
11+
human,
12+
international,
13+
national,
14+
};
15+
16+
export default format;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default [
2+
'+9603######',
3+
'+9604######',
4+
'+9605######',
5+
'+9606######',
6+
'+9607######',
7+
'+9608######',
8+
'+9609######',
9+
];
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default [
2+
'3##-####',
3+
'4##-####',
4+
'5######',
5+
'6##-####',
6+
'7##-####',
7+
'8######',
8+
'9##-####',
9+
];

0 commit comments

Comments
 (0)