(events: unknown[])
| 128 | }) |
| 129 | |
| 130 | function countRoutedEvents(events: unknown[]) { |
| 131 | let records = 0 |
| 132 | let unsupported = 0 |
| 133 | for (const event of events) { |
| 134 | if (!isRecord(event)) continue |
| 135 | if (routeEvent(event)) records++ |
| 136 | else unsupported++ |
| 137 | } |
| 138 | return { records, unsupported } |
| 139 | } |
| 140 | |
| 141 | function isRecord(item: unknown): item is IngestEvent { |
| 142 | return Boolean(item) && typeof item === "object" && !Array.isArray(item) |
no test coverage detected