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

min-heap-typed

Package Overview
Dependencies
Maintainers
1
Versions
158
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

min-heap-typed - npm Package Compare versions

Comparing version 1.41.3 to 1.41.4

21

dist/data-structures/binary-tree/binary-tree.js

@@ -145,4 +145,6 @@ "use strict";

if (cur) {
if (newNode && cur.key === newNode.key)
if (newNode && cur.key === newNode.key) {
cur.value = newNode.value;
return;
}
const inserted = this._addTo(newNode, cur);

@@ -174,12 +176,11 @@ if (inserted !== undefined)

}
const key = typeof keyOrNode === 'number' ? keyOrNode : keyOrNode ? keyOrNode.key : undefined;
const existNode = key !== undefined ? this.getNode(key, (node) => node.key) : undefined;
// const key = typeof keyOrNode === 'number' ? keyOrNode : keyOrNode ? keyOrNode.key : undefined;
// const existNode = key !== undefined ? this.getNode(key, (node: N) => node.key) : undefined;
if (this.root) {
if (existNode) {
existNode.value = value;
inserted = existNode;
}
else {
inserted = _bfs(this.root, needInsert);
}
// if (existNode) {
// existNode.value = value;
// inserted = existNode;
// } else {
inserted = _bfs(this.root, needInsert);
// }
}

@@ -186,0 +187,0 @@ else {

{
"name": "min-heap-typed",
"version": "1.41.3",
"version": "1.41.4",
"description": "Min Heap. Javascript & Typescript Data Structure.",

@@ -134,4 +134,4 @@ "main": "dist/index.js",

"dependencies": {
"data-structure-typed": "^1.41.3"
"data-structure-typed": "^1.41.4"
}
}

@@ -182,3 +182,6 @@ /**

if (cur) {
if (newNode && cur.key === newNode.key) return;
if (newNode && cur.key === newNode.key) {
cur.value = newNode.value;
return;
}
const inserted = this._addTo(newNode, cur);

@@ -205,12 +208,12 @@ if (inserted !== undefined) return inserted;

const key = typeof keyOrNode === 'number' ? keyOrNode : keyOrNode ? keyOrNode.key : undefined;
const existNode = key !== undefined ? this.getNode(key, (node: N) => node.key) : undefined;
// const key = typeof keyOrNode === 'number' ? keyOrNode : keyOrNode ? keyOrNode.key : undefined;
// const existNode = key !== undefined ? this.getNode(key, (node: N) => node.key) : undefined;
if (this.root) {
if (existNode) {
existNode.value = value;
inserted = existNode;
} else {
inserted = _bfs(this.root, needInsert);
}
// if (existNode) {
// existNode.value = value;
// inserted = existNode;
// } else {
inserted = _bfs(this.root, needInsert);
// }
} else {

@@ -217,0 +220,0 @@ this._setRoot(needInsert);

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