(accounts)
| 1246 | } |
| 1247 | |
| 1248 | function normalizeHotmailAccounts(accounts) { |
| 1249 | if (!Array.isArray(accounts)) return []; |
| 1250 | |
| 1251 | const deduped = new Map(); |
| 1252 | for (const account of accounts) { |
| 1253 | const normalized = normalizeHotmailAccount(account); |
| 1254 | if (!normalized.email && !normalized.id) continue; |
| 1255 | deduped.set(normalized.id, normalized); |
| 1256 | } |
| 1257 | return [...deduped.values()]; |
| 1258 | } |
| 1259 | |
| 1260 | function findHotmailAccount(accounts, accountId) { |
| 1261 | return normalizeHotmailAccounts(accounts).find((account) => account.id === accountId) || null; |
no test coverage detected