mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -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
|
||
|
}
|