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

priority-queue-typed

Package Overview
Dependencies
Maintainers
1
Versions
163
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

priority-queue-typed - npm Package Compare versions

Comparing version 1.47.8 to 1.47.9

5

dist/data-structures/graph/abstract-graph.d.ts

@@ -446,2 +446,7 @@ import type { DijkstraResult, VertexKey } from '../../types';

getBridges(): EO[];
[Symbol.iterator](): Iterator<[VertexKey, V | undefined]>;
forEach(callback: (entry: [VertexKey, V | undefined], index: number, map: Map<VertexKey, VO>) => void): void;
filter(predicate: (entry: [VertexKey, V | undefined], index: number, map: Map<VertexKey, VO>) => boolean): [VertexKey, V | undefined][];
map<T>(callback: (entry: [VertexKey, V | undefined], index: number, map: Map<VertexKey, VO>) => T): T[];
reduce<T>(callback: (accumulator: T, entry: [VertexKey, V | undefined], index: number, map: Map<VertexKey, VO>) => T, initialValue: T): T;
protected abstract _addEdgeOnly(edge: EO): boolean;

@@ -448,0 +453,0 @@ protected _addVertexOnly(newVertex: VO): boolean;

@@ -1031,2 +1031,43 @@ "use strict";

}
*[Symbol.iterator]() {
for (const vertex of this._vertices.values()) {
yield [vertex.key, vertex.value];
}
}
forEach(callback) {
let index = 0;
for (const vertex of this) {
callback(vertex, index, this._vertices);
index++;
}
}
filter(predicate) {
const filtered = [];
let index = 0;
for (const entry of this) {
if (predicate(entry, index, this._vertices)) {
filtered.push(entry);
}
index++;
}
return filtered;
}
map(callback) {
const mapped = [];
let index = 0;
for (const entry of this) {
mapped.push(callback(entry, index, this._vertices));
index++;
}
return mapped;
}
reduce(callback, initialValue) {
let accumulator = initialValue;
let index = 0;
for (const entry of this) {
accumulator = callback(accumulator, entry, index, this._vertices);
index++;
}
return accumulator;
}
_addVertexOnly(newVertex) {

@@ -1033,0 +1074,0 @@ if (this.hasVertex(newVertex)) {

2

dist/data-structures/graph/directed-graph.js

@@ -74,3 +74,3 @@ "use strict";

createVertex(key, value) {
return new DirectedVertex(key, value !== null && value !== void 0 ? value : key);
return new DirectedVertex(key, value);
}

@@ -77,0 +77,0 @@ /**

{
"name": "priority-queue-typed",
"version": "1.47.8",
"version": "1.47.9",
"description": "Priority Queue, Min Priority Queue, Max Priority Queue. Javascript & Typescript Data Structure.",

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

"dependencies": {
"data-structure-typed": "^1.47.8"
"data-structure-typed": "^1.47.9"
}
}

@@ -1162,2 +1162,48 @@ /**

* [Symbol.iterator](): Iterator<[VertexKey, V | undefined]> {
for (const vertex of this._vertices.values()) {
yield [vertex.key, vertex.value];
}
}
forEach(callback: (entry: [VertexKey, V | undefined], index: number, map: Map<VertexKey, VO>) => void): void {
let index = 0;
for (const vertex of this) {
callback(vertex, index, this._vertices);
index++;
}
}
filter(predicate: (entry: [VertexKey, V | undefined], index: number, map: Map<VertexKey, VO>) => boolean): [VertexKey, V | undefined][] {
const filtered: [VertexKey, V | undefined][] = [];
let index = 0;
for (const entry of this) {
if (predicate(entry, index, this._vertices)) {
filtered.push(entry);
}
index++;
}
return filtered;
}
map<T>(callback: (entry: [VertexKey, V | undefined], index: number, map: Map<VertexKey, VO>) => T): T[] {
const mapped: T[] = [];
let index = 0;
for (const entry of this) {
mapped.push(callback(entry, index, this._vertices));
index++;
}
return mapped;
}
reduce<T>(callback: (accumulator: T, entry: [VertexKey, V | undefined], index: number, map: Map<VertexKey, VO>) => T, initialValue: T): T {
let accumulator: T = initialValue;
let index = 0;
for (const entry of this) {
accumulator = callback(accumulator, entry, index, this._vertices);
index++;
}
return accumulator;
}
protected abstract _addEdgeOnly(edge: EO): boolean;

@@ -1164,0 +1210,0 @@

@@ -90,3 +90,3 @@ /**

createVertex(key: VertexKey, value?: V): VO {
return new DirectedVertex(key, value ?? key) as VO;
return new DirectedVertex(key, value) as VO;
}

@@ -93,0 +93,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