faker 5.3.1 → 5.5.2
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.
- package/{.jshintignore → .eslintignore} +0 -0
- package/.eslintrc +54 -0
- package/.travis.yml +3 -0
- package/Readme.md +48 -3
- package/dist/faker.js +71873 -39072
- package/dist/faker.min.js +1 -1
- package/lib/address.js +121 -107
- package/lib/animal.js +124 -0
- package/lib/commerce.js +16 -16
- package/lib/company.js +8 -8
- package/lib/database.js +4 -4
- package/lib/datatype.js +226 -0
- package/lib/date.js +94 -72
- package/lib/finance.js +44 -22
- package/lib/git.js +1 -1
- package/lib/helpers.js +8 -8
- package/lib/iban.js +22 -14
- package/lib/image.js +14 -14
- package/lib/image_providers/lorempixel.js +1 -1
- package/lib/index.js +58 -47
- package/lib/internet.js +148 -119
- package/lib/locales/af_ZA/name/female_first_name.js +112 -112
- package/lib/locales/af_ZA/name/first_name.js +222 -222
- package/lib/locales/af_ZA/name/male_first_name.js +115 -115
- package/lib/locales/ar/address/state.js +62 -1
- package/lib/locales/ar/date/index.js +4 -0
- package/lib/locales/ar/date/month.js +63 -0
- package/lib/locales/ar/date/weekday.js +22 -0
- package/lib/locales/ar/index.js +2 -0
- package/lib/locales/cz/address/index.js +0 -1
- package/lib/locales/cz/name/first_name.js +3 -0
- package/lib/locales/cz/name/index.js +2 -0
- package/lib/locales/cz/name/last_name.js +3 -0
- package/lib/locales/de_CH/address/city.js +3 -0
- package/lib/locales/de_CH/address/city_name.js +102 -0
- package/lib/locales/de_CH/address/index.js +4 -0
- package/lib/locales/de_CH/address/state.js +28 -0
- package/lib/locales/de_CH/address/state_abbr.js +28 -0
- package/lib/locales/de_CH/name/first_name.js +336 -336
- package/lib/locales/de_CH/name/last_name.js +209 -209
- package/lib/locales/en/address/city_name.js +1002 -0
- package/lib/locales/en/address/country_code_alpha_3.js +250 -250
- package/lib/locales/en/address/index.js +1 -0
- package/lib/locales/en/animal/bear.js +10 -0
- package/lib/locales/en/animal/bird.js +916 -0
- package/lib/locales/en/animal/cat.js +57 -0
- package/lib/locales/en/animal/cetacean.js +56 -0
- package/lib/locales/en/animal/cow.js +521 -0
- package/lib/locales/en/animal/crocodilia.js +26 -0
- package/lib/locales/en/animal/dog.js +499 -0
- package/lib/locales/en/animal/fish.js +98 -0
- package/lib/locales/en/animal/horse.js +347 -0
- package/lib/locales/en/animal/index.js +16 -0
- package/lib/locales/en/animal/insect.js +132 -0
- package/lib/locales/en/animal/lion.js +9 -0
- package/lib/locales/en/animal/rabbit.js +51 -0
- package/lib/locales/en/animal/snake.js +583 -0
- package/lib/locales/en/animal/type.js +15 -0
- package/lib/locales/en/finance/currency.js +0 -4
- package/lib/locales/en/index.js +1 -0
- package/lib/locales/en/internet/avatar_uri.js +1250 -1254
- package/lib/locales/en/music/genre.js +18 -18
- package/lib/locales/en/name/binary_gender.js +4 -0
- package/lib/locales/en/name/female_first_name.js +501 -501
- package/lib/locales/en/name/gender.js +71 -71
- package/lib/locales/en/name/index.js +1 -0
- package/lib/locales/en/name/male_first_name.js +501 -501
- package/lib/locales/en/system/directoryPaths.js +60 -60
- package/lib/locales/en/vehicle/bicycle.js +20 -0
- package/lib/locales/en/vehicle/index.js +1 -0
- package/lib/locales/en_GH/address/building_number.js +5 -0
- package/lib/locales/en_GH/address/city.js +3 -0
- package/lib/locales/en_GH/address/city_name.js +355 -0
- package/lib/locales/en_GH/address/default_country.js +3 -0
- package/lib/locales/en_GH/address/index.js +12 -0
- package/lib/locales/en_GH/address/postcode.js +4 -0
- package/lib/locales/en_GH/address/state.js +18 -0
- package/lib/locales/en_GH/address/street_address.js +3 -0
- package/lib/locales/en_GH/address/street_name.js +4 -0
- package/lib/locales/en_GH/address/street_prefix.js +3 -0
- package/lib/locales/en_GH/address/street_suffix.js +10 -0
- package/lib/locales/en_GH/company/index.js +4 -0
- package/lib/locales/en_GH/company/name.js +4 -0
- package/lib/locales/en_GH/company/suffix.js +4 -0
- package/lib/locales/en_GH/index.js +8 -0
- package/lib/locales/en_GH/internet/domain_suffix.js +11 -0
- package/lib/locales/en_GH/internet/index.js +3 -0
- package/lib/locales/en_GH/name/female_first_name.js +146 -0
- package/lib/locales/en_GH/name/first_name.js +4 -0
- package/lib/locales/en_GH/name/index.js +7 -0
- package/lib/locales/en_GH/name/last_name.js +124 -0
- package/lib/locales/en_GH/name/male_first_name.js +134 -0
- package/lib/locales/en_GH/name/name.js +6 -0
- package/lib/locales/en_GH/phone_number/formats.js +28 -0
- package/lib/locales/{nep → en_GH}/phone_number/index.js +0 -0
- package/lib/locales/en_NG/address/city_prefix.js +525 -525
- package/lib/locales/en_NG/address/state.js +37 -37
- package/lib/locales/en_NG/name/female_first_name.js +13 -13
- package/lib/locales/en_NG/name/first_name.js +33 -33
- package/lib/locales/en_NG/name/male_first_name.js +22 -22
- package/lib/locales/en_NG/phone_number/formats.js +5 -5
- package/lib/locales/en_US/address/postcode_by_state.js +104 -104
- package/lib/locales/en_ZA/address/city_prefix.js +14 -14
- package/lib/locales/en_ZA/address/state.js +9 -9
- package/lib/locales/en_ZA/cell_phone/formats.js +18 -18
- package/lib/locales/en_ZA/name/female_first_name.js +292 -292
- package/lib/locales/en_ZA/name/first_name.js +539 -539
- package/lib/locales/en_ZA/name/male_first_name.js +252 -252
- package/lib/locales/es/commerce/color.js +9 -9
- package/lib/locales/es/commerce/department.js +19 -19
- package/lib/locales/es/commerce/product_name.js +54 -54
- package/lib/locales/es/name/female_first_name.js +12 -12
- package/lib/locales/es/name/male_first_name.js +17 -17
- package/lib/locales/es_MX/address/street.js +39 -39
- package/lib/locales/es_MX/commerce/color.js +31 -31
- package/lib/locales/es_MX/commerce/department.js +22 -22
- package/lib/locales/es_MX/commerce/product_name.js +56 -56
- package/lib/locales/es_MX/company/bs_noun.js +44 -44
- package/lib/locales/es_MX/company/bs_verb.js +60 -60
- package/lib/locales/es_MX/lorem/words.js +268 -268
- package/lib/locales/es_MX/name/first_name.js +304 -304
- package/lib/locales/es_MX/name/last_name.js +686 -686
- package/lib/locales/es_MX/name/title.js +1 -1
- package/lib/locales/es_MX/team/creature.js +66 -66
- package/lib/locales/fa/name/female_first_name.js +67 -67
- package/lib/locales/fa/name/male_first_name.js +74 -74
- package/lib/locales/fa/vehicle/model.js +1 -1
- package/lib/locales/fi/name/female_first_name.js +50 -50
- package/lib/locales/fi/name/first_name.js +100 -100
- package/lib/locales/fi/name/last_name.js +50 -50
- package/lib/locales/fi/name/male_first_name.js +50 -50
- package/lib/locales/fr/address/city_name.js +84 -84
- package/lib/locales/fr/address/country.js +195 -0
- package/lib/locales/fr/address/index.js +1 -0
- package/lib/locales/fr/name/female_first_name.js +451 -451
- package/lib/locales/fr/name/first_name.js +3 -0
- package/lib/locales/fr/name/index.js +1 -0
- package/lib/locales/fr/name/male_first_name.js +496 -496
- package/lib/locales/fr_BE/adresses/building_number.js +12 -0
- package/lib/locales/fr_BE/adresses/city.js +4 -0
- package/lib/locales/fr_BE/adresses/city_prefix.js +265 -0
- package/lib/locales/fr_BE/adresses/city_suffix.js +6 -0
- package/lib/locales/fr_BE/adresses/default_country.js +3 -0
- package/lib/locales/fr_BE/adresses/index.js +25 -0
- package/lib/locales/fr_BE/adresses/postcode.js +3 -0
- package/lib/locales/fr_BE/adresses/state.js +12 -0
- package/lib/locales/fr_BE/adresses/state_abbr.js +11 -0
- package/lib/locales/fr_BE/adresses/street_address.js +3 -0
- package/lib/locales/fr_BE/adresses/street_name.js +5 -0
- package/lib/locales/fr_BE/adresses/street_prefix.js +21 -0
- package/lib/locales/fr_BE/adresses/street_suffix.js +212 -0
- package/lib/locales/fr_BE/cell_phone/formats.js +34 -0
- package/lib/locales/fr_BE/cell_phone/index.js +3 -0
- package/lib/locales/fr_BE/index.js +20 -0
- package/lib/locales/fr_BE/internet/domain_suffix.js +10 -0
- package/lib/locales/fr_BE/internet/free_email.js +6 -0
- package/lib/locales/{nep → fr_BE}/internet/index.js +0 -0
- package/lib/locales/fr_BE/name/first_name.js +3009 -0
- package/lib/locales/fr_BE/name/first_name_female.js +1532 -0
- package/lib/locales/fr_BE/name/first_name_male.js +1482 -0
- package/lib/locales/fr_BE/name/gender.js +10 -0
- package/lib/locales/fr_BE/name/index.js +11 -0
- package/lib/locales/fr_BE/name/last_name.js +624 -0
- package/lib/locales/fr_BE/name/name.js +8 -0
- package/lib/locales/fr_BE/name/prefix.js +6 -0
- package/lib/locales/fr_BE/name/suffix.js +8 -0
- package/lib/locales/fr_BE/name/title.js +22 -0
- package/lib/locales/fr_BE/phone_number/formats.js +93 -0
- package/lib/locales/fr_BE/phone_number/index.js +3 -0
- package/lib/locales/hr/address/city_name.js +128 -128
- package/lib/locales/hr/address/country.js +246 -246
- package/lib/locales/hr/address/street.js +375 -375
- package/lib/locales/hr/date/month.js +24 -24
- package/lib/locales/hr/date/weekday.js +7 -7
- package/lib/locales/hr/name/female_first_name.js +238 -238
- package/lib/locales/hr/name/first_name.js +409 -409
- package/lib/locales/hr/name/last_name.js +11617 -11617
- package/lib/locales/hr/name/male_first_name.js +171 -171
- package/lib/locales/hr/name/name.js +6 -6
- package/lib/locales/hr/name/prefix.js +5 -5
- package/lib/locales/hr/name/suffix.js +2 -2
- package/lib/locales/hy/address/building_number.js +8 -0
- package/lib/locales/hy/address/city.js +4 -0
- package/lib/locales/hy/address/city_prefix.js +7 -0
- package/lib/locales/hy/address/city_suffix.js +5 -0
- package/lib/locales/hy/address/country.js +231 -0
- package/lib/locales/hy/address/default_country.js +3 -0
- package/lib/locales/hy/address/direction.js +10 -0
- package/lib/locales/hy/address/index.js +14 -0
- package/lib/locales/hy/address/secondary_address.js +4 -0
- package/lib/locales/hy/address/state.js +21 -0
- package/lib/locales/hy/address/street_address.js +3 -0
- package/lib/locales/hy/address/street_name.js +3 -0
- package/lib/locales/hy/address/street_suffix.js +4 -0
- package/lib/locales/hy/commerce/color.js +14 -0
- package/lib/locales/hy/commerce/index.js +3 -0
- package/lib/locales/hy/date/index.js +4 -0
- package/lib/locales/hy/date/month.js +30 -0
- package/lib/locales/hy/date/weekday.js +21 -0
- package/lib/locales/hy/index.js +11 -0
- package/lib/locales/hy/internet/domain_suffix.js +9 -0
- package/lib/locales/hy/internet/index.js +3 -0
- package/lib/locales/hy/lorem/index.js +3 -0
- package/lib/locales/hy/lorem/words.js +191 -0
- package/lib/locales/hy/name/female_first_name.js +48 -0
- package/lib/locales/hy/name/first_name.js +93 -0
- package/lib/locales/hy/name/index.js +7 -0
- package/lib/locales/hy/name/last_name.js +94 -0
- package/lib/locales/hy/name/male_first_name.js +47 -0
- package/lib/locales/hy/name/name.js +8 -0
- package/lib/locales/hy/phone_number/formats.js +4 -0
- package/lib/locales/hy/phone_number/index.js +3 -0
- package/lib/locales/id_ID/name/female_first_name.js +45 -1
- package/lib/locales/id_ID/name/female_last_name.js +41 -1
- package/lib/locales/id_ID/name/male_last_name.js +47 -2
- package/lib/locales/it/address/city_name.js +981 -0
- package/lib/locales/it/address/index.js +1 -0
- package/lib/locales/it/name/last_name.js +2163 -628
- package/lib/locales/ja/address/country.js +169 -0
- package/lib/locales/ja/address/index.js +1 -0
- package/lib/locales/ko/address/postcode.js +2 -1
- package/lib/locales/ko/name/first_name.js +2994 -1
- package/lib/locales/ko/name/last_name.js +98 -1
- package/lib/locales/lv/commerce/product_name.js +14 -14
- package/lib/locales/nb_NO/name/index.js +2 -2
- package/lib/locales/{nep → ne}/address/city.js +0 -0
- package/lib/locales/{nep → ne}/address/default_country.js +0 -0
- package/lib/locales/{nep → ne}/address/index.js +0 -0
- package/lib/locales/{nep → ne}/address/postcode.js +0 -0
- package/lib/locales/{nep → ne}/address/state.js +0 -0
- package/lib/locales/{nep → ne}/company/index.js +0 -0
- package/lib/locales/{nep → ne}/company/suffix.js +0 -0
- package/lib/locales/ne/index.js +8 -0
- package/lib/locales/{nep → ne}/internet/domain_suffix.js +0 -0
- package/lib/locales/{nep → ne}/internet/free_email.js +0 -0
- package/lib/locales/ne/internet/index.js +4 -0
- package/lib/locales/{nep → ne}/name/first_name.js +0 -0
- package/lib/locales/{nep → ne}/name/index.js +0 -0
- package/lib/locales/{nep → ne}/name/last_name.js +0 -0
- package/lib/locales/{nep → ne}/phone_number/formats.js +0 -0
- package/lib/locales/ne/phone_number/index.js +3 -0
- package/lib/locales/nl/address/country.js +5 -7
- package/lib/locales/nl/address/secondary_address.js +2 -1
- package/lib/locales/nl/address/street_suffix.js +3 -1
- package/lib/locales/nl/commerce/color.js +38 -0
- package/lib/locales/nl/commerce/department.js +24 -0
- package/lib/locales/nl/commerce/index.js +5 -0
- package/lib/locales/nl/commerce/product_name.js +72 -0
- package/lib/locales/nl/company/suffix.js +5 -2
- package/lib/locales/nl/date/index.js +4 -0
- package/lib/locales/nl/date/month.js +63 -0
- package/lib/locales/nl/date/weekday.js +43 -0
- package/lib/locales/nl/hacker/adjective.js +25 -0
- package/lib/locales/nl/hacker/index.js +6 -0
- package/lib/locales/nl/hacker/noun.js +28 -0
- package/lib/locales/nl/hacker/phrase.js +10 -0
- package/lib/locales/nl/hacker/verb.js +23 -0
- package/lib/locales/nl/index.js +3 -0
- package/lib/locales/nl/internet/domain_suffix.js +2 -1
- package/lib/locales/nl/name/female_first_name.js +517 -0
- package/lib/locales/nl/name/index.js +2 -0
- package/lib/locales/nl/name/male_first_name.js +590 -0
- package/lib/locales/pl/name/female_first_name.js +176 -0
- package/lib/locales/pl/name/first_name.js +3 -410
- package/lib/locales/pl/name/male_first_name.js +236 -0
- package/lib/locales/pt_BR/address/city_suffix.js +4 -0
- package/lib/locales/pt_BR/address/country.js +41 -44
- package/lib/locales/pt_BR/address/state_abbr.js +4 -1
- package/lib/locales/pt_BR/company/suffix.js +1 -0
- package/lib/locales/pt_BR/name/female_first_name.js +82 -0
- package/lib/locales/pt_BR/name/index.js +2 -0
- package/lib/locales/pt_BR/name/male_first_name.js +90 -0
- package/lib/locales/pt_BR/name/name.js +8 -0
- package/lib/locales/pt_BR/name/prefix.js +2 -1
- package/lib/locales/pt_PT/phone_number/formats.js +1 -0
- package/lib/locales/ro/address/city.js +300 -300
- package/lib/locales/ro/address/county.js +42 -42
- package/lib/locales/ro/address/state.js +42 -42
- package/lib/locales/ro/address/state_abbr.js +42 -42
- package/lib/locales/ro/address/street_address.js +1 -1
- package/lib/locales/ro/address/street_suffix.js +3 -3
- package/lib/locales/ro/address/streets.js +100 -100
- package/lib/locales/ro/cell_phone/formats.js +59 -59
- package/lib/locales/ro/internet/domain_suffix.js +19 -19
- package/lib/locales/ro/internet/index.js +0 -1
- package/lib/locales/ro/name/female_first_name.js +387 -387
- package/lib/locales/ro/name/last_name.js +300 -300
- package/lib/locales/ro/name/male_first_name.js +288 -288
- package/lib/locales/ro/name/name.js +32 -32
- package/lib/locales/ro/name/prefix.js +3 -3
- package/lib/locales/ro/name/suffix.js +2 -2
- package/lib/locales/ro/phone_number/formats.js +82 -82
- package/lib/locales/sk/address/index.js +0 -1
- package/lib/locales/tr/name/female_first_name.js +416 -0
- package/lib/locales/tr/name/index.js +2 -0
- package/lib/locales/tr/name/male_first_name.js +754 -0
- package/lib/locales/tr/name/name.js +2 -2
- package/lib/locales/vi/name/female_first_name.js +1312 -0
- package/lib/locales/vi/name/first_name.js +3 -28
- package/lib/locales/vi/name/index.js +5 -3
- package/lib/locales/vi/name/last_name.js +1 -48
- package/lib/locales/vi/name/male_first_name.js +1227 -0
- package/lib/locales/vi/name/name.js +3 -2
- package/lib/locales/zu_ZA/name/female_first_name.js +50 -50
- package/lib/locales/zu_ZA/name/first_name.js +100 -100
- package/lib/locales/zu_ZA/name/last_name.js +100 -100
- package/lib/locales/zu_ZA/name/male_first_name.js +51 -51
- package/lib/locales.js +2 -1
- package/lib/lorem.js +25 -25
- package/lib/mersenne.js +31 -0
- package/lib/music.js +9 -9
- package/lib/name.js +36 -32
- package/lib/phone_number.js +4 -4
- package/lib/random.js +138 -150
- package/lib/system.js +114 -63
- package/lib/time.js +1 -1
- package/lib/vehicle.js +38 -4
- package/locale/ReadMe.md +1 -1
- package/locale/en.js +1 -1
- package/locale/en_GH.js +5 -0
- package/locale/hy.js +5 -0
- package/locale/ne.js +5 -0
- package/package.json +4 -3
- package/vendor/mersenne.js +194 -222
- package/vendor/user-agent.js +155 -155
- package/.jshintrc +0 -87
- package/lib/locales/cz/address/time_zone.js +0 -145
- package/lib/locales/el/internet/avatar_uri.js +0 -1256
- package/lib/locales/nep/index.js +0 -8
- package/lib/locales/ro/internet/avatar_uri.js +0 -1265
- package/lib/locales/sk/address/time_zone.js +0 -145
- package/locale/nep.js +0 -5
package/lib/address.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
function Address (faker) {
|
|
6
6
|
var f = faker.fake,
|
|
7
|
-
|
|
7
|
+
Helpers = faker.helpers;
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Generates random zipcode from format. If format is not specified, the
|
|
@@ -39,7 +39,7 @@ function Address (faker) {
|
|
|
39
39
|
this.zipCodeByState = function (state) {
|
|
40
40
|
var zipRange = faker.definitions.address.postcode_by_state[state];
|
|
41
41
|
if (zipRange) {
|
|
42
|
-
return faker.
|
|
42
|
+
return faker.datatype.number(zipRange);
|
|
43
43
|
}
|
|
44
44
|
return faker.address.zipCode();
|
|
45
45
|
}
|
|
@@ -55,6 +55,7 @@ function Address (faker) {
|
|
|
55
55
|
* * `{{address.cityPrefix}} {{name.firstName}}`
|
|
56
56
|
* * `{{name.firstName}}{{address.citySuffix}}`
|
|
57
57
|
* * `{{name.lastName}}{{address.citySuffix}}`
|
|
58
|
+
* * `{{address.cityName}}` when city name is available
|
|
58
59
|
*
|
|
59
60
|
* @method faker.address.city
|
|
60
61
|
* @param {String} format
|
|
@@ -67,8 +68,12 @@ function Address (faker) {
|
|
|
67
68
|
'{{name.lastName}}{{address.citySuffix}}'
|
|
68
69
|
];
|
|
69
70
|
|
|
71
|
+
if (!format && faker.definitions.address.city_name) {
|
|
72
|
+
formats.push('{{address.cityName}}');
|
|
73
|
+
}
|
|
74
|
+
|
|
70
75
|
if (typeof format !== "number") {
|
|
71
|
-
format = faker.
|
|
76
|
+
format = faker.datatype.number(formats.length - 1);
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
return f(formats[format]);
|
|
@@ -92,27 +97,36 @@ function Address (faker) {
|
|
|
92
97
|
return faker.random.arrayElement(faker.definitions.address.city_suffix);
|
|
93
98
|
}
|
|
94
99
|
|
|
100
|
+
/**
|
|
101
|
+
* Returns a random city name
|
|
102
|
+
*
|
|
103
|
+
* @method faker.address.cityName
|
|
104
|
+
*/
|
|
105
|
+
this.cityName = function() {
|
|
106
|
+
return faker.random.arrayElement(faker.definitions.address.city_name);
|
|
107
|
+
}
|
|
108
|
+
|
|
95
109
|
/**
|
|
96
110
|
* Returns a random localized street name
|
|
97
111
|
*
|
|
98
112
|
* @method faker.address.streetName
|
|
99
113
|
*/
|
|
100
114
|
this.streetName = function () {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
115
|
+
var result;
|
|
116
|
+
var suffix = faker.address.streetSuffix();
|
|
117
|
+
if (suffix !== "") {
|
|
118
|
+
suffix = " " + suffix
|
|
119
|
+
}
|
|
106
120
|
|
|
107
|
-
|
|
121
|
+
switch (faker.datatype.number(1)) {
|
|
108
122
|
case 0:
|
|
109
|
-
|
|
110
|
-
|
|
123
|
+
result = faker.name.lastName() + suffix;
|
|
124
|
+
break;
|
|
111
125
|
case 1:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
126
|
+
result = faker.name.firstName() + suffix;
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
return result;
|
|
116
130
|
}
|
|
117
131
|
|
|
118
132
|
//
|
|
@@ -125,20 +139,20 @@ function Address (faker) {
|
|
|
125
139
|
* @param {Boolean} useFullAddress
|
|
126
140
|
*/
|
|
127
141
|
this.streetAddress = function (useFullAddress) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
142
|
+
if (useFullAddress === undefined) { useFullAddress = false; }
|
|
143
|
+
var address = "";
|
|
144
|
+
switch (faker.datatype.number(2)) {
|
|
131
145
|
case 0:
|
|
132
|
-
|
|
133
|
-
|
|
146
|
+
address = Helpers.replaceSymbolWithNumber("#####") + " " + faker.address.streetName();
|
|
147
|
+
break;
|
|
134
148
|
case 1:
|
|
135
|
-
|
|
136
|
-
|
|
149
|
+
address = Helpers.replaceSymbolWithNumber("####") + " " + faker.address.streetName();
|
|
150
|
+
break;
|
|
137
151
|
case 2:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
152
|
+
address = Helpers.replaceSymbolWithNumber("###") + " " + faker.address.streetName();
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
return useFullAddress ? (address + " " + faker.address.secondaryAddress()) : address;
|
|
142
156
|
}
|
|
143
157
|
|
|
144
158
|
/**
|
|
@@ -147,7 +161,7 @@ function Address (faker) {
|
|
|
147
161
|
* @method faker.address.streetSuffix
|
|
148
162
|
*/
|
|
149
163
|
this.streetSuffix = function () {
|
|
150
|
-
|
|
164
|
+
return faker.random.arrayElement(faker.definitions.address.street_suffix);
|
|
151
165
|
}
|
|
152
166
|
|
|
153
167
|
/**
|
|
@@ -156,7 +170,7 @@ function Address (faker) {
|
|
|
156
170
|
* @method faker.address.streetPrefix
|
|
157
171
|
*/
|
|
158
172
|
this.streetPrefix = function () {
|
|
159
|
-
|
|
173
|
+
return faker.random.arrayElement(faker.definitions.address.street_prefix);
|
|
160
174
|
}
|
|
161
175
|
|
|
162
176
|
/**
|
|
@@ -165,12 +179,12 @@ function Address (faker) {
|
|
|
165
179
|
* @method faker.address.secondaryAddress
|
|
166
180
|
*/
|
|
167
181
|
this.secondaryAddress = function () {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
182
|
+
return Helpers.replaceSymbolWithNumber(faker.random.arrayElement(
|
|
183
|
+
[
|
|
184
|
+
'Apt. ###',
|
|
185
|
+
'Suite ###'
|
|
186
|
+
]
|
|
187
|
+
));
|
|
174
188
|
}
|
|
175
189
|
|
|
176
190
|
/**
|
|
@@ -200,11 +214,11 @@ function Address (faker) {
|
|
|
200
214
|
this.countryCode = function (alphaCode) {
|
|
201
215
|
|
|
202
216
|
if (typeof alphaCode === 'undefined' || alphaCode === 'alpha-2') {
|
|
203
|
-
|
|
217
|
+
return faker.random.arrayElement(faker.definitions.address.country_code);
|
|
204
218
|
}
|
|
205
219
|
|
|
206
220
|
if (alphaCode === 'alpha-3') {
|
|
207
|
-
|
|
221
|
+
return faker.random.arrayElement(faker.definitions.address.country_code_alpha_3);
|
|
208
222
|
}
|
|
209
223
|
|
|
210
224
|
return faker.random.arrayElement(faker.definitions.address.country_code);
|
|
@@ -218,7 +232,7 @@ function Address (faker) {
|
|
|
218
232
|
* @param {Boolean} useAbbr
|
|
219
233
|
*/
|
|
220
234
|
this.state = function (useAbbr) {
|
|
221
|
-
|
|
235
|
+
return faker.random.arrayElement(faker.definitions.address.state);
|
|
222
236
|
}
|
|
223
237
|
|
|
224
238
|
/**
|
|
@@ -227,7 +241,7 @@ function Address (faker) {
|
|
|
227
241
|
* @method faker.address.stateAbbr
|
|
228
242
|
*/
|
|
229
243
|
this.stateAbbr = function () {
|
|
230
|
-
|
|
244
|
+
return faker.random.arrayElement(faker.definitions.address.state_abbr);
|
|
231
245
|
}
|
|
232
246
|
|
|
233
247
|
/**
|
|
@@ -239,15 +253,15 @@ function Address (faker) {
|
|
|
239
253
|
* @param {number} precision default is 4
|
|
240
254
|
*/
|
|
241
255
|
this.latitude = function (max, min, precision) {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
256
|
+
max = max || 90
|
|
257
|
+
min = min || -90
|
|
258
|
+
precision = precision || 4
|
|
259
|
+
|
|
260
|
+
return faker.datatype.number({
|
|
261
|
+
max: max,
|
|
262
|
+
min: min,
|
|
263
|
+
precision: parseFloat((0.0).toPrecision(precision) + '1')
|
|
264
|
+
}).toFixed(precision);
|
|
251
265
|
}
|
|
252
266
|
|
|
253
267
|
/**
|
|
@@ -259,15 +273,15 @@ function Address (faker) {
|
|
|
259
273
|
* @param {number} precision default is 4
|
|
260
274
|
*/
|
|
261
275
|
this.longitude = function (max, min, precision) {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
276
|
+
max = max || 180
|
|
277
|
+
min = min || -180
|
|
278
|
+
precision = precision || 4
|
|
279
|
+
|
|
280
|
+
return faker.datatype.number({
|
|
281
|
+
max: max,
|
|
282
|
+
min: min,
|
|
283
|
+
precision: parseFloat((0.0).toPrecision(precision) + '1')
|
|
284
|
+
}).toFixed(precision);
|
|
271
285
|
}
|
|
272
286
|
|
|
273
287
|
/**
|
|
@@ -333,64 +347,64 @@ function Address (faker) {
|
|
|
333
347
|
};
|
|
334
348
|
|
|
335
349
|
this.nearbyGPSCoordinate = function(coordinate, radius, isMetric) {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
350
|
+
function randomFloat(min, max) {
|
|
351
|
+
return Math.random() * (max-min) + min;
|
|
352
|
+
}
|
|
353
|
+
function degreesToRadians(degrees) {
|
|
354
|
+
return degrees * (Math.PI/180.0);
|
|
355
|
+
}
|
|
356
|
+
function radiansToDegrees(radians) {
|
|
357
|
+
return radians * (180.0/Math.PI);
|
|
358
|
+
}
|
|
359
|
+
function kilometersToMiles(miles) {
|
|
360
|
+
return miles * 0.621371;
|
|
361
|
+
}
|
|
362
|
+
function coordinateWithOffset(coordinate, bearing, distance, isMetric) {
|
|
363
|
+
var R = 6378.137; // Radius of the Earth (http://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html)
|
|
364
|
+
var d = isMetric ? distance : kilometersToMiles(distance); // Distance in km
|
|
365
|
+
|
|
366
|
+
var lat1 = degreesToRadians(coordinate[0]); //Current lat point converted to radians
|
|
367
|
+
var lon1 = degreesToRadians(coordinate[1]); //Current long point converted to radians
|
|
368
|
+
|
|
369
|
+
var lat2 = Math.asin(Math.sin(lat1) * Math.cos(d/R) +
|
|
356
370
|
Math.cos(lat1) * Math.sin(d/R) * Math.cos(bearing));
|
|
357
371
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}
|
|
376
|
-
radius = radius || 10.0;
|
|
377
|
-
isMetric = isMetric || false;
|
|
378
|
-
|
|
379
|
-
// TODO: implement either a gaussian/uniform distribution of points in cicular region.
|
|
380
|
-
// Possibly include param to function that allows user to choose between distributions.
|
|
381
|
-
|
|
382
|
-
// This approach will likely result in a higher density of points near the center.
|
|
383
|
-
var randomCoord = coordinateWithOffset(coordinate, degreesToRadians(Math.random() * 360.0), radius, isMetric);
|
|
384
|
-
return [randomCoord[0].toFixed(4), randomCoord[1].toFixed(4)];
|
|
372
|
+
var lon2 = lon1 + Math.atan2(
|
|
373
|
+
Math.sin(bearing) * Math.sin(d/R) * Math.cos(lat1),
|
|
374
|
+
Math.cos(d/R) - Math.sin(lat1) * Math.sin(lat2));
|
|
375
|
+
|
|
376
|
+
// Keep longitude in range [-180, 180]
|
|
377
|
+
if (lon2 > degreesToRadians(180)) {
|
|
378
|
+
lon2 = lon2 - degreesToRadians(360);
|
|
379
|
+
} else if (lon2 < degreesToRadians(-180)) {
|
|
380
|
+
lon2 = lon2 + degreesToRadians(360);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
return [radiansToDegrees(lat2), radiansToDegrees(lon2)];
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// If there is no coordinate, the best we can do is return a random GPS coordinate.
|
|
387
|
+
if (coordinate === undefined) {
|
|
388
|
+
return [faker.address.latitude(), faker.address.longitude()]
|
|
385
389
|
}
|
|
390
|
+
radius = radius || 10.0;
|
|
391
|
+
isMetric = isMetric || false;
|
|
392
|
+
|
|
393
|
+
// TODO: implement either a gaussian/uniform distribution of points in cicular region.
|
|
394
|
+
// Possibly include param to function that allows user to choose between distributions.
|
|
395
|
+
|
|
396
|
+
// This approach will likely result in a higher density of points near the center.
|
|
397
|
+
var randomCoord = coordinateWithOffset(coordinate, degreesToRadians(Math.random() * 360.0), radius, isMetric);
|
|
398
|
+
return [randomCoord[0].toFixed(4), randomCoord[1].toFixed(4)];
|
|
399
|
+
}
|
|
386
400
|
|
|
387
|
-
|
|
401
|
+
/**
|
|
388
402
|
* Return a random time zone
|
|
389
403
|
* @method faker.address.timeZone
|
|
390
404
|
*/
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
405
|
+
this.timeZone = function() {
|
|
406
|
+
return faker.random.arrayElement(faker.definitions.address.time_zone);
|
|
407
|
+
}
|
|
394
408
|
|
|
395
409
|
return this;
|
|
396
410
|
}
|
package/lib/animal.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @namespace faker.animal
|
|
4
|
+
*/
|
|
5
|
+
var Animal = function (faker) {
|
|
6
|
+
var self = this;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* dog
|
|
10
|
+
*
|
|
11
|
+
* @method faker.animal.dog
|
|
12
|
+
*/
|
|
13
|
+
self.dog = function() {
|
|
14
|
+
return faker.random.arrayElement(faker.definitions.animal.dog);
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* cat
|
|
18
|
+
*
|
|
19
|
+
* @method faker.animal.cat
|
|
20
|
+
*/
|
|
21
|
+
self.cat = function() {
|
|
22
|
+
return faker.random.arrayElement(faker.definitions.animal.cat);
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* snake
|
|
26
|
+
*
|
|
27
|
+
* @method faker.animal.snake
|
|
28
|
+
*/
|
|
29
|
+
self.snake = function() {
|
|
30
|
+
return faker.random.arrayElement(faker.definitions.animal.snake);
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* bear
|
|
34
|
+
*
|
|
35
|
+
* @method faker.animal.bear
|
|
36
|
+
*/
|
|
37
|
+
self.bear = function() {
|
|
38
|
+
return faker.random.arrayElement(faker.definitions.animal.bear);
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* lion
|
|
42
|
+
*
|
|
43
|
+
* @method faker.animal.lion
|
|
44
|
+
*/
|
|
45
|
+
self.lion = function() {
|
|
46
|
+
return faker.random.arrayElement(faker.definitions.animal.lion);
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* cetacean
|
|
50
|
+
*
|
|
51
|
+
* @method faker.animal.cetacean
|
|
52
|
+
*/
|
|
53
|
+
self.cetacean = function() {
|
|
54
|
+
return faker.random.arrayElement(faker.definitions.animal.cetacean);
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* horse
|
|
58
|
+
*
|
|
59
|
+
* @method faker.animal.horse
|
|
60
|
+
*/
|
|
61
|
+
self.horse = function() {
|
|
62
|
+
return faker.random.arrayElement(faker.definitions.animal.horse);
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* bird
|
|
66
|
+
*
|
|
67
|
+
* @method faker.animal.bird
|
|
68
|
+
*/
|
|
69
|
+
self.bird = function() {
|
|
70
|
+
return faker.random.arrayElement(faker.definitions.animal.bird);
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* cow
|
|
74
|
+
*
|
|
75
|
+
* @method faker.animal.cow
|
|
76
|
+
*/
|
|
77
|
+
self.cow = function() {
|
|
78
|
+
return faker.random.arrayElement(faker.definitions.animal.cow);
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* fish
|
|
82
|
+
*
|
|
83
|
+
* @method faker.animal.fish
|
|
84
|
+
*/
|
|
85
|
+
self.fish = function() {
|
|
86
|
+
return faker.random.arrayElement(faker.definitions.animal.fish);
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* crocodilia
|
|
90
|
+
*
|
|
91
|
+
* @method faker.animal.crocodilia
|
|
92
|
+
*/
|
|
93
|
+
self.crocodilia = function() {
|
|
94
|
+
return faker.random.arrayElement(faker.definitions.animal.crocodilia);
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* insect
|
|
98
|
+
*
|
|
99
|
+
* @method faker.animal.insect
|
|
100
|
+
*/
|
|
101
|
+
self.insect = function() {
|
|
102
|
+
return faker.random.arrayElement(faker.definitions.animal.insect);
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* rabbit
|
|
106
|
+
*
|
|
107
|
+
* @method faker.animal.rabbit
|
|
108
|
+
*/
|
|
109
|
+
self.rabbit = function() {
|
|
110
|
+
return faker.random.arrayElement(faker.definitions.animal.rabbit);
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* type
|
|
114
|
+
*
|
|
115
|
+
* @method faker.animal.type
|
|
116
|
+
*/
|
|
117
|
+
self.type = function() {
|
|
118
|
+
return faker.random.arrayElement(faker.definitions.animal.type);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
return self;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
module['exports'] = Animal;
|
package/lib/commerce.js
CHANGED
|
@@ -11,7 +11,7 @@ var Commerce = function (faker) {
|
|
|
11
11
|
* @method faker.commerce.color
|
|
12
12
|
*/
|
|
13
13
|
self.color = function() {
|
|
14
|
-
|
|
14
|
+
return faker.random.arrayElement(faker.definitions.commerce.color);
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -20,7 +20,7 @@ var Commerce = function (faker) {
|
|
|
20
20
|
* @method faker.commerce.department
|
|
21
21
|
*/
|
|
22
22
|
self.department = function() {
|
|
23
|
-
|
|
23
|
+
return faker.random.arrayElement(faker.definitions.commerce.department);
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
/**
|
|
@@ -29,7 +29,7 @@ var Commerce = function (faker) {
|
|
|
29
29
|
* @method faker.commerce.productName
|
|
30
30
|
*/
|
|
31
31
|
self.productName = function() {
|
|
32
|
-
|
|
32
|
+
return faker.commerce.productAdjective() + " " +
|
|
33
33
|
faker.commerce.productMaterial() + " " +
|
|
34
34
|
faker.commerce.product();
|
|
35
35
|
};
|
|
@@ -46,18 +46,18 @@ var Commerce = function (faker) {
|
|
|
46
46
|
* @return {string}
|
|
47
47
|
*/
|
|
48
48
|
self.price = function(min, max, dec, symbol) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
min = min || 1;
|
|
50
|
+
max = max || 1000;
|
|
51
|
+
dec = dec === undefined ? 2 : dec;
|
|
52
|
+
symbol = symbol || '';
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
if (min < 0 || max < 0) {
|
|
55
|
+
return symbol + 0.00;
|
|
56
|
+
}
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
var randValue = faker.datatype.number({ max: max, min: min });
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
return symbol + (Math.round(randValue * Math.pow(10, dec)) / Math.pow(10, dec)).toFixed(dec);
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
/*
|
|
@@ -92,7 +92,7 @@ var Commerce = function (faker) {
|
|
|
92
92
|
* @method faker.commerce.productAdjective
|
|
93
93
|
*/
|
|
94
94
|
self.productAdjective = function() {
|
|
95
|
-
|
|
95
|
+
return faker.random.arrayElement(faker.definitions.commerce.product_name.adjective);
|
|
96
96
|
};
|
|
97
97
|
|
|
98
98
|
/**
|
|
@@ -101,7 +101,7 @@ var Commerce = function (faker) {
|
|
|
101
101
|
* @method faker.commerce.productMaterial
|
|
102
102
|
*/
|
|
103
103
|
self.productMaterial = function() {
|
|
104
|
-
|
|
104
|
+
return faker.random.arrayElement(faker.definitions.commerce.product_name.material);
|
|
105
105
|
};
|
|
106
106
|
|
|
107
107
|
/**
|
|
@@ -110,7 +110,7 @@ var Commerce = function (faker) {
|
|
|
110
110
|
* @method faker.commerce.product
|
|
111
111
|
*/
|
|
112
112
|
self.product = function() {
|
|
113
|
-
|
|
113
|
+
return faker.random.arrayElement(faker.definitions.commerce.product_name.product);
|
|
114
114
|
};
|
|
115
115
|
|
|
116
116
|
/**
|
|
@@ -119,7 +119,7 @@ var Commerce = function (faker) {
|
|
|
119
119
|
* @method faker.commerce.productDescription
|
|
120
120
|
*/
|
|
121
121
|
self.productDescription = function() {
|
|
122
|
-
|
|
122
|
+
return faker.random.arrayElement(faker.definitions.commerce.product_description);
|
|
123
123
|
};
|
|
124
124
|
|
|
125
125
|
return self;
|
package/lib/company.js
CHANGED
|
@@ -32,7 +32,7 @@ var Company = function (faker) {
|
|
|
32
32
|
];
|
|
33
33
|
|
|
34
34
|
if (typeof format !== "number") {
|
|
35
|
-
format = faker.
|
|
35
|
+
format = faker.datatype.number(formats.length - 1);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
return f(formats[format]);
|
|
@@ -44,7 +44,7 @@ var Company = function (faker) {
|
|
|
44
44
|
* @method faker.company.companySuffix
|
|
45
45
|
*/
|
|
46
46
|
this.companySuffix = function () {
|
|
47
|
-
|
|
47
|
+
return faker.random.arrayElement(faker.company.suffixes());
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/**
|
|
@@ -71,7 +71,7 @@ var Company = function (faker) {
|
|
|
71
71
|
* @method faker.company.catchPhraseAdjective
|
|
72
72
|
*/
|
|
73
73
|
this.catchPhraseAdjective = function () {
|
|
74
|
-
|
|
74
|
+
return faker.random.arrayElement(faker.definitions.company.adjective);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/**
|
|
@@ -80,7 +80,7 @@ var Company = function (faker) {
|
|
|
80
80
|
* @method faker.company.catchPhraseDescriptor
|
|
81
81
|
*/
|
|
82
82
|
this.catchPhraseDescriptor = function () {
|
|
83
|
-
|
|
83
|
+
return faker.random.arrayElement(faker.definitions.company.descriptor);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/**
|
|
@@ -89,7 +89,7 @@ var Company = function (faker) {
|
|
|
89
89
|
* @method faker.company.catchPhraseNoun
|
|
90
90
|
*/
|
|
91
91
|
this.catchPhraseNoun = function () {
|
|
92
|
-
|
|
92
|
+
return faker.random.arrayElement(faker.definitions.company.noun);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
/**
|
|
@@ -98,7 +98,7 @@ var Company = function (faker) {
|
|
|
98
98
|
* @method faker.company.bsAdjective
|
|
99
99
|
*/
|
|
100
100
|
this.bsAdjective = function () {
|
|
101
|
-
|
|
101
|
+
return faker.random.arrayElement(faker.definitions.company.bs_adjective);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
/**
|
|
@@ -107,7 +107,7 @@ var Company = function (faker) {
|
|
|
107
107
|
* @method faker.company.bsBuzz
|
|
108
108
|
*/
|
|
109
109
|
this.bsBuzz = function () {
|
|
110
|
-
|
|
110
|
+
return faker.random.arrayElement(faker.definitions.company.bs_verb);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
/**
|
|
@@ -116,7 +116,7 @@ var Company = function (faker) {
|
|
|
116
116
|
* @method faker.company.bsNoun
|
|
117
117
|
*/
|
|
118
118
|
this.bsNoun = function () {
|
|
119
|
-
|
|
119
|
+
return faker.random.arrayElement(faker.definitions.company.bs_noun);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
}
|
package/lib/database.js
CHANGED
|
@@ -10,7 +10,7 @@ var Database = function (faker) {
|
|
|
10
10
|
* @method faker.database.column
|
|
11
11
|
*/
|
|
12
12
|
self.column = function () {
|
|
13
|
-
|
|
13
|
+
return faker.random.arrayElement(faker.definitions.database.column);
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
self.column.schema = {
|
|
@@ -24,7 +24,7 @@ var Database = function (faker) {
|
|
|
24
24
|
* @method faker.database.type
|
|
25
25
|
*/
|
|
26
26
|
self.type = function () {
|
|
27
|
-
|
|
27
|
+
return faker.random.arrayElement(faker.definitions.database.type);
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
self.type.schema = {
|
|
@@ -38,7 +38,7 @@ var Database = function (faker) {
|
|
|
38
38
|
* @method faker.database.collation
|
|
39
39
|
*/
|
|
40
40
|
self.collation = function () {
|
|
41
|
-
|
|
41
|
+
return faker.random.arrayElement(faker.definitions.database.collation);
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
self.collation.schema = {
|
|
@@ -52,7 +52,7 @@ var Database = function (faker) {
|
|
|
52
52
|
* @method faker.database.engine
|
|
53
53
|
*/
|
|
54
54
|
self.engine = function () {
|
|
55
|
-
|
|
55
|
+
return faker.random.arrayElement(faker.definitions.database.engine);
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
self.engine.schema = {
|