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

graphology-operators

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphology-operators - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

index.d.ts

1

index.js

@@ -8,2 +8,3 @@ /**

exports.reverse = require('./reverse.js');
exports.toSimple = require('./to-simple.js');
exports.union = require('./union.js');

2

LICENSE.txt
The MIT License (MIT)
Copyright (c) 2016 Guillaume Plique (Yomguithereal)
Copyright (c) 2016-2020 Guillaume Plique (Yomguithereal)

@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy

{
"name": "graphology-operators",
"version": "0.1.0",
"version": "0.2.0",
"description": "Miscellaneous operators for graphology.",
"main": "index.js",
"files": [
"*.d.ts",
"index.js",
"reverse.js",
"to-simple.js",
"union.js"

@@ -13,2 +15,3 @@ ],

"lint": "eslint *.js",
"prepublish": "npm run lint && npm test",
"test": "mocha test.js"

@@ -36,6 +39,6 @@ },

"devDependencies": {
"@yomguithereal/eslint-config": "^3.0.0",
"eslint": "^3.5.0",
"graphology": "0.4.0",
"mocha": "^3.0.2"
"@yomguithereal/eslint-config": "^4.0.0",
"eslint": "^6.8.0",
"graphology": "^0.15.0",
"mocha": "^7.0.1"
},

@@ -46,4 +49,5 @@ "eslintConfig": {

"dependencies": {
"graphology-types": "^0.15.0",
"graphology-utils": "^1.1.1"
}
}

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

[![Build Status](https://travis-ci.org/graphology/graphology-operators.svg)](https://travis-ci.org/graphology/graphology-operators)
# Graphology Operators

@@ -21,2 +23,6 @@

*Cast*
* [toSimple](#tosimple)
### reverse

@@ -54,1 +60,15 @@

* **H** *Graph*: second graph.
### toSimple
Returns the simple version of the given multigraph where we only keep a single edge of each type between nodes.
If a simple graph is passed, the function will only return a copy of it.
```js
import {toSimple} from 'graphology-operators';
// Alternatively, to load only the relevant code:
import toSimple from 'graphology-operators/to-simple';
const simpleGraph = toSimple(multiGraph);
```

@@ -20,6 +20,10 @@ /**

// Importing the nodes
reversed.importNodes(graph.exportNodes());
graph.forEachNode(function(n, a) {
reversed.addNode(n, a);
});
// Importing undirected edges
reversed.importEdges(graph.exportUndirectedEdges());
graph.forEachUndirectedEdge(function(e) {
reversed.importEdge(graph.exportEdge(e));
});

@@ -26,0 +30,0 @@ // Reversing directed edges

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