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

graphology-gexf

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphology-gexf - npm Package Compare versions

Comparing version 0.12.1 to 0.13.0

19

common/parser.js

@@ -250,2 +250,3 @@ /* eslint no-self-compare: 0 */

var allowUndeclaredAttributes = options.allowUndeclaredAttributes === true;
var respectInputGraphType = options.respectInputGraphType === true;
var mergeResult;

@@ -311,6 +312,6 @@

// Instantiating our graph
var graph = new Graph({
type: graphType
});
var graphOptions = respectInputGraphType ? {} : {type: graphType};
var graph = new Graph(graphOptions);
// Collecting meta

@@ -358,2 +359,9 @@ var meta = collectMeta(META_ELEMENTS);

if (type !== graph.type && graph.type !== 'mixed') {
if (respectInputGraphType)
throw new Error(
"graphology-gexf/parser: one of the file's edges does not respect the input graph type: " +
graph.type +
'.'
);
graph = graph.copy({type: 'mixed'});

@@ -368,2 +376,7 @@ }

) {
if (respectInputGraphType)
throw new Error(
'graphology-gexf/parser: the file contains parallel edges that the input graph type does not allow.'
);
graph = graph.copy({multi: true});

@@ -370,0 +383,0 @@ }

@@ -6,2 +6,3 @@ import {Attributes} from 'graphology-types';

allowUndeclaredAttributes?: boolean;
respectInputGraphType?: boolean;
};

@@ -8,0 +9,0 @@

2

package.json
{
"name": "graphology-gexf",
"version": "0.12.1",
"version": "0.13.0",
"description": "GEXF parser & writer for graphology.",

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

@@ -50,2 +50,3 @@ [![Build Status](https://github.com/graphology/graphology-gexf/workflows/Tests/badge.svg)](https://github.com/graphology/graphology-gexf/actions)

- **allowUndeclaredAttributes** _?boolean_ [`false`]: whether to allow undeclared attributes for both nodes & edges, which will be considered as strings.
- **respectInputGraphType** _?boolean_ [`false`]: whether to make sure the output graph type is the same as the passed constructor. By default the parser will try to optimize the graph representation to avoid wasting time and memory. But if `respectInputGraphType` is `true` the output graph is guaranteed to be an instance of the typed constructor you gave as first argument. This also means the parser will throw when reading a graph that cannot be represented with the given typed constructor.

@@ -52,0 +53,0 @@ ### Writer

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