Return entries in insertion order (oldest first)
()
| 43 | |
| 44 | /** Return entries in insertion order (oldest first) */ |
| 45 | toArray(): T[] { |
| 46 | const result: T[] = []; |
| 47 | for (let i = 0; i < this._size; i++) { |
| 48 | result.push(this.buffer[(this.head + i) % this.capacity] as T); |
| 49 | } |
| 50 | return result; |
| 51 | } |
| 52 | |
| 53 | /** Return the last N entries (most recent first → reversed to oldest first) */ |
| 54 | last(n: number): T[] { |
no test coverage detected