Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 758 Bytes

File metadata and controls

20 lines (13 loc) · 758 Bytes

hideEmail

Interview question of the issue #257 of rendezvous with cassidoo.

The Question

Given a string that has a valid email address, write a function to hide the first part of the email (before the @ sign), minus the first and last character. For extra credit, add a flag to hide the second part after the @ sign to your function excluding the first character and the domain extension.

Examples:

> hideEmail('example@example.com')
> 'e*****e@example.com'

> hideEmail('example+test@example.co.uk', hideFull)
> 'e**********t@e******.co.uk'

Installing & Running

Just pnpm i to install all dependencies and then pnpm t to run the tests!