(events)
| 55 | } |
| 56 | |
| 57 | function extractLatestUsage(events) { |
| 58 | const matches = []; |
| 59 | for (const event of events) { |
| 60 | collectUsageCandidate(event, matches); |
| 61 | } |
| 62 | return matches.length > 0 ? matches[matches.length - 1] : null; |
| 63 | } |
| 64 | |
| 65 | function collectErrorMessage(event) { |
| 66 | if (!event || typeof event !== "object") { |
no test coverage detected