min-heap-typed
Advanced tools
Comparing version 1.41.3 to 1.41.4
@@ -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); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1296436
25571
Updateddata-structure-typed@^1.41.4