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

graphlib

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphlib - npm Package Compare versions

Comparing version 0.5.4 to 0.5.5

6

CHANGELOG.md

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

v0.5.5
======
* Rely less on instanceof checks which may fail with different versions of the
library loaded.
v0.5.4

@@ -2,0 +8,0 @@ ======

2

lib/alg/components.js

@@ -21,3 +21,3 @@ var Set = require("../data/Set");

if (g.isDirected()) {
throw new Error("components cannot be used with a directed graph");
throw new Error("components can only be applied to an undirected graph. Bad input: " + g);
}

@@ -24,0 +24,0 @@

@@ -39,3 +39,3 @@ var PriorityQueue = require("../data/PriorityQueue"),

weightFunc = weightFunc || function() { return 1; };
incidentFunc = incidentFunc || (g instanceof Digraph
incidentFunc = incidentFunc || (g.isDirected()
? function(u) { return g.outEdges(u); }

@@ -42,0 +42,0 @@ : function(u) { return g.incidentEdges(u); });

@@ -39,3 +39,3 @@ var Digraph = require("../Digraph");

weightFunc = weightFunc || function() { return 1; };
incidentFunc = incidentFunc || (g instanceof Digraph
incidentFunc = incidentFunc || (g.isDirected()
? function(u) { return g.outEdges(u); }

@@ -42,0 +42,0 @@ : function(u) { return g.incidentEdges(u); });

@@ -23,4 +23,4 @@ var Digraph = require("../Digraph");

function tarjan(g) {
if (!(g instanceof Digraph)) {
throw new Error("tarjan can only be applied to a Digraph. Bad input: " + g);
if (!g.isDirected()) {
throw new Error("tarjan can only be applied to a directed graph. Bad input: " + g);
}

@@ -27,0 +27,0 @@

@@ -18,4 +18,4 @@ var Digraph = require("../Digraph");

function topsort(g) {
if (!(g instanceof Digraph)) {
throw new Error("topsort can only be applied to a Digraph. Bad input: " + g);
if (!g.isDirected()) {
throw new Error("topsort can only be applied to a directed graph. Bad input: " + g);
}

@@ -22,0 +22,0 @@

@@ -118,3 +118,4 @@ var util = require("../util");

Set.prototype.intersect = function(other) {
if (!(other instanceof Set)) {
// If the other Set does not look like a Set...
if (!other.keys) {
other = new Set(other);

@@ -121,0 +122,0 @@ }

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

module.exports = '0.5.4';
module.exports = '0.5.5';
{
"name": "graphlib",
"version": "0.5.4",
"version": "0.5.5",
"description": "A directed and undirected multi-graph library",

@@ -5,0 +5,0 @@ "main": "index.js",

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