Skip to content

Commit 53d6e12

Browse files
committed
Fix Switzerland phone number format #114
1 parent 5aa1802 commit 53d6e12

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

api/1.3/api.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Email addresses are now transliterated
44
More street/city names for NL dataset
55
Fixed Norwegian id generation bug
6+
Fixed Switzerland phone number format
67
*/
78

89
const fs = require('fs');

api/1.3/data/CH/inject.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ module.exports = (inc, contents) => {
1313
contents.location.postcode = range(1000, 9999);
1414
});
1515

16-
include(inc, contents, 'phone', '(' + random(3, 3) + ')-' + random(3, 3) + '-' + random(3, 4));
17-
include(inc, contents, 'cell', '(' + random(3, 3) + ')-' + random(3, 3) + '-' + random(3, 4));
16+
let prefix = ['075', '076', '077', '078', '079'];
17+
include(inc, contents, 'phone', `${randomItem(prefix)} ${random(3, 3)} ${random(3, 2)} ${random(3, 2)}`);
18+
include(inc, contents, 'cell', `${randomItem(prefix)} ${random(3, 3)} ${random(3, 2)} ${random(3, 2)}`);
1819
include(inc, contents, 'id', {
1920
name: 'AVS',
2021
value: '756.' + random(3, 4) + '.' + random(3, 4) + '.' + random(3, 2)

0 commit comments

Comments
 (0)