Skip to content

Commit 34ce27f

Browse files
committed
Update .nextRelease with latest changes from v1.3
1 parent a8d0b1a commit 34ce27f

4 files changed

Lines changed: 29 additions & 66636 deletions

File tree

api/.nextRelease/api.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
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
7+
Add country name to location block
68
*/
79

810
const fs = require('fs');
@@ -153,6 +155,7 @@ class Generator {
153155
street: range(1, 9999) + ' ' + randomItem(this.datasets[nat].street),
154156
city: randomItem(this.datasets[nat].cities),
155157
state: randomItem(this.datasets[nat].states),
158+
country: this.fullNatName(nat),
156159
postcode: range(10000, 99999),
157160
coordinates: {
158161
latitude: faker.address.latitude(),
@@ -369,6 +372,28 @@ class Generator {
369372

370373
return password;
371374
}
375+
376+
fullNatName(nat) {
377+
let mapping = {
378+
AU: "australia",
379+
BR: "brazil",
380+
CA: "canada",
381+
CH: "switzerland",
382+
DE: "germany",
383+
DK: "denmark",
384+
ES: "spain",
385+
FI: "finland",
386+
FR: "france",
387+
GB: "united kingdom",
388+
IE: "ireland",
389+
IR: "iran",
390+
NL: "netherlands",
391+
NZ: "new zealand",
392+
TR: "turkey",
393+
US: "united states",
394+
};
395+
return mapping[nat];
396+
}
372397
}
373398

374399
function random(mode, length) {

api/.nextRelease/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)