Function
extractRecipient
(event: IResendEventBase)
Source from the content-addressed store, hash-verified
| 190 | }; |
| 191 | |
| 192 | const extractRecipient = (event: IResendEventBase): string | null => { |
| 193 | const to = event.data?.to; |
| 194 | |
| 195 | if (Array.isArray(to)) { |
| 196 | return typeof to[0] === "string" && to[0] !== "" ? to[0] : null; |
| 197 | } |
| 198 | |
| 199 | if (typeof to === "string" && to !== "") { |
| 200 | return to; |
| 201 | } |
| 202 | |
| 203 | return null; |
| 204 | }; |
| 205 | |
| 206 | /** |
| 207 | * Side-effect: persist a suppression row for a Resend event when the |
Tested by
no test coverage detected