(mails, filters = {})
| 394 | } |
| 395 | |
| 396 | function pickLuckmailVerificationMail(mails, filters = {}) { |
| 397 | const matches = normalizeLuckmailTokenMails(mails) |
| 398 | .map((mail) => mailMatchesLuckmailFilters(mail, filters)) |
| 399 | .filter(Boolean) |
| 400 | .sort((left, right) => { |
| 401 | if (left.receivedAt !== right.receivedAt) { |
| 402 | return right.receivedAt - left.receivedAt; |
| 403 | } |
| 404 | return String(right.mail.message_id || '').localeCompare(String(left.mail.message_id || '')); |
| 405 | }); |
| 406 | |
| 407 | return matches[0] || null; |
| 408 | } |
| 409 | |
| 410 | return { |
| 411 | DEFAULT_LUCKMAIL_BASE_URL, |
no test coverage detected