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.0.1 to 0.0.2

browser.js

7

package.json
{
"name": "graphlib",
"version": "0.0.1",
"version": "0.0.2",
"description": "A directed multi-graph library",
"main": "graphlib.js",
"main": "index.js",
"keywords": [

@@ -10,2 +10,3 @@ "graph"

"devDependencies": {
"browserify": "2.28.x",
"chai": "1.7.x",

@@ -18,3 +19,3 @@ "mocha": "1.12.x",

"type": "git",
"url": "https://github.com/cpettitt/dagre.git"
"url": "https://github.com/cpettitt/graphlib.git"
},

@@ -21,0 +22,0 @@ "license": "MIT",

var assert = require("chai").assert,
Graph = require("../graphlib").Graph;
Graph = require("../lib/Graph");

@@ -97,2 +97,40 @@ describe("Graph", function() {

describe("sources", function() {
it("returns all nodes for a graph with no edges", function() {
var g = new Graph();
g.addNode("a");
g.addNode("b");
g.addNode("c");
assert.deepEqual(g.sources().sort(), ["a", "b", "c"]);
});
it("returns only nodes that have no in-edges", function() {
var g = new Graph();
g.addNode("a");
g.addNode("b");
g.addNode("c");
g.addEdge(null, "a", "b");
assert.deepEqual(g.sources().sort(), ["a", "c"]);
});
});
describe("sinks", function() {
it("returns all nodes for a graph with no edges", function() {
var g = new Graph();
g.addNode("a");
g.addNode("b");
g.addNode("c");
assert.deepEqual(g.sinks().sort(), ["a", "b", "c"]);
});
it("returns only nodes that have no out-edges", function() {
var g = new Graph();
g.addNode("a");
g.addNode("b");
g.addNode("c");
g.addEdge(null, "a", "b");
assert.deepEqual(g.sinks().sort(), ["b", "c"]);
});
});
describe("edge", function() {

@@ -99,0 +137,0 @@ it("throws if the edge isn't in the graph", function() {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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