(contact: Record<string, unknown>)
| 48 | } |
| 49 | |
| 50 | function normalizeWhatsAppContact(contact: Record<string, unknown>) { |
| 51 | const profile = isRecord(contact.profile) ? contact.profile : undefined |
| 52 | |
| 53 | return { |
| 54 | wa_id: typeof contact.wa_id === 'string' ? contact.wa_id : undefined, |
| 55 | profile: profile |
| 56 | ? { |
| 57 | name: typeof profile.name === 'string' ? profile.name : undefined, |
| 58 | } |
| 59 | : undefined, |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | function normalizeWhatsAppMessage( |
| 64 | message: Record<string, unknown>, |
no test coverage detected