faker 5.0.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/Readme.md +4 -0
  2. package/dist/faker.js +4980 -1829
  3. package/dist/faker.min.js +1 -1
  4. package/lib/address.js +20 -1
  5. package/lib/finance.js +17 -1
  6. package/lib/helpers.js +10 -3
  7. package/lib/image.js +3 -0
  8. package/lib/image_providers/lorempicsum.js +108 -0
  9. package/lib/index.js +1 -1
  10. package/lib/locales/en/address/country_code.js +0 -1
  11. package/lib/locales/en/address/country_code_alpha_3.js +252 -0
  12. package/lib/locales/en/address/index.js +1 -0
  13. package/lib/locales/en/finance/currency.js +3 -3
  14. package/lib/locales/en_IND/phone_number/formats.js +12 -3
  15. package/lib/locales/fi/index.js +4 -0
  16. package/lib/locales/fi/name/female_first_name.js +52 -0
  17. package/lib/locales/fi/name/first_name.js +102 -0
  18. package/lib/locales/fi/name/index.js +7 -0
  19. package/lib/locales/fi/name/last_name.js +52 -0
  20. package/lib/locales/fi/name/male_first_name.js +52 -0
  21. package/lib/locales/fi/name/name.js +6 -0
  22. package/lib/locales/fr/address/city_name.js +1 -1
  23. package/lib/locales/fr/name/female_first_name.js +453 -0
  24. package/lib/locales/fr/name/index.js +2 -1
  25. package/lib/locales/fr/name/male_first_name.js +498 -0
  26. package/lib/locales/ja/index.js +2 -1
  27. package/lib/locales/ja/lorem/index.js +4 -0
  28. package/lib/locales/ja/lorem/supplemental.js +508 -0
  29. package/lib/locales/ja/lorem/words.js +511 -0
  30. package/lib/locales/pl/name/last_name.js +8 -0
  31. package/lib/locales/pt_BR/address/city_prefix.js +0 -5
  32. package/lib/locales/pt_BR/address/city_suffix.js +0 -4
  33. package/lib/locales/pt_BR/address/postcode.js +0 -1
  34. package/lib/locales/pt_BR/address/street_suffix.js +0 -2
  35. package/lib/locales/pt_BR/commerce/color.js +47 -0
  36. package/lib/locales/pt_BR/commerce/department.js +24 -0
  37. package/lib/locales/pt_BR/commerce/index.js +5 -0
  38. package/lib/locales/pt_BR/commerce/product_name.js +59 -0
  39. package/lib/locales/pt_BR/date/index.js +4 -0
  40. package/lib/locales/pt_BR/date/month.js +63 -0
  41. package/lib/locales/pt_BR/date/weekday.js +43 -0
  42. package/lib/locales/pt_BR/index.js +2 -0
  43. package/lib/locales/pt_BR/name/first_name.js +120 -42
  44. package/lib/locales/pt_PT/phone_number/formats.js +1 -0
  45. package/lib/locales/ru/index.js +1 -0
  46. package/lib/locales/ru/lorem/index.js +3 -0
  47. package/lib/locales/ru/lorem/words.js +191 -0
  48. package/lib/locales/ru/name/index.js +6 -5
  49. package/lib/locales/ru/name/title.js +42 -0
  50. package/lib/locales/sv/commerce/product_name.js +8 -8
  51. package/lib/locales/vi/address/city_root.js +40 -40
  52. package/lib/locales/vi/address/country.js +195 -0
  53. package/lib/locales/vi/address/index.js +2 -1
  54. package/lib/locales/vi/address/postcode.js +3 -0
  55. package/lib/locales/vi/cell_phone/formats.js +5 -6
  56. package/lib/locales/vi/date/index.js +4 -0
  57. package/lib/locales/vi/date/month.js +63 -0
  58. package/lib/locales/vi/date/weekday.js +43 -0
  59. package/lib/locales/vi/index.js +1 -0
  60. package/lib/locales/vi/phone_number/formats.js +1 -14
  61. package/lib/locales/zh_CN/phone_number/formats.js +3 -3
  62. package/lib/locales.js +1 -0
  63. package/lib/lorem.js +11 -4
  64. package/lib/name.js +10 -0
  65. package/lib/random.js +2 -2
  66. package/locale/fi.js +5 -0
  67. package/package.json +1 -1
  68. package/vendor/user-agent.js +2 -1
  69. package/lib/locales/fr/name/first_name.js +0 -91
  70. package/lib/locales/vi/address/county.js +0 -73
@@ -6,7 +6,7 @@ module["exports"] = {
6
6
  "Intelligent",
7
7
  "Söt",
8
8
  "Otrolig",
9
- "Fatastisk",
9
+ "Fantastisk",
10
10
  "Praktisk",
11
11
  "Slimmad",
12
12
  "Grym"
@@ -17,8 +17,8 @@ module["exports"] = {
17
17
  "Trä",
18
18
  "Betong",
19
19
  "Plast",
20
- "Bomul",
21
- "Grnit",
20
+ "Bomull",
21
+ "Granit",
22
22
  "Gummi",
23
23
  "Latex"
24
24
  ],
@@ -27,10 +27,10 @@ module["exports"] = {
27
27
  "Bil",
28
28
  "Dator",
29
29
  "Handskar",
30
- "Pants",
31
- "Shirt",
32
- "Table",
33
- "Shoes",
34
- "Hat"
30
+ "Byxor",
31
+ "Skjorta",
32
+ "Bord",
33
+ "Skor",
34
+ "Hatt"
35
35
  ]
36
36
  };
@@ -1,65 +1,65 @@
1
1
  module["exports"] = [
2
- "Bắc Giang",
2
+ "An Giang",
3
+ "Bà Rịa-Vũng Tàu",
4
+ "Bạc Liêu",
3
5
  "Bắc Kạn",
6
+ "Bắc Giang",
4
7
  "Bắc Ninh",
8
+ "Bến Tre",
9
+ "Bình Dương",
10
+ "Bình Định",
11
+ "Bình Phước",
12
+ "Bình Thuận",
13
+ "Cà Mau",
5
14
  "Cao Bằng",
15
+ "Cần Thơ",
16
+ "Đà Nẵng",
17
+ "Đắk Lắk",
18
+ "Đắk Nông",
6
19
  "Điện Biên",
20
+ "Đồng Nai",
21
+ "Đồng Tháp",
22
+ "Gia Lai",
7
23
  "Hà Giang",
8
24
  "Hà Nam",
9
- "Hà Tây",
25
+ "Hà Nội",
26
+ "Hà Tĩnh",
10
27
  "Hải Dương",
11
- "TP Hải Phòng",
28
+ "Hải Phòng",
29
+ "Hậu Giang",
12
30
  "Hòa Bình",
31
+ "TP. Hồ Chí Minh",
13
32
  "Hưng Yên",
33
+ "Khánh Hoà",
34
+ "Kiên Giang",
35
+ "Kon Tum",
14
36
  "Lai Châu",
15
- "Lào Cai",
16
37
  "Lạng Sơn",
38
+ "Lào Cai",
39
+ "Lâm Đồng",
40
+ "Long An",
17
41
  "Nam Định",
42
+ "Nghệ An",
18
43
  "Ninh Bình",
44
+ "Ninh Thuận",
19
45
  "Phú Thọ",
20
- "Quảng Ninh",
21
- "Sơn La",
22
- "Thái Bình",
23
- "Thái Nguyên",
24
- "Tuyên Quang",
25
- "Vĩnh Phúc",
26
- "Yên Bái",
27
- "TP Đà Nẵng",
28
- "Bình Định",
29
- "Đắk Lắk",
30
- "Đắk Nông",
31
- "Gia Lai",
32
- "Hà Tĩnh",
33
- "Khánh Hòa",
34
- "Kon Tum",
35
- "Nghệ An",
36
46
  "Phú Yên",
37
47
  "Quảng Bình",
38
48
  "Quảng Nam",
39
49
  "Quảng Ngãi",
50
+ "Quảng Ninh",
40
51
  "Quảng Trị",
41
- "Thanh Hóa",
42
- "Thừa Thiên Huế",
43
- "TP TP. Hồ Chí Minh",
44
- "An Giang",
45
- "Bà Rịa Vũng Tàu",
46
- "Bạc Liêu",
47
- "Bến Tre",
48
- "Bình Dương",
49
- "Bình Phước",
50
- "Bình Thuận",
51
- "Cà Mau",
52
- "TP Cần Thơ",
53
- "Đồng Nai",
54
- "Đồng Tháp",
55
- "Hậu Giang",
56
- "Kiên Giang",
57
- "Lâm Đồng",
58
- "Long An",
59
- "Ninh Thuận",
60
52
  "Sóc Trăng",
53
+ "Sơn La",
61
54
  "Tây Ninh",
55
+ "Thái Bình",
56
+ "Thái Nguyên",
57
+ "Thanh Hoá",
58
+ "Thừa Thiên-Huế",
62
59
  "Tiền Giang",
63
60
  "Trà Vinh",
64
- "Vĩnh Long"
61
+ "Tuyên Quang",
62
+ "Vĩnh Long",
63
+ "Vĩnh Phúc",
64
+ "Yên Bái"
65
65
  ];
@@ -0,0 +1,195 @@
1
+ module["exports"] = [
2
+ "Afghanistan",
3
+ "Ai Cập",
4
+ "Albania",
5
+ "Algérie",
6
+ "Andorra",
7
+ "Angola",
8
+ "Vương quốc Liên hiệp Anh và Bắc Ireland",
9
+ "Antigua và Barbuda",
10
+ "Áo",
11
+ "Ả Rập Xê Út",
12
+ "Argentina",
13
+ "Armenia",
14
+ "Azerbaijan",
15
+ "Ấn Độ",
16
+ "Bahamas",
17
+ "Bahrain",
18
+ "Bangladesh",
19
+ "Barbados",
20
+ "Belarus",
21
+ "Belize",
22
+ "Bénin",
23
+ "Bhutan",
24
+ "Bỉ",
25
+ "Bolivia",
26
+ "Bosna và Hercegovina",
27
+ "Botswana",
28
+ "Bồ Đào Nha",
29
+ "Bờ Biển Ngà",
30
+ "Brasil",
31
+ "Brunei",
32
+ "Bulgaria",
33
+ "Burkina Faso",
34
+ "Burundi",
35
+ "Cabo Verde",
36
+ "Các Tiểu Vương quốc Ả Rập Thống nhất",
37
+ "Cameroon",
38
+ "Campuchia",
39
+ "Canada",
40
+ "Chile",
41
+ "Colombia",
42
+ "Comoros",
43
+ "Cộng hòa Congo",
44
+ "Cộng hòa Dân chủ Congo",
45
+ "Costa Rica",
46
+ "Croatia",
47
+ "Cuba",
48
+ "Djibouti",
49
+ "Dominica",
50
+ "Cộng hòa Dominica",
51
+ "Đan Mạch",
52
+ "Đông Timor",
53
+ "Đức",
54
+ "Ecuador",
55
+ "El Salvador",
56
+ "Eritrea",
57
+ "Estonia",
58
+ "Ethiopia",
59
+ "Fiji",
60
+ "Gabon",
61
+ "Gambia",
62
+ "Ghana",
63
+ "Grenada",
64
+ "Gruzia",
65
+ "Guatemala",
66
+ "Guiné-Bissau",
67
+ "Guinea Xích Đạo",
68
+ "Guinée",
69
+ "Guyana",
70
+ "Haiti",
71
+ "Hà Lan",
72
+ "Hàn Quốc",
73
+ "Hoa Kỳ",
74
+ "Honduras",
75
+ "Hungary",
76
+ "Hy Lạp",
77
+ "Iceland",
78
+ "Indonesia",
79
+ "Iran",
80
+ "Iraq",
81
+ "Ireland",
82
+ "Israel",
83
+ "Jamaica",
84
+ "Jordan",
85
+ "Kazakhstan",
86
+ "Kenya",
87
+ "Kiribati",
88
+ "Kosovo",
89
+ "Kuwait",
90
+ "Kyrgyzstan",
91
+ "Lào",
92
+ "Latvia",
93
+ "Lesotho",
94
+ "Liban",
95
+ "Liberia",
96
+ "Libya",
97
+ "Liechtenstein",
98
+ "Litva",
99
+ "Luxembourg",
100
+ "Macedonia",
101
+ "Madagascar",
102
+ "Malaysia",
103
+ "Mali",
104
+ "Malta",
105
+ "Maroc",
106
+ "Quần đảo Marshall",
107
+ "Mauritanie",
108
+ "Mauritius",
109
+ "México",
110
+ "Micronesia",
111
+ "Moldova",
112
+ "Monaco",
113
+ "Mông Cổ",
114
+ "Montenegro",
115
+ "Mozambique",
116
+ "Myanmar",
117
+ "Namibia",
118
+ "Nam Sudan",
119
+ "Nam Phi",
120
+ "Nauru",
121
+ "Na Uy",
122
+ "Nepal",
123
+ "New Zealand",
124
+ "Nicaragua",
125
+ "Niger",
126
+ "Nigeria",
127
+ "Nga",
128
+ "Nhật Bản",
129
+ "Oman",
130
+ "Pakistan",
131
+ "Palau",
132
+ "Palestine",
133
+ "Panama",
134
+ "Papua New Guinea",
135
+ "Paraguay",
136
+ "Peru",
137
+ "Pháp",
138
+ "Phần Lan",
139
+ "Philippines",
140
+ "Qatar",
141
+ "România",
142
+ "Rwanda",
143
+ "Saint Kitts và Nevis",
144
+ "Saint Lucia",
145
+ "Saint Vincent và Grenadines",
146
+ "Samoa",
147
+ "San Marino",
148
+ "São Tomé và Príncipe",
149
+ "Séc",
150
+ "Sénégal",
151
+ "Serbia",
152
+ "Seychelles",
153
+ "Sierra Leone",
154
+ "Singapore",
155
+ "Síp",
156
+ "Slovakia",
157
+ "Slovenia",
158
+ "Solomon",
159
+ "Somalia",
160
+ "Sri Lanka",
161
+ "Sudan",
162
+ "Suriname",
163
+ "Swaziland",
164
+ "Syria",
165
+ "Tajikistan",
166
+ "Tanzania",
167
+ "Tây Ban Nha",
168
+ "Tchad",
169
+ "Thái Lan",
170
+ "Thổ Nhĩ Kỳ",
171
+ "Thụy Điển",
172
+ "Thụy Sĩ",
173
+ "Togo",
174
+ "Tonga",
175
+ "Triều Tiên",
176
+ "Trinidad và Tobago",
177
+ "Trung Quốc",
178
+ "Trung Phi",
179
+ "Tunisia",
180
+ "Turkmenistan",
181
+ "Tuvalu",
182
+ "Úc",
183
+ "Uganda",
184
+ "Ukraina",
185
+ "Uruguay",
186
+ "Uzbekistan",
187
+ "Vanuatu",
188
+ "Vatican",
189
+ "Venezuela",
190
+ "Việt Nam",
191
+ "Ý",
192
+ "Yemen",
193
+ "Zambia",
194
+ "Zimbabwe"
195
+ ];
@@ -2,5 +2,6 @@ var address = {};
2
2
  module['exports'] = address;
3
3
  address.city_root = require("./city_root");
4
4
  address.city = require("./city");
5
- address.county = require("./county");
6
5
  address.default_country = require("./default_country");
6
+ address.postcode = require("./postcode");
7
+ address.country = require("./country");
@@ -0,0 +1,3 @@
1
+ module["exports"] = [
2
+ "#####"
3
+ ];
@@ -1,8 +1,7 @@
1
1
  module["exports"] = [
2
- "074## ######",
3
- "075## ######",
4
- "076## ######",
5
- "077## ######",
6
- "078## ######",
7
- "079## ######"
2
+ "03# ### ####",
3
+ "05# ### ####",
4
+ "07# ### ####",
5
+ "08# ### ####",
6
+ "09# ### ####"
8
7
  ];
@@ -0,0 +1,4 @@
1
+ var date = {};
2
+ module["exports"] = date;
3
+ date.month = require("./month");
4
+ date.weekday = require("./weekday");
@@ -0,0 +1,63 @@
1
+ // Source: http://unicode.org/cldr/trac/browser/tags/release-27/common/main/en.xml#L1799
2
+ module["exports"] = {
3
+ wide: [
4
+ "Tháng Giêng",
5
+ "Tháng Hai",
6
+ "Tháng Ba",
7
+ "Tháng Tư",
8
+ "Tháng Năm",
9
+ "Tháng Sáu",
10
+ "Tháng Bảy",
11
+ "Tháng Tám",
12
+ "Tháng Chín",
13
+ "Tháng Mười",
14
+ "Tháng Mười Một",
15
+ "Tháng Mười Hai"
16
+ ],
17
+ // Property "wide_context" is optional, if not set then "wide" will be used instead
18
+ // It is used to specify a word in context, which may differ from a stand-alone word
19
+ wide_context: [
20
+ "Tháng Giêng",
21
+ "Tháng Hai",
22
+ "Tháng Ba",
23
+ "Tháng Tư",
24
+ "Tháng Năm",
25
+ "Tháng Sáu",
26
+ "Tháng Bảy",
27
+ "Tháng Tám",
28
+ "Tháng Chín",
29
+ "Tháng Mười",
30
+ "Tháng Mười Một",
31
+ "Tháng Mười Hai"
32
+ ],
33
+ abbr: [
34
+ "Tháng 1",
35
+ "Tháng 2",
36
+ "Tháng 3",
37
+ "Tháng 4",
38
+ "Tháng 5",
39
+ "Tháng 6",
40
+ "Tháng 7",
41
+ "Tháng 8",
42
+ "Tháng 9",
43
+ "Tháng 10",
44
+ "Tháng 11",
45
+ "Tháng 12"
46
+ ],
47
+ // Property "abbr_context" is optional, if not set then "abbr" will be used instead
48
+ // It is used to specify a word in context, which may differ from a stand-alone word
49
+ abbr_context: [
50
+ "Tháng 1",
51
+ "Tháng 2",
52
+ "Tháng 3",
53
+ "Tháng 4",
54
+ "Tháng 5",
55
+ "Tháng 6",
56
+ "Tháng 7",
57
+ "Tháng 8",
58
+ "Tháng 9",
59
+ "Tháng 10",
60
+ "Tháng 11",
61
+ "Tháng 12"
62
+ ]
63
+ };
@@ -0,0 +1,43 @@
1
+ // Source: http://unicode.org/cldr/trac/browser/tags/release-27/common/main/en.xml#L1847
2
+ module["exports"] = {
3
+ wide: [
4
+ "Chủ nhật",
5
+ "Thứ hai",
6
+ "Thứ ba",
7
+ "Thứ tư",
8
+ "Thứ năm",
9
+ "Thứ sáu",
10
+ "Thứ bảy"
11
+ ],
12
+ // Property "wide_context" is optional, if not set then "wide" will be used instead
13
+ // It is used to specify a word in context, which may differ from a stand-alone word
14
+ wide_context: [
15
+ "Chủ nhật",
16
+ "Thứ hai",
17
+ "Thứ ba",
18
+ "Thứ tư",
19
+ "Thứ năm",
20
+ "Thứ sáu",
21
+ "Thứ bảy"
22
+ ],
23
+ abbr: [
24
+ "CN",
25
+ "T2",
26
+ "T3",
27
+ "T4",
28
+ "T5",
29
+ "T6",
30
+ "T7",
31
+ ],
32
+ // Property "abbr_context" is optional, if not set then "abbr" will be used instead
33
+ // It is used to specify a word in context, which may differ from a stand-alone word
34
+ abbr_context: [
35
+ "C.Nhật",
36
+ "Thứ 2",
37
+ "Thứ 3",
38
+ "Thứ 4",
39
+ "Thứ 5",
40
+ "Thứ 6",
41
+ "Thứ 7",
42
+ ]
43
+ };
@@ -8,3 +8,4 @@ vi.cell_phone = require("./cell_phone");
8
8
  vi.name = require("./name");
9
9
  vi.company = require("./company");
10
10
  vi.lorem = require("./lorem");
11
+ vi.date = require("./date");
@@ -1,17 +1,4 @@
1
1
  module["exports"] = [
2
- "01#### #####",
3
- "01### ######",
4
- "01#1 ### ####",
5
- "011# ### ####",
6
2
  "02# #### ####",
7
- "03## ### ####",
8
- "055 #### ####",
9
- "056 #### ####",
10
- "0800 ### ####",
11
- "08## ### ####",
12
- "09## ### ####",
13
- "016977 ####",
14
- "01### #####",
15
- "0500 ######",
16
- "0800 ######"
3
+ "02## #### ####"
17
4
  ];
@@ -1,5 +1,5 @@
1
1
  module["exports"] = [
2
- "###-########",
3
- "####-########",
4
- "###########"
2
+ "0##-########",
3
+ "0###-########",
4
+ "1##########"
5
5
  ];
package/lib/locales.js CHANGED
@@ -17,6 +17,7 @@ exports['en_ZA'] = require('./locales/en_ZA');
17
17
  exports['es'] = require('./locales/es');
18
18
  exports['es_MX'] = require('./locales/es_MX');
19
19
  exports['fa'] = require('./locales/fa');
20
+ exports['fi'] = require('./locales/fi');
20
21
  exports['fr'] = require('./locales/fr');
21
22
  exports['fr_CA'] = require('./locales/fr_CA');
22
23
  exports['fr_CH'] = require('./locales/fr_CH');
package/lib/lorem.js CHANGED
@@ -8,13 +8,20 @@ var Lorem = function (faker) {
8
8
  var Helpers = faker.helpers;
9
9
 
10
10
  /**
11
- * word
11
+ * generates a word of a specified length
12
12
  *
13
13
  * @method faker.lorem.word
14
- * @param {number} num
14
+ * @param {number} length length of the word that should be returned. Defaults to a random length
15
15
  */
16
- self.word = function (num) {
17
- return faker.random.arrayElement(faker.definitions.lorem.words);
16
+ self.word = function (length) {
17
+ var hasRightLength = function(word) { return word.length === length; };
18
+ var properLengthWords;
19
+ if(typeof length === 'undefined') {
20
+ properLengthWords = faker.definitions.lorem.words;
21
+ } else {
22
+ properLengthWords = faker.definitions.lorem.words.filter(hasRightLength);
23
+ }
24
+ return faker.random.arrayElement(properLengthWords);
18
25
  };
19
26
 
20
27
  /**
package/lib/name.js CHANGED
@@ -15,6 +15,16 @@ function Name (faker) {
15
15
  if (typeof faker.definitions.name.male_first_name !== "undefined" && typeof faker.definitions.name.female_first_name !== "undefined") {
16
16
  // some locale datasets ( like ru ) have first_name split by gender. since the name.first_name field does not exist in these datasets,
17
17
  // we must randomly pick a name from either gender array so faker.name.firstName will return the correct locale data ( and not fallback )
18
+
19
+ if(typeof gender === 'string') {
20
+ if(gender.toLowerCase() === 'male') {
21
+ gender = 0;
22
+ }
23
+ else if(gender.toLowerCase() === 'female') {
24
+ gender = 1;
25
+ }
26
+ }
27
+
18
28
  if (typeof gender !== 'number') {
19
29
  if(typeof faker.definitions.name.first_name === "undefined") {
20
30
  gender = faker.random.number(1);
package/lib/random.js CHANGED
@@ -202,8 +202,8 @@ function Random (faker, seed) {
202
202
 
203
203
  // randomly pick from the many faker methods that can generate words
204
204
  var randomWordMethod = faker.random.arrayElement(wordMethods);
205
- return faker.fake('{{' + randomWordMethod + '}}');
206
-
205
+ var result = faker.fake('{{' + randomWordMethod + '}}');
206
+ return faker.random.arrayElement(result.split(' '));
207
207
  }
208
208
 
209
209
  /**
package/locale/fi.js ADDED
@@ -0,0 +1,5 @@
1
+ var Faker = require('../lib');
2
+ var faker = new Faker({ locale: 'fi', localeFallback: 'en' });
3
+ faker.locales['fi'] = require('../lib/locales/fi');
4
+ faker.locales['en'] = require('../lib/locales/en');
5
+ module['exports'] = faker;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "faker",
3
3
  "description": "Generate massive amounts of fake contextual data",
4
- "version": "5.0.0",
4
+ "version": "5.1.0",
5
5
  "contributors": [
6
6
  "Marak Squires <marak.squires@gmail.com>"
7
7
  ],
@@ -43,7 +43,8 @@ function rnd(a, b) {
43
43
 
44
44
  if (Object.prototype.toString.call(a) === "[object Array]") {
45
45
  //returns a random element from array (a), even weighting
46
- return a[Math.floor(Math.random() * a.length)];
46
+ var faker = require('../');
47
+ return faker.random.arrayElement(a);
47
48
  }
48
49
 
49
50
  if (a && typeof a === 'object') {