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

ngraph.graph

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngraph.graph - npm Package Compare versions

Comparing version 0.0.12 to 0.0.13

perf/linkremoval.js

18

index.js

@@ -5,2 +5,6 @@ /**

// TODO: need to change storage layer:
// 1. Be able to get all nodes O(1)
// 2. Be able to get number of links O(1)
/**

@@ -121,3 +125,3 @@ * @example

*/
getNodesCount: function() {
getNodesCount: function () {
return nodesCount;

@@ -129,3 +133,3 @@ },

*/
getLinksCount: function() {
getLinksCount: function () {
return links.length;

@@ -203,2 +207,12 @@ },

/**
* Detects whether there is a node with given id
*
* Operation complexity is O(n1
* NOTE: this function is synonim for getNode()
*
* @returns node if there is one; Falsy value otherwise.
*/
hasNode: getNode,
/**
* Gets an edge between two nodes.

@@ -205,0 +219,0 @@ * Operation complexity is O(n) where n - number of links of a node.

4

package.json
{
"name": "ngraph.graph",
"version": "0.0.12",
"version": "0.0.13",
"description": "Base graph structure in ngraph.*",

@@ -29,3 +29,5 @@ "main": "index.js",

"argg": "0.0.1",
"benchmark": "^1.0.0",
"istanbul": "^0.3.5",
"ngraph.generators": "0.0.16",
"plato": "^1.3.0",

@@ -32,0 +34,0 @@ "tap": "~0.4.4"

@@ -18,2 +18,12 @@ var test = require('tap').test,

test('hasNode checks node', function(t) {
var graph = createGraph();
graph.addNode(1);
t.ok(graph.hasNode(1), 'node is there');
t.notOk(graph.hasNode(2), 'should not be here');
t.end();
});
test('hasLink checks links', function (t) {

@@ -20,0 +30,0 @@ var graph = createGraph();

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