(entry: HistoryEntry)
| 29 | const entries: HistoryEntry[] = []; |
| 30 | |
| 31 | const push = (entry: HistoryEntry): void => { |
| 32 | if (entries.length >= maxSize) entries.shift(); |
| 33 | entries.push(entry); |
| 34 | }; |
| 35 | |
| 36 | const getHistory = (): ReadonlyArray<HistoryEntry> => [...entries]; |
| 37 |