MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / toArray

Method toArray

src/utils/CircularBuffer.ts:55–67  ·  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

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

Callers 4

BylineFunction · 0.80
OrderedListComponentFunction · 0.80

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected