Method
constructor
(private maxSize: number)
Source from the content-addressed store, hash-verified
| 3 | private currSize = 0 |
| 4 | |
| 5 | constructor(private maxSize: number) { |
| 6 | if (!this.maxSize) throw new Error('invalid size of zero') |
| 7 | if (this.maxSize === 1) throw new Error('invalid size of one') |
| 8 | for (let index = 0; index < this.maxSize; index++) { |
| 9 | this.values.push(undefined) |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | push(value: T) { |
| 14 | this.values[this.currSize % this.maxSize] = value |
Callers
nothing calls this directly
Tested by
no test coverage detected