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

ngraph.coarsen

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngraph.coarsen - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

1

index.js

@@ -22,2 +22,3 @@ var createGraph = require('ngraph.graph');

makeSureNodeAdded(fromCommunity, srcLink.fromId);
makeSureNodeAdded(fromCommunity, srcLink.toId);
} else {

@@ -24,0 +25,0 @@ makeSureNodeAdded(fromCommunity, srcLink.fromId);

2

package.json
{
"name": "ngraph.coarsen",
"version": "1.0.1",
"version": "1.0.2",
"description": "Given a community structure creates a coarse graph",

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

@@ -28,2 +28,21 @@ var coarsen = require('../');

test('it adds all nodes inside a community', function(t) {
var srcGraph = createGraph();
srcGraph.addLink(1, 2);
var fakeCommunity = {
getClass: function getClass() {
return 1; // everyone belongs to the same community
}
}
var newGraph = coarsen(srcGraph, fakeCommunity);
var community = newGraph.getNode(1);
t.equals(community.data.size, 2, 'Both nodes are added');
t.ok(community.data.has(1), '1 is there');
t.ok(community.data.has(2), '2 is there');
t.end();
});
test('it accumulates weights', function(t) {

@@ -30,0 +49,0 @@ var srcGraph = createGraph();

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