(queuePath)
| 72 | } |
| 73 | |
| 74 | function readEntries(queuePath) { |
| 75 | if (!fs.existsSync(queuePath)) return { exists: false, entries: [], malformed: 0 }; |
| 76 | const raw = fs.readFileSync(queuePath, 'utf8'); |
| 77 | const lines = raw.split('\n').filter(line => line.trim().length > 0); |
| 78 | const entries = []; |
| 79 | let malformed = 0; |
| 80 | |
| 81 | for (const line of lines) { |
| 82 | try { |
| 83 | entries.push(JSON.parse(line)); |
| 84 | } catch { |
| 85 | malformed++; |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | return { exists: true, entries, malformed }; |
| 90 | } |
| 91 | |
| 92 | function eventTime(entry) { |
| 93 | return entry.timestamp || entry.time || entry.created_at || null; |
no outgoing calls
no test coverage detected