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
|
|
}
|