priority-queue
Advanced tools
+3
-0
@@ -0,1 +1,4 @@ | ||
| ## 0.2.1 | ||
| * fix critical crashing bug (issue #3) | ||
| ## 0.2.0 | ||
@@ -2,0 +5,0 @@ * BREAKING: queue(...) requires priority as the 3rd argument, no longer optional |
+1
-1
| { | ||
| "name": "priority-queue", | ||
| "version": "0.2.0", | ||
| "version": "0.2.1", | ||
| "description": "functional, data oriented priority queue that doesn't suck", | ||
@@ -5,0 +5,0 @@ "main": "priority-queue.js", |
@@ -84,6 +84,6 @@ | ||
| if (left <= heap.length && heap.arr[left].priority > heap.arr[largest].priority) | ||
| if (left < heap.length && heap.arr[left].priority > heap.arr[largest].priority) | ||
| largest = left | ||
| if (right <= heap.length && heap.arr[right].priority > heap.arr[largest].priority) | ||
| if (right < heap.length && heap.arr[right].priority > heap.arr[largest].priority) | ||
| largest = right | ||
@@ -90,0 +90,0 @@ |
+36
-0
@@ -118,2 +118,38 @@ import PQ from './priority-queue.js' | ||
| it('github issue #3', () => { | ||
| // this specific set of calls causes a crash | ||
| const obj = PQ.create() | ||
| PQ.queue(obj, 50, 0) | ||
| PQ.dequeue(obj) | ||
| PQ.queue(obj, 49, -208.01627535185656) | ||
| PQ.queue(obj, 51, -210.25305660400815) | ||
| PQ.dequeue(obj) | ||
| PQ.queue(obj, 48, -224.8892169096033) | ||
| PQ.dequeue(obj) | ||
| PQ.queue(obj, 0, -248.46823429680552) | ||
| PQ.queue(obj, 34, -228.26373397712936) | ||
| PQ.queue(obj, 35, -239.23167864379525) | ||
| PQ.queue(obj, 37, -266.89894250109546) | ||
| PQ.queue(obj, 86, -349.68815199723747) | ||
| PQ.queue(obj, 87, -365.64707670906125) | ||
| PQ.queue(obj, 113, -320.62073398614984) | ||
| PQ.queue(obj, 116, -420.20447008152644) | ||
| PQ.queue(obj, 114, -297.2795767836452) | ||
| PQ.queue(obj, 115, -275.62135818236425) | ||
| PQ.queue(obj, 36, -252.2200007506263) | ||
| PQ.queue(obj, 79, -252.54674757055753) | ||
| PQ.queue(obj, 88, -382.0386737765449) | ||
| PQ.queue(obj, 8, -311.2518915300308) | ||
| PQ.dequeue(obj) | ||
| PQ.queue(obj, 110, -369.64947731728694) | ||
| PQ.queue(obj, 0, -245.463916203665) | ||
| }) | ||
| describe('test with an object', () => { | ||
@@ -120,0 +156,0 @@ it('basic test', () => { |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
15952
7.41%336
9.09%0
-100%