MCPcopy
hub / github.com/nukeop/nuclear / toArray

Method toArray

packages/player/src/utils/RingBuffer.ts:24–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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();

Callers 4

prependMethod · 0.95
SoundFunction · 0.80
RingBuffer.test.tsFile · 0.80
useLogStreamFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected