Skip to content

Commit 515fdc6

Browse files
author
Filipe Forattini
committed
feat: added base enums and vocabulary
1 parent f8cb00b commit 515fdc6

File tree

14 files changed

+976
-4
lines changed

14 files changed

+976
-4
lines changed
Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
/* Datasource: https://github.com/umpirsky/country-list */
2+
3+
module.exports = {
4+
'AF ': 'Afeganistão',
5+
'ZA': 'África do Sul',
6+
'AL': 'Albânia',
7+
'DE': 'Alemanha',
8+
'AD': 'Andorra',
9+
'AO': 'Angola',
10+
'AI': 'Anguila',
11+
'AQ': 'Antártida',
12+
'AG': 'Antígua e Barbuda',
13+
'SA': 'Arábia Saudita',
14+
'DZ': 'Argélia',
15+
'AR': 'Argentina',
16+
'AM': 'Armênia',
17+
'AW': 'Aruba',
18+
'AU': 'Austrália',
19+
'AT': 'Áustria',
20+
'AZ': 'Azerbaijão',
21+
'BS': 'Bahamas',
22+
'BH': 'Bahrein',
23+
'BD': 'Bangladesh',
24+
'BB': 'Barbados',
25+
'BE': 'Bélgica',
26+
'BZ': 'Belize',
27+
'BJ': 'Benin',
28+
'BR': 'Bermudas',
29+
'BY': 'Bielorrússia',
30+
'BO': 'Bolívia',
31+
'BA': 'Bósnia e Herzegovina',
32+
'BW': 'Botsuana',
33+
'BR': 'Brasil',
34+
'BN': 'Brunei',
35+
'BG': 'Bulgária',
36+
'BF': 'Burquina Faso',
37+
'BI': 'Burundi',
38+
'BT': 'Butão',
39+
'CV': 'Cabo Verde',
40+
'CM': 'Camarões',
41+
'KH': 'Camboja',
42+
'CA': 'Canadá',
43+
'QA': 'Catar',
44+
'KZ': 'Cazaquistão',
45+
'TD': 'Chade',
46+
'CL': 'Chile',
47+
'CH': 'China',
48+
'CY': 'Chipre',
49+
'VA': 'Cidade do Vaticano',
50+
'CO': 'Colômbia',
51+
'KM': 'Comores',
52+
'CD': 'Congo - Kinshasa',
53+
'KP': 'Coreia do Norte',
54+
'KR': 'Coreia do Sul',
55+
'CI': 'Costa do Marfim',
56+
'CR': 'Costa Rica',
57+
'HR': 'Croácia',
58+
'CU': 'Cuba',
59+
'CW': 'Curaçao',
60+
'DK': 'Dinamarca',
61+
'DJ': 'Djibuti',
62+
'DM': 'Dominica',
63+
'EG': 'Egito',
64+
'SV': 'El Salvador',
65+
'AE': 'Emirados Árabes Unidos',
66+
'EC': 'Equador',
67+
'ER': 'Eritreia',
68+
'SK': 'Eslováquia',
69+
'SI': 'Eslovênia',
70+
'ES': 'Espanha',
71+
'SZ': 'Essuatíni',
72+
'US': 'Estados Unidos',
73+
'EE': 'Estônia',
74+
'ET': 'Etiópia',
75+
'FJ': 'Fiji',
76+
'PH': 'Filipinas',
77+
'FI': 'Finlândia',
78+
'FR': 'França',
79+
'GA': 'Gabão',
80+
'GM': 'Gâmbia',
81+
'GH': 'Gana',
82+
'GE': 'Geórgia',
83+
'GI': 'Gibraltar',
84+
'GD': 'Granada',
85+
'GR': 'Grécia',
86+
'GL': 'Groenlândia',
87+
'GP': 'Guadalupe',
88+
'GU': 'Guam',
89+
'GT': 'Guatemala',
90+
'GG': 'Guernsey',
91+
'GY': 'Guiana',
92+
'GF': 'Guiana Francesa',
93+
'GN': 'Guiné',
94+
'GQ': 'Guiné Equatorial',
95+
'GW': 'Guiné-Bissau',
96+
'HT': 'Haiti',
97+
'HN': 'Honduras',
98+
'HK': 'Hong Kong, RAE da China',
99+
'HU': 'Hungria',
100+
'YE': 'Iêmen',
101+
'BV': 'Ilha Bouvet',
102+
'CX': 'Ilha Christmas',
103+
'IM': 'Ilha de Man',
104+
'NF': 'Ilha Norfolk',
105+
'AX': 'Ilhas Aland',
106+
'KY': 'Ilhas Cayman',
107+
'CC': 'Ilhas Cocos: Keeling)',
108+
'CK': 'Ilhas Cook',
109+
'FO': 'Ilhas Faroe',
110+
'GS': 'Ilhas Geórgia do Sul e Sandwich do Sul',
111+
'HM': 'Ilhas Heard e McDonald',
112+
'FK': 'Ilhas Malvinas',
113+
'MP': 'Ilhas Marianas do Norte',
114+
'MH': 'Ilhas Marshall',
115+
'UM': 'Ilhas Menores Distantes dos EUA',
116+
'PN': 'Ilhas Pitcairn',
117+
'SB': 'Ilhas Salomão',
118+
'TC': 'Ilhas Turcas e Caicos',
119+
'VI': 'Ilhas Virgens Americanas',
120+
'VG': 'Ilhas Virgens Britânicas',
121+
'IN': 'Índia',
122+
'ID': 'Indonésia',
123+
'IR': 'Irã',
124+
'IQ': 'Iraque',
125+
'IE': 'Irlanda',
126+
'IS': 'Islândia',
127+
'IL': 'Israel',
128+
'IT': 'Itália',
129+
'JM': 'Jamaica',
130+
'JP': 'Japão',
131+
'JE': 'Jersey',
132+
'JO': 'Jordânia',
133+
'KW': 'Kuwait',
134+
'LA': 'Laos',
135+
'LS': 'Lesoto',
136+
'LV': 'Letônia',
137+
'LB': 'Líbano',
138+
'LR': 'Libéria',
139+
'LY': 'Líbia',
140+
'LI': 'Liechtenstein',
141+
'LT': 'Lituânia',
142+
'LU': 'Luxemburgo',
143+
'MO': 'Macau, RAE da China',
144+
'MK': 'Macedônia do Norte',
145+
'MG': 'Madagascar',
146+
'MY': 'Malásia',
147+
'MW': 'Malaui',
148+
'MV': 'Maldivas',
149+
'ML': 'Mali',
150+
'MT': 'Malta',
151+
'MA': 'Marrocos',
152+
'MQ': 'Martinica',
153+
'MU': 'Maurício',
154+
'MR': 'Mauritânia',
155+
'YT': 'Mayotte',
156+
'MX': 'México',
157+
'MM': 'Mianmar: Birmânia)',
158+
'FM': 'Micronésia',
159+
'MZ': 'Moçambique',
160+
'MD': 'Moldova',
161+
'MC': 'Mônaco',
162+
'MN': 'Mongólia',
163+
'ME': 'Montenegro',
164+
'MS': 'Montserrat',
165+
'NA': 'Namíbia',
166+
'NR': 'Nauru',
167+
'NP': 'Nepal',
168+
'NI': 'Nicarágua',
169+
'NE': 'Níger',
170+
'NG': 'Nigéria',
171+
'NU': 'Niue',
172+
'NO': 'Noruega',
173+
'NC': 'Nova Caledônia',
174+
'NZ': 'Nova Zelândia',
175+
'OM': 'Omã',
176+
'NL': 'Países Baixos',
177+
'BQ': 'Países Baixos Caribenhos',
178+
'PW': 'Palau',
179+
'PA': 'Panamá',
180+
'PG': 'Papua-Nova Guiné',
181+
'PK': 'Paquistão',
182+
'PY': 'Paraguai',
183+
'PE': 'Peru',
184+
'PF': 'Polinésia Francesa',
185+
'PL': 'Polônia',
186+
'PR': 'Porto Rico',
187+
'PT': 'Portugal',
188+
'KE': 'Quênia',
189+
'KG': 'Quirguistão',
190+
'KI': 'Quiribati',
191+
'GB': 'Reino Unido',
192+
'CF': 'República Centro-Africana',
193+
'CG': 'República do Congo',
194+
'DO': 'República Dominicana',
195+
'RE': 'Reunião',
196+
'RO': 'Romênia',
197+
'RW': 'Ruanda',
198+
'RU': 'Rússia',
199+
'EH': 'Saara Ocidental',
200+
'WS': 'Samoa',
201+
'AS': 'Samoa Americana',
202+
'SM': 'San Marino',
203+
'SH': 'Santa Helena',
204+
'LC': 'Santa Lúcia',
205+
'BL': 'São Bartolomeu',
206+
'KN': 'São Cristóvão e Névis',
207+
'MF': 'São Martinho',
208+
'PM': 'São Pedro e Miquelão',
209+
'ST': 'São Tomé e Príncipe',
210+
'VC': 'São Vicente e Granadinas',
211+
'SC': 'Seicheles',
212+
'SN': 'Senegal',
213+
'SL': 'Serra Leoa',
214+
'RS': 'Sérvia',
215+
'SG': 'Singapura',
216+
'SX': 'Sint Maarten',
217+
'SY': 'Síria',
218+
'SO': 'Somália',
219+
'LK': 'Sri Lanka',
220+
'SD': 'Sudão',
221+
'SS': 'Sudão do Sul',
222+
'SE': 'Suécia',
223+
'CH': 'Suíça',
224+
'SR': 'Suriname',
225+
'SJ': 'Svalbard e Jan Mayen',
226+
'TJ': 'Tadjiquistão',
227+
'TH': 'Tailândia',
228+
'TW': 'Taiwan',
229+
'TZ': 'Tanzânia',
230+
'CZ': 'Tchéquia',
231+
'IO': 'Território Britânico do Oceano Índico',
232+
'TF': 'Territórios Franceses do Sul',
233+
'PS': 'Territórios palestinos',
234+
'TL': 'Timor-Leste',
235+
'TG': 'Togo',
236+
'TK': 'Tokelau',
237+
'TO': 'Tonga',
238+
'TT': 'Trinidad e Tobago',
239+
'TN': 'Tunísia',
240+
'TM': 'Turcomenistão',
241+
'TR': 'Turquia',
242+
'TV': 'Tuvalu',
243+
'UA': 'Ucrânia',
244+
'UG': 'Uganda',
245+
'UY': 'Uruguai',
246+
'UZ': 'Uzbequistão',
247+
'VU': 'Vanuatu',
248+
'VE': 'Venezuela',
249+
'VN': 'Vietnã',
250+
'WF': 'Wallis e Futuna',
251+
'ZM': 'Zâmbia',
252+
'ZW': 'Zimbábue',
253+
}

lib/locales/pt-BR/address/index.js

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
import countries from "./countryWithCodes";
2+
3+
module.exports = {
4+
countryAndCode() {
5+
let country = this.random.objectElement(countries);
6+
return {
7+
code: Object.keys(country)[0],
8+
name: country[Object.keys(country)[0]]
9+
};
10+
},
11+
12+
geoLocation() {
13+
return {
14+
latitude: (this.random.number(180 * 10000) / 10000.0 - 90.0),
15+
longitude: (this.random.number(360 * 10000) / 10000.0 - 180.0)
16+
};
17+
},
18+
19+
state: [
20+
'Acre',
21+
'Alagoas',
22+
'Amazonas',
23+
'Amapá',
24+
'Bahia',
25+
'Ceará',
26+
'Distrito Federal',
27+
'Espírito Santo',
28+
'Goiás',
29+
'Maranhão',
30+
'Minas Gerais',
31+
'Mato Grosso do Sul',
32+
'Mato Grosso',
33+
'Pará',
34+
'Paraíba',
35+
'Pernambuco',
36+
'Piauí',
37+
'Paraná',
38+
'Rio de Janeiro',
39+
'Rio Grande do Norte',
40+
'Rondônia',
41+
'Roraima',
42+
'Rio Grande do Sul',
43+
'Santa Catarina',
44+
'Sergipe',
45+
'São Paulo',
46+
'Tocantins',
47+
],
48+
49+
stateAbbr: [
50+
'AC',
51+
'AL',
52+
'AM',
53+
'AP',
54+
'BA',
55+
'CE',
56+
'DF',
57+
'ES',
58+
'GO',
59+
'MA',
60+
'MG',
61+
'MS',
62+
'MT',
63+
'PA',
64+
'PB',
65+
'PE',
66+
'PI',
67+
'PR',
68+
'RJ',
69+
'RN',
70+
'RO',
71+
'RR',
72+
'RS',
73+
'SC',
74+
'SE',
75+
'SP',
76+
'TO',
77+
],
78+
79+
postCode: [
80+
"#####-###"
81+
],
82+
83+
street: [
84+
"#{address.streetName} #{address.buildingNumber}",
85+
"#{address.streetName} #{address.buildingNumber}",
86+
"#{address.streetName} #{address.buildingNumber} Apto ###",
87+
"#{address.streetName} #{address.buildingNumber} Casa ###"
88+
],
89+
90+
streetName: [
91+
"#{address.streetSuffix} #{names.firstName}",
92+
"#{address.streetSuffix} #{names.lastName}"
93+
],
94+
95+
streetSuffix: [
96+
"Alameda",
97+
"Avenida",
98+
"Praça",
99+
"Rodovia",
100+
"Rua",
101+
],
102+
};

lib/locales/pt-BR/build.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import isNil from "lodash/isNil";
2+
import isArray from "lodash/isArray";
3+
import isFunction from "lodash/isFunction";
4+
import isObject from "lodash/isObject";
5+
import mergeWith from "lodash/mergeWith";
6+
7+
import Fakerator from "lib/fakerator";
8+
9+
module.exports = function() {
10+
let locale = require("lib/locales/pt-BR");
11+
let fbLocale = require("lib/locales/default");
12+
13+
// Merge locale and fallback
14+
locale = mergeWith(locale, fbLocale, (objValue) => {
15+
// DON'T MERGE ARRAYS
16+
if (isArray(objValue) || isFunction(objValue))
17+
return objValue;
18+
19+
if (!isNil(objValue) && !isObject(objValue))
20+
return objValue;
21+
});
22+
23+
return new Fakerator(locale);
24+
};

0 commit comments

Comments
 (0)