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

graphology-indices

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphology-indices - npm Package Compare versions

Comparing version 0.16.4 to 0.16.5

bfs-queue.d.ts

6

dfs-stack.d.ts

@@ -1,7 +0,9 @@

export default class DFSStack {
export default class DFSStack<T = string> {
size: number;
seen: Set<string>;
constructor(order: number);
has(node: string): boolean;
push(node: string): boolean;
pop(): string | undefined;
pushWith(node: string, item: T): boolean;
pop(): T | undefined;
}
/**
* Graphology DFS Stack.
* ======================
* Graphology DFS Stack
* =====================
*

@@ -32,2 +32,15 @@ * An experiment to speed up DFS in graphs and connected component detection.

DFSStack.prototype.pushWith = function (node, item) {
var seenSizeBefore = this.seen.size;
this.seen.add(node);
// If node was already seen
if (seenSizeBefore === this.seen.size) return false;
this.stack[this.size++] = item;
return true;
};
DFSStack.prototype.pop = function () {

@@ -34,0 +47,0 @@ if (this.size === 0) return;

@@ -0,1 +1,2 @@

export {default as BFSQueue} from './bfs-queue';
export {default as DFSStack} from './dfs-stack';

@@ -2,0 +3,0 @@ export {UndirectedLouvainIndex, DirectedLouvainIndex} from './louvain';

@@ -10,2 +10,3 @@ /**

exports.BFSQueue = require('./bfs-queue.js');
exports.DFSStack = require('./dfs-stack.js');

@@ -12,0 +13,0 @@ exports.UndirectedLouvainIndex = louvain.UndirectedLouvainIndex;

{
"name": "graphology-indices",
"version": "0.16.4",
"version": "0.16.5",
"description": "Miscellaneous indices for graphology.",

@@ -8,2 +8,3 @@ "main": "index.js",

"*.d.ts",
"bfs-queue.js",
"dfs-stack.js",

@@ -42,4 +43,4 @@ "index.js",

"graphology-utils": "^2.4.2",
"mnemonist": "^0.38.0"
"mnemonist": "^0.39.0"
}
}

@@ -21,1 +21,2 @@ # Graphology Indices

- A specialized stack/set that can be used to perform memory-efficient DFS traversals.
- A specialized queue/set that can be used to perform memory-efficient BFS traversals.
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