Skip to content

Commit

Permalink
chore: fix formatting (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Koblas authored Aug 30, 2023
1 parent b2fe750 commit e0aae87
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
22 changes: 14 additions & 8 deletions src/country.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,15 +510,21 @@ const countryData: Record<CountryCode, [string, string]> = {
[CountryCode.ZW]: ["Zimbabwe", "ZWE"],
};

const by2code = Object.entries(countryData).reduce((acc, [k, v]) => {
acc[k] = [k as CountryCode, v];
return acc;
}, {} as Record<string, [CountryCode, [string, string]]>);
const by2code = Object.entries(countryData).reduce(
(acc, [k, v]) => {
acc[k] = [k as CountryCode, v];
return acc;
},
{} as Record<string, [CountryCode, [string, string]]>,
);

const by3code = Object.entries(countryData).reduce((acc, [k, v]) => {
acc[v[1]] = [k as CountryCode, v];
return acc;
}, {} as Record<string, [CountryCode, [string, string]]>);
const by3code = Object.entries(countryData).reduce(
(acc, [k, v]) => {
acc[v[1]] = [k as CountryCode, v];
return acc;
},
{} as Record<string, [CountryCode, [string, string]]>,
);

export function countryByCode(code: string): CountryCode | null {
if (code === null) {
Expand Down
7 changes: 1 addition & 6 deletions src/exceptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@ export class FormatException extends Error {

expected?: string;

constructor(
formatViolation: FormatViolation,
msg: string,
expected?: string,
actual?: string,
) {
constructor(formatViolation: FormatViolation, msg: string, expected?: string, actual?: string) {
super(msg);

this.formatViolation = formatViolation;
Expand Down

0 comments on commit e0aae87

Please sign in to comment.