MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / constructor

Method constructor

cli/src/utils/arrays.ts:33–46  ·  view source on GitHub ↗
(items: T[] | undefined = undefined, capacity: number = 100)

Source from the content-addressed store, hash-verified

31 private _defaultCapacity: number
32
33 constructor(items: T[] | undefined = undefined, capacity: number = 100) {
34 this._defaultCapacity = capacity
35 if (!items) {
36 items = []
37 }
38 this._items = items.length
39 ? [
40 ...items,
41 ...repeated(undefined as T, Math.max(0, capacity - items.length)),
42 ]
43 : [undefined as T]
44 this._head = 0
45 this._length = items.length
46 }
47
48 static from<T>(iterable: Iterable<T>): Queue<T> {
49 return new Queue<T>([...iterable])

Callers

nothing calls this directly

Calls 1

repeatedFunction · 0.85

Tested by

no test coverage detected