(msg: unknown)
| 41 | |
| 42 | /** Pull file_attachments off a loosely-typed inbound message. */ |
| 43 | export function extractInboundAttachments(msg: unknown): InboundAttachment[] { |
| 44 | if (typeof msg !== 'object' || msg === null || !('file_attachments' in msg)) { |
| 45 | return [] |
| 46 | } |
| 47 | const parsed = attachmentsArraySchema().safeParse(msg.file_attachments) |
| 48 | return parsed.success ? parsed.data : [] |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * Strip path components and keep only filename-safe chars. file_name comes |
no outgoing calls
no test coverage detected