MCPcopy Create free account
hub / github.com/simstudioai/sim / normalizeWhatsAppContact

Function normalizeWhatsAppContact

apps/sim/lib/webhooks/providers/whatsapp.ts:50–61  ·  view source on GitHub ↗
(contact: Record<string, unknown>)

Source from the content-addressed store, hash-verified

48}
49
50function 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
63function normalizeWhatsAppMessage(
64 message: Record<string, unknown>,

Callers 1

formatInputFunction · 0.85

Calls 1

isRecordFunction · 0.70

Tested by

no test coverage detected