Skip to content

Commit

Permalink
style: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
vegandiet705 committed May 17, 2024
1 parent 5d5c4cc commit 524f22e
Show file tree
Hide file tree
Showing 7 changed files with 432 additions and 427 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Check types
run: npm run type-check

- name: Check linting
run: npm run lint

- name: Run tests
run: npm run test:ci

- name: Build package
run: yarn build
152 changes: 76 additions & 76 deletions src/country.ts
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
export enum Country {
Albania = "Albania",
Argentina = "Argentina",
Australia = "Australia",
Austria = "Austria",
Belarus = "Belarus",
Belgium = "Belgium",
Belize = "Belize",
Bolivia = "Bolivia",
BosniaHerzegovina = "Bosnia Herzegovina",
Brazil = "Brazil",
Bulgaria = "Bulgaria",
Canada = "Canada",
Chile = "Chile",
China = "China",
Colombia = "Colombia",
CostaRica = "Costa Rica",
Croatia = "Croatia",
Cyprus = "Cyprus",
CzechRepublic = "Czech Republic",
Denmark = "Denmark",
DominicanRepublic = "Dominican Republic",
Ecuador = "Ecuador",
ElSalvador = "El Salvador",
Estonia = "Estonia",
Finland = "Finland",
France = "France",
Germany = "Germany",
Greece = "Greece",
Guatemala = "Guatemala",
Honduras = "Honduras",
Hungary = "Hungary",
Iceland = "Iceland",
India = "India",
Indonesia = "Indonesia",
Ireland = "Ireland",
IsleOfMan = "Isle of Man",
Israel = "Israel",
Italy = "Italy",
Japan = "Japan",
Kazakhstan = "Kazakhstan",
Latvia = "Latvia",
Lithuania = "Lithuania",
Luxembourg = "Luxembourg",
Malta = "Malta",
Mexico = "Mexico",
Monaco = "Monaco",
Netherlands = "Netherlands",
NewZealand = "New Zealand",
Nicaragua = "Nicaragua",
Nigeria = "Nigeria",
NorthMacedonia = "North Macedonia",
Norway = "Norway",
Panama = "Panama",
Paraguay = "Paraguay",
Peru = "Peru",
Philippines = "Philippines",
Poland = "Poland",
Portugal = "Portugal",
Romania = "Romania",
Russia = "Russia",
SanMarino = "San Marino",
SaudiArabia = "Saudi Arabia",
Serbia = "Serbia",
Slovakia = "Slovakia",
Slovenia = "Slovenia",
Spain = "Spain",
Sweden = "Sweden",
Switzerland = "Switzerland",
Taiwan = "Taiwan",
Turkey = "Turkey",
Ukraine = "Ukraine",
UnitedKingdom = "United Kingdom",
Uruguay = "Uruguay",
Uzbekistan = "Uzbekistan",
Venezuela = "Venezuela"
}
Albania = 'Albania',
Argentina = 'Argentina',
Australia = 'Australia',
Austria = 'Austria',
Belarus = 'Belarus',
Belgium = 'Belgium',
Belize = 'Belize',
Bolivia = 'Bolivia',
BosniaHerzegovina = 'Bosnia Herzegovina',
Brazil = 'Brazil',
Bulgaria = 'Bulgaria',
Canada = 'Canada',
Chile = 'Chile',
China = 'China',
Colombia = 'Colombia',
CostaRica = 'Costa Rica',
Croatia = 'Croatia',
Cyprus = 'Cyprus',
CzechRepublic = 'Czech Republic',
Denmark = 'Denmark',
DominicanRepublic = 'Dominican Republic',
Ecuador = 'Ecuador',
ElSalvador = 'El Salvador',
Estonia = 'Estonia',
Finland = 'Finland',
France = 'France',
Germany = 'Germany',
Greece = 'Greece',
Guatemala = 'Guatemala',
Honduras = 'Honduras',
Hungary = 'Hungary',
Iceland = 'Iceland',
India = 'India',
Indonesia = 'Indonesia',
Ireland = 'Ireland',
IsleOfMan = 'Isle of Man',
Israel = 'Israel',
Italy = 'Italy',
Japan = 'Japan',
Kazakhstan = 'Kazakhstan',
Latvia = 'Latvia',
Lithuania = 'Lithuania',
Luxembourg = 'Luxembourg',
Malta = 'Malta',
Mexico = 'Mexico',
Monaco = 'Monaco',
Netherlands = 'Netherlands',
NewZealand = 'New Zealand',
Nicaragua = 'Nicaragua',
Nigeria = 'Nigeria',
NorthMacedonia = 'North Macedonia',
Norway = 'Norway',
Panama = 'Panama',
Paraguay = 'Paraguay',
Peru = 'Peru',
Philippines = 'Philippines',
Poland = 'Poland',
Portugal = 'Portugal',
Romania = 'Romania',
Russia = 'Russia',
SanMarino = 'San Marino',
SaudiArabia = 'Saudi Arabia',
Serbia = 'Serbia',
Slovakia = 'Slovakia',
Slovenia = 'Slovenia',
Spain = 'Spain',
Sweden = 'Sweden',
Switzerland = 'Switzerland',
Taiwan = 'Taiwan',
Turkey = 'Turkey',
Ukraine = 'Ukraine',
UnitedKingdom = 'United Kingdom',
Uruguay = 'Uruguay',
Uzbekistan = 'Uzbekistan',
Venezuela = 'Venezuela',
}
25 changes: 20 additions & 5 deletions src/countryRegex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ export const countryRegexMap: Map<Country, string> = new Map([
[Country.Australia, String.raw`^\d{11}$`],
[Country.Austria, String.raw`^ATU\d{8}$`],
[Country.Belarus, String.raw`^\d{9}$`],
[Country.Belgium, String.raw`^(BE0?|BE1)\d{8}(?:(?<=\d)(\d{2})|(?<=\d)(\d{1})X)$`],
[
Country.Belgium,
String.raw`^(BE0?|BE1)\d{8}(?:(?<=\d)(\d{2})|(?<=\d)(\d{1})X)$`,
],
[Country.Belize, String.raw`^\d{6}$`],
[Country.Bolivia, String.raw`^\d{7}$`],
[Country.BosniaHerzegovina, String.raw`^\d{12,13}$`],
Expand Down Expand Up @@ -35,7 +38,10 @@ export const countryRegexMap: Map<Country, string> = new Map([
[Country.India, String.raw`^[a-zA-Z0-9]{15}$`],
[Country.Indonesia, String.raw`^\d{15,16}$`],
[Country.Ireland, String.raw`^IE(\d{7}[A-Z]|(\d{7}[A-Z]{2}))$`],
[Country.IsleOfMan, String.raw`^GB(\d{3} \d{4} \d{2}|\d{9}|\d{9} \d{3}|GD([0-4][0-9]{2})|HA([5-9][0-9]{2}))$`],
[
Country.IsleOfMan,
String.raw`^GB(\d{3} \d{4} \d{2}|\d{9}|\d{9} \d{3}|GD([0-4][0-9]{2})|HA([5-9][0-9]{2}))$`,
],
[Country.Israel, String.raw`^\d{9}$`],
[Country.Italy, String.raw`^IT\d{11}$`],
[Country.Japan, String.raw`^\d{13}$`],
Expand All @@ -55,7 +61,10 @@ export const countryRegexMap: Map<Country, string> = new Map([
[Country.Paraguay, String.raw`^\d{6,8}-\d$`],
[Country.Peru, String.raw`^\d{11}$`],
[Country.Philippines, String.raw`^\d{12}$`],
[Country.Poland, String.raw`^PL(?:\d{3}-\d{3}-\d{2}-\d{2}|\d{3}-\d{2}-\d{2}-\d{3}|\d{10})$`],
[
Country.Poland,
String.raw`^PL(?:\d{3}-\d{3}-\d{2}-\d{2}|\d{3}-\d{2}-\d{2}-\d{3}|\d{10})$`,
],
[Country.Portugal, String.raw`^PT\d{9}$`],
[Country.Romania, String.raw`^RO\d{2,10}$`],
[Country.Russia, String.raw`^\d{10}(?:\d{2})?$`],
Expand All @@ -66,11 +75,17 @@ export const countryRegexMap: Map<Country, string> = new Map([
[Country.Slovenia, String.raw`^SI\d{8}$`],
[Country.Spain, String.raw`^ES[A-Z]\d{7}[A-Z0-9]$`],
[Country.Sweden, String.raw`^SE\d{12}$`],
[Country.Switzerland, String.raw`^CHE-\d{3}\.\d{3}\.\d{3}\s(?:MWST|TVA|IVA)$`],
[
Country.Switzerland,
String.raw`^CHE-\d{3}\.\d{3}\.\d{3}\s(?:MWST|TVA|IVA)$`,
],
[Country.Taiwan, String.raw`^\d{8}$`],
[Country.Turkey, String.raw`^\d{10}$`],
[Country.Ukraine, String.raw`^\d{12}$`],
[Country.UnitedKingdom, String.raw`^GB(\d{3} \d{4} \d{2}|\d{9}|\d{9} \d{3}|GD([0-4][0-9]{2})|HA([5-9][0-9]{2}))$`],
[
Country.UnitedKingdom,
String.raw`^GB(\d{3} \d{4} \d{2}|\d{9}|\d{9} \d{3}|GD([0-4][0-9]{2})|HA([5-9][0-9]{2}))$`,
],
[Country.Uruguay, String.raw`^\d{8}001\d$`],
[Country.Uzbekistan, String.raw`^[24-7]\d{8}$`],
[Country.Venezuela, String.raw`^(J|G|V|E)-\d{9}$`],
Expand Down
Loading

0 comments on commit 524f22e

Please sign in to comment.