Skip to content

Instantly share code, notes, and snippets.

@yellowred
Last active March 17, 2017 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yellowred/e6fd692721db377ac650357d20e45653 to your computer and use it in GitHub Desktop.
Save yellowred/e6fd692721db377ac650357d20e45653 to your computer and use it in GitHub Desktop.
let generateResponse = (data) => {
return Promise.coroutine(function* () {
let emails = data
.map(getEmailsFromIndividual)
return emails
})()
}
let getEmailsFromIndividual = (individual) => {
if (!Array.isArray(individual.contacts)) return []
return individual
.contacts
.map(value => value['emailAddress'])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment