mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-07 13:07:25 -05:00
10 lines
300 B
TypeScript
10 lines
300 B
TypeScript
|
import _ from 'lodash'
|
||
|
|
||
|
export function parseEmails(emailsString: string) {
|
||
|
const regexBySpaceOrComma = /[\s,]+/
|
||
|
let emails = emailsString.split(regexBySpaceOrComma)
|
||
|
emails = _.map(emails, email => email.trim())
|
||
|
emails = _.filter(emails, email => email.indexOf('@') !== -1)
|
||
|
return emails
|
||
|
}
|