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

Method getRecent

source code/utils/CircularBuffer.ts:41–52  ·  view source on GitHub ↗

* Get the most recent N items from the buffer. * Returns fewer items if the buffer contains less than N items.

(count: number)

Source from the content-addressed store, hash-verified

39 * Returns fewer items if the buffer contains less than N items.
40 */
41 getRecent(count: number): T[] {
42 const result: T[] = []
43 const start = this.size < this.capacity ? 0 : this.head
44 const available = Math.min(count, this.size)
45
46 for (let i = 0; i < available; i++) {
47 const index = (start + this.size - available + i) % this.capacity
48 result.push(this.buffer[index]!)
49 }
50
51 return result
52 }
53
54 /**
55 * Get all items currently in the buffer, in order from oldest to newest.

Callers 2

#updateProgressMethod · 0.80
getStdoutMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected