graphology-operators
Version:
Miscellaneous operators for graphology.
17 lines (14 loc) • 408 B
JavaScript
/**
* Graphology Operators To Multi Caster
* =====================================
*
* Function used to cast any graph to a multi one.
*/
var isGraph = require('graphology-utils/is-graph');
module.exports = function toMulti(graph) {
if (!isGraph(graph))
throw new Error(
'graphology-operators/to-multi: expecting a valid graphology instance.'
);
return graph.copy({multi: true});
};