|
1 | 1 | /* |
2 | | - Use native js dates instead of moment for ~60% increase in dates calculation |
3 | | - Email addresses are now transliterated |
4 | | - More street/city names for NL dataset |
5 | | - Fixed Norwegian id generation bug |
6 | | - Fixed Switzerland phone number format |
7 | | - Add country name to location block |
| 2 | + • Use native js dates instead of moment for ~60% increase in dates calculation |
| 3 | + • Email addresses are now transliterated |
| 4 | + • More street/city names for NL dataset |
| 5 | + • Add country name to location block |
| 6 | + • Capitalized proper nouns |
| 7 | + • Split street into number and name properties |
| 8 | + • Fixed Norwegian id generation bug |
| 9 | + • Fixed Switzerland phone number format |
| 10 | + • Fixed Danish CPR number calculation |
8 | 11 | */ |
9 | 12 |
|
10 | 13 | const fs = require('fs'); |
@@ -145,14 +148,17 @@ class Generator { |
145 | 148 |
|
146 | 149 | let name = this.randomName(this.current.gender, nat); |
147 | 150 | this.include('name', { |
148 | | - title: this.current.gender === 'male' ? 'mr' : randomItem(this.datasets.common.title), |
| 151 | + title: this.current.gender === 'male' ? 'Mr' : randomItem(this.datasets.common.title), |
149 | 152 | first: name[0], |
150 | 153 | last: name[1] |
151 | 154 | }); |
152 | 155 |
|
153 | 156 | let timezone = JSON.parse(randomItem(this.datasets.common.timezones)); |
154 | 157 | this.include('location', { |
155 | | - street: range(1, 9999) + ' ' + randomItem(this.datasets[nat].street), |
| 158 | + street: { |
| 159 | + number: range(1, 9999), |
| 160 | + name: randomItem(this.datasets[nat].street) |
| 161 | + }, |
156 | 162 | city: randomItem(this.datasets[nat].cities), |
157 | 163 | state: randomItem(this.datasets[nat].states), |
158 | 164 | country: this.fullNatName(nat), |
@@ -375,22 +381,22 @@ class Generator { |
375 | 381 |
|
376 | 382 | fullNatName(nat) { |
377 | 383 | 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", |
| 384 | + AU: "Australia", |
| 385 | + BR: "Brazil", |
| 386 | + CA: "Canada", |
| 387 | + CH: "Switzerland", |
| 388 | + DE: "Germany", |
| 389 | + DK: "Denmark", |
| 390 | + ES: "Spain", |
| 391 | + FI: "Finland", |
| 392 | + FR: "France", |
| 393 | + GB: "United Kingdom", |
| 394 | + IE: "Ireland", |
| 395 | + IR: "Iran", |
| 396 | + NL: "Netherlands", |
| 397 | + NZ: "New Zealand", |
| 398 | + TR: "Turkey", |
| 399 | + US: "United States", |
394 | 400 | }; |
395 | 401 | return mapping[nat]; |
396 | 402 | } |
|
0 commit comments