@liqd-js/heap
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -15,6 +15,7 @@ type Comparator<T> = (a: T, b: T) => number; | ||
top(): T | undefined; | ||
push(item: T): void; | ||
push(item: T): this; | ||
pop(): T | undefined; | ||
update(item: T): boolean; | ||
delete(item: T): boolean; | ||
clear(): this; | ||
sort(): this; | ||
@@ -21,0 +22,0 @@ } |
@@ -90,2 +90,3 @@ export default class Heap { | ||
this.sift_up(this.data.length - 1); | ||
return this; | ||
} | ||
@@ -145,2 +146,7 @@ pop() { | ||
} | ||
clear() { | ||
this.data = new Array(); | ||
this.index = undefined; | ||
return this; | ||
} | ||
sort() { | ||
@@ -147,0 +153,0 @@ let data = this.data; |
{ | ||
"name": "@liqd-js/heap", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "", | ||
@@ -20,4 +20,4 @@ "author": "radixxko", | ||
"devDependencies": { | ||
"typescript": "^5.3.3" | ||
"typescript": "^5.4.2" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
7473
183