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

heap-typed

Package Overview
Dependencies
Maintainers
1
Versions
160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heap-typed - npm Package Compare versions

Comparing version 1.19.9 to 1.20.0

4

package.json
{
"name": "heap-typed",
"version": "1.19.9",
"version": "1.20.0",
"description": "Heap. Javascript & Typescript Data Structure.",

@@ -60,5 +60,5 @@ "main": "dist/index.js",

"dependencies": {
"data-structure-typed": "^1.19.9",
"data-structure-typed": "^1.20.0",
"zod": "^3.22.2"
}
}

@@ -24,3 +24,7 @@ # What

```
### methods
Min Heap
![](https://github.com/zrwusa/assets/blob/master/images/data-structure-typed/methods-8bit/min-heap.png?raw=true)
Max Heap
![](https://github.com/zrwusa/assets/blob/master/images/data-structure-typed/methods-8bit/max-heap.png?raw=true)
### snippet

@@ -36,10 +40,16 @@

minNumHeap.add(1).add(6).add(2).add(0).add(5).add(9);
minNumHeap.poll() // 0
minNumHeap.poll() // 1
minNumHeap.peek() // 2
minNumHeap.toArray().length // 4
minNumHeap.toArray()[0] // 2
minNumHeap.toArray()[1] // 5
minNumHeap.toArray()[2] // 9
minNumHeap.toArray()[3] // 6
minNumHeap.has(1) // true
minNumHeap.has(2) // true
minNumHeap.poll() // 0
minNumHeap.poll() // 1
minNumHeap.peek() // 2
minNumHeap.has(1); // false
minNumHeap.has(2); // true
const arrFromHeap = minNumHeap.toArray();
arrFromHeap.length // 4
arrFromHeap[0] // 2
arrFromHeap[1] // 5
arrFromHeap[2] // 9
arrFromHeap[3] // 6
minNumHeap.sort() // [2, 5, 6, 9]

@@ -89,10 +99,16 @@

minNumHeap.add(1).add(6).add(2).add(0).add(5).add(9);
minNumHeap.poll() // 0
minNumHeap.poll() // 1
minNumHeap.peek() // 2
minNumHeap.toArray().length // 4
minNumHeap.toArray()[0] // 2
minNumHeap.toArray()[1] // 5
minNumHeap.toArray()[2] // 9
minNumHeap.toArray()[3] // 6
minNumHeap.has(1) // true
minNumHeap.has(2) // true
minNumHeap.poll() // 0
minNumHeap.poll() // 1
minNumHeap.peek() // 2
minNumHeap.has(1); // false
minNumHeap.has(2); // true
const arrFromHeap = minNumHeap.toArray();
arrFromHeap.length // 4
arrFromHeap[0] // 2
arrFromHeap[1] // 5
arrFromHeap[2] // 9
arrFromHeap[3] // 6
minNumHeap.sort() // [2, 5, 6, 9]

@@ -99,0 +115,0 @@

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