(items: T[])
| 32 | } |
| 33 | |
| 34 | prepend(items: T[]): void { |
| 35 | const current = this.toArray(); |
| 36 | this.clear(); |
| 37 | const combined = [...items, ...current]; |
| 38 | const toKeep = combined.slice(-this.capacity); |
| 39 | for (const item of toKeep) { |
| 40 | this.push(item); |
| 41 | } |
| 42 | } |
| 43 | } |
no test coverage detected