MCPcopy Create free account
hub / github.com/badrap/sorted-queue / push

Method push

src/index.ts:12–17  ·  view source on GitHub ↗
(value: T)

Source from the content-addressed store, hash-verified

10 }
11
12 push(value: T): SortedQueueItem<T> {
13 const item = new Item(value, this._array, this._array.length, this._cmp);
14 this._array.push(item);
15 siftUp(this._array, item, this._cmp);
16 return item;
17 }
18
19 peek(): SortedQueueItem<T> | undefined {
20 return this._array.length > 0 ? this._array[0] : undefined;

Callers 2

collectFunction · 0.80
index.test.tsFile · 0.80

Calls 1

siftUpFunction · 0.85

Tested by 1

collectFunction · 0.64