Skip to content

Commit ffe1cd5

Browse files
committed
Split street into number and name properties #112
1 parent 2aca690 commit ffe1cd5

4 files changed

Lines changed: 4 additions & 11 deletions

File tree

api/1.3/api.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,10 @@ class Generator {
152152

153153
let timezone = JSON.parse(randomItem(this.datasets.common.timezones));
154154
this.include('location', {
155-
street: range(1, 9999) + ' ' + randomItem(this.datasets[nat].street),
155+
street: {
156+
number: range(1, 9999),
157+
name: randomItem(this.datasets[nat].street)
158+
},
156159
city: randomItem(this.datasets[nat].cities),
157160
state: randomItem(this.datasets[nat].states),
158161
country: this.fullNatName(nat),

api/1.3/data/AU/inject.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,5 @@ module.exports = (inc, contents) => {
1313
include(inc, contents, 'picture', pic);
1414
include(inc, contents, 'location', () => {
1515
contents.location.postcode = range(200, 9999); // Override common postcode with AU range
16-
17-
// Override common postcode with AU range
18-
const oldStreet = contents.location.street;
19-
contents.location.street = contents.location.street.replace(/(\d+)/, range(1,9999));
2016
});
2117
};

api/1.3/data/DE/inject.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,5 @@ module.exports = (inc, contents) => {
1010
name: '',
1111
value: null
1212
});
13-
include(inc, contents, 'location', () => {
14-
const oldStreet = contents.location.street.replace(/(\d+) /, '');
15-
contents.location.street = oldStreet + ' ' + range(1, 200);
16-
});
1713
include(inc, contents, 'picture', pic);
1814
};

api/1.3/data/NO/inject.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ module.exports = (inc, contents, datasets) => {
6262
});
6363

6464
include(inc, contents, 'location', () => {
65-
const oldStreet = contents.location.street.replace(/(\d+) /, '');
66-
contents.location.street = oldStreet + ' ' + range(1, 9998);
6765
contents.location.postcode = randomItem(datasets['NO'].post_codes);
6866
});
6967
include(inc, contents, 'picture', pic);

0 commit comments

Comments
 (0)