Skip to content

Commit e130549

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

303 files changed

Lines changed: 2249 additions & 156 deletions

File tree

Some content is hidden

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

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
}>;
File renamed without changes.
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.

0 commit comments

Comments
 (0)