* Adds an item to the beginning of the buffer.
(value: T)
| 135 | * Adds an item to the beginning of the buffer. |
| 136 | */ |
| 137 | unshift(value: T) { |
| 138 | if (this.isFull()) { |
| 139 | throw new RangeError('Ring buffer is full.'); |
| 140 | } |
| 141 | this.begin = this.wrap(this.begin - 1); |
| 142 | this.set(this.begin, value); |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * Removes and returns the first item in the buffer. |
no test coverage detected