MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / toArray

Method toArray

source code/utils/CircularBuffer.ts:57–69  ·  view source on GitHub ↗

* Get all items currently in the buffer, in order from oldest to newest.

()

Source from the content-addressed store, hash-verified

55 * Get all items currently in the buffer, in order from oldest to newest.
56 */
57 toArray(): T[] {
58 if (this.size === 0) return []
59
60 const result: T[] = []
61 const start = this.size < this.capacity ? 0 : this.head
62
63 for (let i = 0; i < this.size; i++) {
64 const index = (start + i) % this.capacity
65 result.push(this.buffer[index]!)
66 }
67
68 return result
69 }
70
71 /**
72 * Clear all items from the buffer.

Callers 3

BylineFunction · 0.80
OrderedListComponentFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected