graphology-utils
Advanced tools
Comparing version 2.4.0 to 2.4.1
@@ -1,2 +0,2 @@ | ||
import Graph, {Attributes} from 'graphology-types'; | ||
import Graph, {Attributes, EdgeMergeResult} from 'graphology-types'; | ||
@@ -10,3 +10,3 @@ export function addEdge<EdgeAttributes extends Attributes = Attributes>( | ||
attributes?: EdgeAttributes | ||
): void; | ||
): string; | ||
@@ -20,3 +20,3 @@ export function copyEdge<EdgeAttributes extends Attributes = Attributes>( | ||
attributes?: EdgeAttributes | ||
): void; | ||
): string; | ||
@@ -30,3 +30,3 @@ export function mergeEdge<EdgeAttributes extends Attributes = Attributes>( | ||
attributes?: EdgeAttributes | ||
): void; | ||
): EdgeMergeResult; | ||
@@ -40,2 +40,2 @@ export function updateEdge<EdgeAttributes extends Attributes = Attributes>( | ||
updater?: (attributes: EdgeAttributes | {}) => EdgeAttributes | ||
): void; | ||
): EdgeMergeResult; |
@@ -18,8 +18,8 @@ /** | ||
if (key === null || key === undefined) | ||
graph.addUndirectedEdge(source, target, attributes); | ||
else graph.addUndirectedEdgeWithKey(key, source, target, attributes); | ||
return graph.addUndirectedEdge(source, target, attributes); | ||
else return graph.addUndirectedEdgeWithKey(key, source, target, attributes); | ||
} else { | ||
if (key === null || key === undefined) | ||
graph.addDirectedEdge(source, target, attributes); | ||
else graph.addDirectedEdgeWithKey(key, source, target, attributes); | ||
return graph.addDirectedEdge(source, target, attributes); | ||
else return graph.addDirectedEdgeWithKey(key, source, target, attributes); | ||
} | ||
@@ -40,8 +40,8 @@ }; | ||
if (key === null || key === undefined) | ||
graph.addUndirectedEdge(source, target, attributes); | ||
else graph.addUndirectedEdgeWithKey(key, source, target, attributes); | ||
return graph.addUndirectedEdge(source, target, attributes); | ||
else return graph.addUndirectedEdgeWithKey(key, source, target, attributes); | ||
} else { | ||
if (key === null || key === undefined) | ||
graph.addDirectedEdge(source, target, attributes); | ||
else graph.addDirectedEdgeWithKey(key, source, target, attributes); | ||
return graph.addDirectedEdge(source, target, attributes); | ||
else return graph.addDirectedEdgeWithKey(key, source, target, attributes); | ||
} | ||
@@ -60,8 +60,9 @@ }; | ||
if (key === null || key === undefined) | ||
graph.mergeUndirectedEdge(source, target, attributes); | ||
else graph.mergeUndirectedEdgeWithKey(key, source, target, attributes); | ||
return graph.mergeUndirectedEdge(source, target, attributes); | ||
else | ||
return graph.mergeUndirectedEdgeWithKey(key, source, target, attributes); | ||
} else { | ||
if (key === null || key === undefined) | ||
graph.mergeDirectedEdge(source, target, attributes); | ||
else graph.mergeDirectedEdgeWithKey(key, source, target, attributes); | ||
return graph.mergeDirectedEdge(source, target, attributes); | ||
else return graph.mergeDirectedEdgeWithKey(key, source, target, attributes); | ||
} | ||
@@ -80,9 +81,9 @@ }; | ||
if (key === null || key === undefined) | ||
graph.updateUndirectedEdge(source, target, updater); | ||
else graph.updateUndirectedEdgeWithKey(key, source, target, updater); | ||
return graph.updateUndirectedEdge(source, target, updater); | ||
else return graph.updateUndirectedEdgeWithKey(key, source, target, updater); | ||
} else { | ||
if (key === null || key === undefined) | ||
graph.updateDirectedEdge(source, target, updater); | ||
else graph.updateDirectedEdgeWithKey(key, source, target, updater); | ||
return graph.updateDirectedEdge(source, target, updater); | ||
else return graph.updateDirectedEdgeWithKey(key, source, target, updater); | ||
} | ||
}; |
@@ -7,2 +7,2 @@ import Graph, {Attributes} from 'graphology-types'; | ||
attributes?: NodeAttributes | ||
): void; | ||
): string; |
@@ -10,3 +10,3 @@ /** | ||
attributes = Object.assign({}, attributes); | ||
graph.addNode(key, attributes); | ||
return graph.addNode(key, attributes); | ||
}; |
{ | ||
"name": "graphology-utils", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"description": "Miscellaneous utils for graphology.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
23540
529