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

undirected-graph-typed

Package Overview
Dependencies
Maintainers
1
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

undirected-graph-typed - npm Package Compare versions

Comparing version 1.45.1 to 1.45.2

33

dist/data-structures/heap/heap.js

@@ -274,15 +274,24 @@ "use strict";

bubbleUp(index) {
const element = this.nodes[index];
// const element = this.nodes[index];
// while (index > 0) {
// const parentIndex = (index - 1) >> 1;
// const parent = this.nodes[parentIndex];
// if (this.comparator(element, parent) < 0) {
// this.nodes[index] = parent;
// this.nodes[parentIndex] = element;
// index = parentIndex;
// } else {
// break;
// }
// }
const item = this.nodes[index];
while (index > 0) {
const parentIndex = Math.floor((index - 1) / 2);
const parent = this.nodes[parentIndex];
if (this.comparator(element, parent) < 0) {
this.nodes[index] = parent;
this.nodes[parentIndex] = element;
index = parentIndex;
}
else {
const parent = (index - 1) >> 1;
const parentItem = this.nodes[parent];
if (this.comparator(parentItem, item) <= 0)
break;
}
this.nodes[index] = parentItem;
index = parent;
}
this.nodes[index] = item;
}

@@ -301,4 +310,4 @@ /**

sinkDown(index) {
const leftChildIndex = 2 * index + 1;
const rightChildIndex = 2 * index + 2;
const leftChildIndex = index << 1 | 1;
const rightChildIndex = leftChildIndex + 1;
const length = this.nodes.length;

@@ -305,0 +314,0 @@ let targetIndex = index;

{
"name": "undirected-graph-typed",
"version": "1.45.1",
"version": "1.45.2",
"description": "Undirected Graph. Javascript & Typescript Data Structure.",

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

"dependencies": {
"data-structure-typed": "^1.45.0"
"data-structure-typed": "^1.45.2"
}
}

@@ -308,14 +308,24 @@ /**

protected bubbleUp(index: number): void {
const element = this.nodes[index];
// const element = this.nodes[index];
// while (index > 0) {
// const parentIndex = (index - 1) >> 1;
// const parent = this.nodes[parentIndex];
// if (this.comparator(element, parent) < 0) {
// this.nodes[index] = parent;
// this.nodes[parentIndex] = element;
// index = parentIndex;
// } else {
// break;
// }
// }
const item = this.nodes[index];
while (index > 0) {
const parentIndex = Math.floor((index - 1) / 2);
const parent = this.nodes[parentIndex];
if (this.comparator(element, parent) < 0) {
this.nodes[index] = parent;
this.nodes[parentIndex] = element;
index = parentIndex;
} else {
break;
}
const parent = (index - 1) >> 1;
const parentItem = this.nodes[parent];
if (this.comparator(parentItem, item) <= 0) break;
this.nodes[index] = parentItem;
index = parent;
}
this.nodes[index] = item;
}

@@ -336,4 +346,4 @@

protected sinkDown(index: number): void {
const leftChildIndex = 2 * index + 1;
const rightChildIndex = 2 * index + 2;
const leftChildIndex = index << 1 | 1;
const rightChildIndex = leftChildIndex + 1;
const length = this.nodes.length;

@@ -340,0 +350,0 @@ let targetIndex = index;

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