()
| 39 | } |
| 40 | |
| 41 | toChunk(): Chunk.Chunk<A> { |
| 42 | const begin = this.current - this.size |
| 43 | const newArray = begin < 0 |
| 44 | ? [ |
| 45 | ...this.array.slice(this.capacity + begin, this.capacity), |
| 46 | ...this.array.slice(0, this.current) |
| 47 | ] |
| 48 | : this.array.slice(begin, this.current) |
| 49 | |
| 50 | return Chunk.fromIterable(newArray) as Chunk.Chunk<A> |
| 51 | } |
| 52 | |
| 53 | private increment(): void { |
| 54 | if (this.size < this.capacity) { |
no outgoing calls
no test coverage detected