New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

graphs-all

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphs-all - npm Package Compare versions

Comparing version 0.0.0-semantic-release to 0.0.0

4

package.json
{
"name": "graphs-all",
"version": "0.0.0-semantic-release",
"version": "0.0.0",
"description": "Graph Data Structure Library",

@@ -46,2 +46,2 @@ "main": "src/index.js",

}
}
}

@@ -66,2 +66,15 @@ function Graph(isDirected, isWeighted) {

this.removeLink = function(key1, key2) {
if (!this.hasLink(key1, key2)) {
return false;
}
var id1 = keyToIdTable[key1],
id2 = keyToIdTable[key2];
delete this.links[id1][id2];
if (!isDirected) {
delete this.links[id2][id1];
}
return true;
};
this.linkWeight = function (key1, key2) {

@@ -68,0 +81,0 @@ if (!this.hasLink(key1, key2)) {

@@ -61,3 +61,5 @@ var expect = require("chai").expect;

g.addNode("Three", 3);
g.addNode("Five", 5);
g.addLink("One", "Two");
g.addLink("One", "Five");
expect(g.hasLink("One", "Two")).to.be.true;

@@ -76,2 +78,9 @@ expect(g.hasLink("Two", "One")).to.be.true;

// Remove
expect(g.removeLink("One", "Two")).to.be.true;
expect(g.hasLink("One", "Two")).to.be.false;
expect(g.hasLink("Two", "One")).to.be.false;
expect(g.removeLink("One", "Two")).to.be.false;
expect(g.linkWeight("Two", "One")).to.be.undefined;
})

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