Skip to content

Commit

Permalink
remove blank line
Browse files Browse the repository at this point in the history
  • Loading branch information
Devalo committed Apr 9, 2021
1 parent 460bc7e commit 3b6155d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const phoneNumber = (phoneNumber: string): string => {
const formatLandlineNumber = `${match[1]} ${match[2]} ${match[3]} ${match[4]}`;
return formatLandlineNumber;
}

}
throw new Error('No matches for phone number');
};
Expand All @@ -31,9 +30,9 @@ const bankAccount = (accountNumber: string): string => {
const cleanedNumber = cleanup(accountNumber);

if (cleanedNumber.length !== 11) throw new Error('Length of account number must be 11 digits');

const match = cleanedNumber.match(/^(\d{4})(\d{2})(\d{5})$/);

if (match) {
const formatAccountNumber = `${match[1]} ${match[2]} ${match[3]}`;
return formatAccountNumber;
Expand All @@ -44,14 +43,14 @@ const bankAccount = (accountNumber: string): string => {
const socialSecNumber = (socialSecurityNumber: string): string => {
const cleanedNumber = cleanup(socialSecurityNumber);
if (cleanedNumber.length !== 11) throw new Error('Length of social security number must be 11 digits');

const match = cleanedNumber.match(/^(\d{6})(\d{5})$/);

if (match) {
const formatSocialSecNumber = `${match[1]} ${match[2]}`;
return formatSocialSecNumber;
}

throw new Error('No matches for social security number');
}

Expand Down

0 comments on commit 3b6155d

Please sign in to comment.