-
Notifications
You must be signed in to change notification settings - Fork 288
Expand file tree
/
Copy pathinject.js
More file actions
21 lines (18 loc) · 788 Bytes
/
inject.js
File metadata and controls
21 lines (18 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const { random, randomItem, pad, range, uppercaseify, include, } = require('../../api');
module.exports = (inc, contents) => {
const pic = contents.picture;
delete contents.picture;
const generateNID = () => {
return random(3, 3) + ' ' + random(3, 3) + ' ' + random(4, 4);
};
include(inc, contents, 'phone', '0' + range(0, 9) + '-' + range(0, 9) + random(3, 3) + '-' + random(3, 4));
include(inc, contents, 'cell', '04' + random(3, 2) + '-' + random(3, 3) + '-' + random(3, 3));
include(inc, contents, 'id', {
name: 'NID',
value: generateNID()
});
include(inc, contents, 'picture', pic);
include(inc, contents, 'location', () => {
contents.location.postcode = range(1000, 8800);
});
};