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

graphology-utils

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphology-utils - npm Package Compare versions

Comparing version 2.4.4 to 2.5.0

infer-multi.d.ts

1

index.d.ts

@@ -0,1 +1,2 @@

export {default as inferMulti} from './infer-multi';
export {default as inferType} from './infer-type';

@@ -2,0 +3,0 @@ export {default as isGraph} from './is-graph';

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

*/
exports.inferMulti = require('./infer-multi.js');
exports.inferType = require('./infer-type.js');

@@ -9,0 +10,0 @@ exports.isGraph = require('./is-graph.js');

3

package.json
{
"name": "graphology-utils",
"version": "2.4.4",
"version": "2.5.0",
"description": "Miscellaneous utils for graphology.",

@@ -14,2 +14,3 @@ "main": "index.js",

"infer-type.js",
"infer-multi.js",
"is-graph.js",

@@ -16,0 +17,0 @@ "is-graph-constructor.js",

@@ -20,2 +20,3 @@ # Graphology Utils

- [#.inferMulti](#infermulti)
- [#.inferType](#infertype)

@@ -35,19 +36,2 @@

### #.inferType
Function returning the inferred type of the given graph. This function is useful to check whether a given mixed graph is in fact a mere `directed` or `undirected` graph based on its actual edges.
```js
import Graph from 'graphology';
import {inferType} from 'graphology-utils';
// Alternatively, if you want to only load the relevant code:
import inferType from 'graphology-utils/infer-type';
const graph = new Graph();
graph.addUndirectedEdge(1, 2);
inferType(graph);
>>> 'directed'
```
### #.isGraph

@@ -58,3 +42,2 @@

```js
import Graph from 'graphology';
import {isGraph} from 'graphology-utils';

@@ -85,3 +68,2 @@ // Alternatively, if you want to only load the relevant code:

```js
import Graph from 'graphology';
import {isGraphConstructor} from 'graphology-utils';

@@ -105,2 +87,39 @@ // Alternatively, if you want to only load the relevant code:

### #.inferMulti
Function returning whether the given graph is truly multi, i.e. if we can find at least one occurrence of multiple edges of the same type and direction between two nodes.
```js
import {inferMulti} from 'graphology-utils';
// Alternatively, if you want to only load the relevant code:
import inferMulti from 'graphology-utils/infer-multi';
const graph = new MultiGraph();
graph.addEdge(1, 2);
inferMulti(graph);
>>> false
graph.addEdge(1, 2);
inferMulti(graph);
>>> true
```
### #.inferType
Function returning the inferred type of the given graph. This function is useful to check whether a given mixed graph is in fact a mere `directed` or `undirected` graph based on its actual edges.
```js
import {inferType} from 'graphology-utils';
// Alternatively, if you want to only load the relevant code:
import inferType from 'graphology-utils/infer-type';
const graph = new Graph();
graph.addUndirectedEdge(1, 2);
inferType(graph);
>>> 'directed'
```
### #.mergeClique

@@ -111,3 +130,2 @@

```js
import Graph from 'graphology';
import {mergeClique} from 'graphology-utils';

@@ -129,3 +147,2 @@ // Alternatively, if you want to only load the relevant code:

```js
import Graph from 'graphology';
import {mergeCycle} from 'graphology-utils';

@@ -152,3 +169,2 @@ // Alternatively, if you want to only load the relevant code:

```js
import Graph from 'graphology';
import {mergePath} from 'graphology-utils';

@@ -175,3 +191,2 @@ // Alternatively, if you want to only load the relevant code:

```js
import Graph from 'graphology';
import {mergeStar} from 'graphology-utils';

@@ -198,3 +213,2 @@ // Alternatively, if you want to only load the relevant code:

```js
import Graph from 'graphology';
import {renameGraphKeys} from 'graphology-utils';

@@ -235,3 +249,2 @@ // Alternatively, if you want to only load the relevant code:

```js
import Graph from 'graphology';
import {updateGraphKeys} from 'graphology-utils';

@@ -238,0 +251,0 @@ // Alternatively, if you want to only load the relevant code:

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