()
| 22 | } |
| 23 | |
| 24 | toArray(): T[] { |
| 25 | if (this.count < this.capacity) { |
| 26 | return [...this.buffer]; |
| 27 | } |
| 28 | return [ |
| 29 | ...this.buffer.slice(this.head), |
| 30 | ...this.buffer.slice(0, this.head), |
| 31 | ]; |
| 32 | } |
| 33 | |
| 34 | prepend(items: T[]): void { |
| 35 | const current = this.toArray(); |
no outgoing calls
no test coverage detected