Skip to content

Commit

Permalink
Merge pull request #364 from Expensify/joe-add-domain-email-check
Browse files Browse the repository at this point in the history
Add isDomainEmail function to str lib
  • Loading branch information
roryabraham authored May 5, 2021
2 parents 758b46b + 83b50fa commit 05b8a00
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/str.js
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,17 @@ const Str = {
isImage(url) {
return _.contains(['jpeg', 'jpg', 'gif', 'png', 'bmp'], this.getExtension(url));
},

/**
* Checks whether the given string is a +@ domain email account, such as
* +@domain.com
*
* @param {String} email
* @return {Boolean} True if is a domain account email, otherwise false.
*/
isDomainEmail(email) {
return this.startsWith(email, '+@');
},
};

export default Str;

0 comments on commit 05b8a00

Please sign in to comment.