Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tiny-binary-heap

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiny-binary-heap - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

21

index.js

@@ -34,2 +34,23 @@ module.exports = class TinyBinaryHeap {

update () {
this._down(1)
}
filter (fn) { // TODO: can prob be done smarter, research
const all = []
for (let pos = 0; pos < this.heap.length; pos++) {
const val = this.heap[pos]
if (val === undefined) continue
if (fn(val)) all.push(val)
this.heap[pos] = undefined
}
this.length = 0
for (let i = 0; i < all.length; i++) {
this.push(all[i])
}
}
_down (pos) {

@@ -36,0 +57,0 @@ const val = this.heap[pos]

2

package.json
{
"name": "tiny-binary-heap",
"version": "1.0.0",
"version": "1.1.0",
"description": "Tiny binary heap with no dependencies",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc