1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
var definitions = require('./definitions');
var random = {
// returns a single random number based on a range
number: function (range) {
return Math.floor(Math.random() * range);
},
// takes an array and returns the array randomly sorted
array_element: function (array) {
var r = Math.floor(Math.random() * array.length);
return array[r];
},
city_prefix: function () {
return this.array_element(definitions.city_prefix());
},
city_suffix: function () {
return this.array_element(definitions.city_suffix());
},
street_suffix: function () {
return this.array_element(definitions.street_suffix());
},
br_state: function () {
return this.array_element(definitions.br_state());
},
br_state_abbr: function () {
return this.array_element(definitions.br_state_abbr());
},
us_state: function () {
return this.array_element(definitions.us_state());
},
us_state_abbr: function () {
return this.array_element(definitions.us_state_abbr());
},
uk_county: function () {
return this.array_element(definitions.uk_county());
},
uk_country: function () {
return this.array_element(definitions.uk_country());
},
first_name: function () {
return this.array_element(definitions.first_name());
},
last_name: function () {
return this.array_element(definitions.last_name());
},
name_prefix: function () {
return this.array_element(definitions.name_prefix());
},
name_suffix: function () {
return this.array_element(definitions.name_suffix());
},
catch_phrase_adjective: function () {
return this.array_element(definitions.catch_phrase_adjective());
},
catch_phrase_descriptor: function () {
return this.array_element(definitions.catch_phrase_descriptor());
},
catch_phrase_noun: function () {
return this.array_element(definitions.catch_phrase_noun());
},
bs_adjective: function () {
return this.array_element(definitions.bs_adjective());
},
bs_buzz: function () {
return this.array_element(definitions.bs_buzz());
},
bs_noun: function () {
return this.array_element(definitions.bs_noun());
},
phone_formats: function () {
return this.array_element(definitions.phone_formats());
},
domain_suffix: function () {
return this.array_element(definitions.domain_suffix());
}
};
module.exports = random;
|