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

incremental-cycle-detect

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

incremental-cycle-detect - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

105

dist/browser.js

@@ -64,8 +64,24 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.IncrementalCycleDetect = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){

};
GenericGraphAdapter.prototype.getEdgeDataTo = function (vertex) {
var b = this.backward.get(vertex);
if (b === undefined) {
return util_1.EmptyIterator;
}
return util_1.createFilteredIterator(b.values(), function (data) { return data !== undefined; });
};
GenericGraphAdapter.prototype.getEdgeDataFrom = function (vertex) {
var f = this.forward.get(vertex);
if (f === undefined) {
return util_1.EmptyIterator;
}
return util_1.createFilteredIterator(f.values(), function (data) { return data !== undefined; });
};
GenericGraphAdapter.prototype.setEdgeData = function (from, to, data) {
var map = this.forward.get(from);
if (!map || !map.has(to)) {
var f = this.forward.get(from);
var b = this.backward.get(to);
if (!f || !b || !f.has(to) || !b.has(from)) {
return false;
}
map.set(to, data);
f.set(to, data);
b.set(from, data);
return true;

@@ -97,2 +113,24 @@ };

};
GenericGraphAdapter.prototype.canAddEdge = function (from, to) {
var f = this.forward.get(from);
var b = this.backward.get(to);
var didNotHaveFrom = this.addVertex(from);
var didNotHaveTo = this.addVertex(to);
if (!f) {
this.forward.set(from, f = new this.mapConstructor());
}
if (!b) {
this.backward.set(to, b = new this.mapConstructor());
}
if (f.has(to) || !this.detector.canAddEdge(this.adapter, from, to)) {
if (didNotHaveFrom) {
this.deleteVertex(from);
}
if (didNotHaveTo) {
this.deleteVertex(to);
}
return false;
}
return true;
};
GenericGraphAdapter.prototype.addEdge = function (from, to, edgeData) {

@@ -119,3 +157,3 @@ var f = this.forward.get(from);

f.set(to, edgeData);
b.set(from, true);
b.set(from, edgeData);
this.edgeCount += 1;

@@ -217,2 +255,18 @@ return true;

};
GraphlibAdapter.prototype.getEdgeDataFrom = function (vertex) {
var _this = this;
var edges = this.g.outEdges(vertex);
if (edges === undefined) {
return util_1.EmptyIterator;
}
return util_1.createFilteredIterator(util_1.createMappedArrayIterator(edges, function (edge) { return _this.g.edge(edge.v, edge.w); }), function (data) { return data !== undefined; });
};
GraphlibAdapter.prototype.getEdgeDataTo = function (vertex) {
var _this = this;
var edges = this.g.inEdges(vertex);
if (edges === undefined) {
return util_1.EmptyIterator;
}
return util_1.createFilteredIterator(util_1.createMappedArrayIterator(edges, function (edge) { return _this.g.edge(edge.v, edge.w); }), function (data) { return data !== undefined; });
};
GraphlibAdapter.prototype.getEdgeData = function (from, to) {

@@ -247,2 +301,19 @@ return this.g.edge(from, to);

});
GraphlibAdapter.prototype.canAddEdge = function (from, to) {
if (this.g.hasEdge(from, to)) {
return false;
}
var didNotHaveFrom = this.addVertex(from);
var didNotHaveTo = this.addVertex(to);
if (!this.detector.canAddEdge(this.adapter, from, to)) {
if (didNotHaveFrom) {
this.deleteVertex(from);
}
if (didNotHaveTo) {
this.deleteVertex(to);
}
return false;
}
return true;
};
GraphlibAdapter.prototype.addEdge = function (from, to, data) {

@@ -327,2 +398,12 @@ if (this.g.hasEdge(from, to)) {

};
MultiGraphAdapter.prototype.canAddEdge = function (from, to, label) {
var srcData = this.g.getEdgeData(from, to);
if (srcData !== undefined) {
if (srcData.has(label)) {
return false;
}
return true;
}
return this.g.canAddEdge(from, to);
};
MultiGraphAdapter.prototype.addEdge = function (from, to, data, label) {

@@ -346,2 +427,14 @@ var srcData = this.g.getEdgeData(from, to);

};
MultiGraphAdapter.prototype.getEdgeDataTo = function (vertex, label) {
if (label === undefined) {
return util_1.createFilteredIterator(util_1.createFlatMappedIterator(this.g.getEdgeDataTo(vertex), function (data) { return data.values(); }), function (data) { return data !== undefined; });
}
return util_1.createMappedIterator(util_1.createFilteredIterator(util_1.createFlatMappedIterator(this.g.getEdgeDataTo(vertex), function (data) { return data.entries(); }), function (entry) { return entry[1] !== undefined && entry[0] === label; }), function (entry) { return entry[1]; });
};
MultiGraphAdapter.prototype.getEdgeDataFrom = function (vertex, label) {
if (label === undefined) {
return util_1.createFilteredIterator(util_1.createFlatMappedIterator(this.g.getEdgeDataFrom(vertex), function (data) { return data.values(); }), function (data) { return data !== undefined; });
}
return util_1.createMappedIterator(util_1.createFilteredIterator(util_1.createFlatMappedIterator(this.g.getEdgeDataFrom(vertex), function (data) { return data.entries(); }), function (entry) { return entry[1] !== undefined && entry[0] === label; }), function (entry) { return entry[1]; });
};
MultiGraphAdapter.prototype.contractEdge = function (from, to, vertexMerger, edgeMerger) {

@@ -957,4 +1050,4 @@ return this.g.contractEdge(from, to, vertexMerger, createMerger(edgeMerger));

while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {

@@ -961,0 +1054,0 @@ case 0: case 1: t = op; break;

2

dist/browser.min.js

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

(function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,b.IncrementalCycleDetect=a()}})(function(){var a;return function(){function b(d,e,g){function a(j,i){if(!e[j]){if(!d[j]){var f="function"==typeof require&&require;if(!i&&f)return f(j,!0);if(h)return h(j,!0);var c=new Error("Cannot find module '"+j+"'");throw c.code="MODULE_NOT_FOUND",c}var k=e[j]={exports:{}};d[j][0].call(k.exports,function(b){var c=d[j][1][b];return a(c||b)},k,k.exports,b,d,e,g)}return e[j].exports}for(var h="function"==typeof require&&require,c=0;c<g.length;c++)a(g[c]);return a}return b}()({1:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=a("tslib");d.__exportStar(a("./src/GraphlibAdapter"),c),d.__exportStar(a("./src/GenericGraphAdapter"),c),d.__exportStar(a("./src/MultiGraphAdapter"),c),d.__exportStar(a("./src/PearceKellyDetector"),c)},{"./src/GenericGraphAdapter":2,"./src/GraphlibAdapter":3,"./src/MultiGraphAdapter":4,"./src/PearceKellyDetector":5,tslib:7}],2:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=a("./PearceKellyDetector"),e=a("./util"),f=function(){function a(a){void 0===a&&(a={});var b=a.mapConstructor||Map;this.detector=a.cycleDetector||new d.PearceKellyDetector,this.forward=new b,this.backward=new b,this.mapConstructor=b,this.vertices=new b,this.edgeCount=0,this.adapter={getData:this.getData.bind(this),getPredecessorsOf:this.getPredecessorsOf.bind(this),getSuccessorsOf:this.getSuccessorsOf.bind(this)}}return a.prototype.canContractEdge=function(a,b){return e.canContractEdge(this,a,b)},a.prototype.contractEdge=function(a,b,c,d){return e.contractEdge(this,a,b,c,d)},a.prototype.isReachable=function(a,b){return this.detector.isReachable(this.adapter,a,b)},a.prototype.getSuccessorsOf=function(a){var b=this.forward.get(a);return void 0===b?e.EmptyIterator:b.keys()},a.prototype.getPredecessorsOf=function(a){var c=this.backward.get(a);return void 0===c?e.EmptyIterator:c.keys()},a.prototype.getVertices=function(){return this.vertices.keys()},a.prototype.getEdgeData=function(a,b){var c=this.forward.get(a);return c?c.get(b):void 0},a.prototype.setEdgeData=function(a,b,c){var d=this.forward.get(a);return!!(d&&d.has(b))&&(d.set(b,c),!0)},a.prototype.getEdges=function(){return e.createFlatMappedIterator(this.forward.entries(),function(a){return e.createMappedIterator(a[1].keys(),function(b){return[a[0],b]})})},a.prototype.getEdgeCount=function(){return this.edgeCount},a.prototype.supportsOrder=function(){return this.detector.supportsOrder()},a.prototype.getOrder=function(a){return this.detector.getOrder(this.adapter,a)},a.prototype.getVertexCount=function(){return this.vertices.size},a.prototype.hasEdge=function(a,b){var c=this.forward.get(a);return!!c&&c.has(b)},a.prototype.hasVertex=function(a){return this.vertices.has(a)},a.prototype.addEdge=function(a,c,d){var e=this.forward.get(a),g=this.backward.get(c),h=this.addVertex(a),i=this.addVertex(c);return(e||this.forward.set(a,e=new this.mapConstructor),g||this.backward.set(c,g=new this.mapConstructor),e.has(c)||!this.detector.canAddEdge(this.adapter,a,c))?(h&&this.deleteVertex(a),i&&this.deleteVertex(c),!1):(e.set(c,d),g.set(a,!0),this.edgeCount+=1,!0)},a.prototype.addVertex=function(a){return!this.vertices.has(a)&&(this.vertices.set(a,this.detector.createVertexData(this.adapter,a)),!0)},a.prototype.deleteEdge=function(a,c){var d=this.forward.get(a),e=this.backward.get(c);return!!(d&&e)&&!!(d.delete(c)&&e.delete(a))&&(this.edgeCount-=1,!0)},a.prototype.deleteVertex=function(a){if(!this.vertices.has(a))return!1;this.detector.onVertexDeletion(this.adapter,a);for(var b=this.getSuccessorsOf(a),c=b.next();!c.done;c=b.next())this.deleteEdge(a,c.value);for(var d=this.getPredecessorsOf(a),c=d.next();!c.done;c=d.next())this.deleteEdge(c.value,a);return this.vertices.delete(a),!0},a.prototype.getData=function(a){return this.vertices.get(a)},a}();c.GenericGraphAdapter=f},{"./PearceKellyDetector":5,"./util":6}],3:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=a("./PearceKellyDetector"),e=a("./util"),f=function(){function a(a){this.g=new a.graphlib(e.assign({directed:!0},a.graphOptions)),this.detector=a.cycleDetector||new d.PearceKellyDetector,this.adapter={getData:this.getData.bind(this),getPredecessorsOf:this.getPredecessorsOf.bind(this),getSuccessorsOf:this.getSuccessorsOf.bind(this)}}return a.prototype.canContractEdge=function(a,b){return e.canContractEdge(this,a,b)},a.prototype.contractEdge=function(a,b,c,d){return e.contractEdge(this,a,b,c,d)},a.prototype.isReachable=function(a,b){return this.detector.isReachable(this.adapter,a,b)},a.prototype.getSuccessorsOf=function(a){var b=this.g.successors(a);return b?e.createArrayIterator(b):e.EmptyIterator},a.prototype.getPredecessorsOf=function(a){var b=this.g.predecessors(a);return b?e.createArrayIterator(b):e.EmptyIterator},a.prototype.hasEdge=function(a,b){return this.g.hasEdge(a,b)},a.prototype.hasVertex=function(a){return this.g.hasNode(a)},a.prototype.getVertexCount=function(){return this.g.nodeCount()},a.prototype.getEdgeCount=function(){return this.g.edgeCount()},a.prototype.getVertexData=function(a){return this.g.node(a)},a.prototype.getEdgeData=function(a,b){return this.g.edge(a,b)},a.prototype.setEdgeData=function(a,b,c){return!!this.g.hasEdge(a,b)&&(this.g.setEdge(a,b,c),!0)},a.prototype.getVertices=function(){return e.createArrayIterator(this.g.nodes())},a.prototype.getEdges=function(){return e.createMappedArrayIterator(this.g.edges(),function(a){return[a.v,a.w]})},a.prototype.supportsOrder=function(){return this.detector.supportsOrder()},a.prototype.getOrder=function(a){return this.detector.getOrder(this.adapter,a)},Object.defineProperty(a.prototype,"graph",{get:function(){return this.g},enumerable:!0,configurable:!0}),a.prototype.addEdge=function(a,b,c){if(this.g.hasEdge(a,b))return!1;var d=this.addVertex(a),e=this.addVertex(b);return this.detector.canAddEdge(this.adapter,a,b)?(this.g.setEdge(a,b,c),!0):(d&&this.deleteVertex(a),e&&this.deleteVertex(b),!1)},a.prototype.addVertex=function(a,b){if(this.hasVertex(a))return!1;var c=this.detector.createVertexData(this.adapter,a);return this.g.setNode(a,void 0===b?c:e.assign(c,b)),!0},a.prototype.deleteEdge=function(a,b,c){return!!this.g.hasEdge(a,b,c)&&(this.g.removeEdge(a,b),!0)},a.prototype.deleteVertex=function(a){return!!this.g.hasNode(a)&&(this.detector.onVertexDeletion(this.adapter,a),this.g.removeNode(a),!0)},a.prototype.getData=function(a){return this.g.node(a)},a}();c.GraphlibAdapter=f},{"./PearceKellyDetector":5,"./util":6}],4:[function(a,b,c){"use strict";function d(a){return void 0===a&&(a=f.takeFirst),function(b,c){if(void 0===b)return c;if(void 0===c)return b;for(var d,e=c.entries(),f=e.next();!f.done;f=e.next())d=b.get(f.value[0]),d=void 0===d?f.value[1]:a(d,f.value[1]),b.set(f.value[0],d);return b}}Object.defineProperty(c,"__esModule",{value:!0});var e=a("./GenericGraphAdapter"),f=a("./util"),g=function(){function a(a){void 0===a&&(a={}),this.g=new e.GenericGraphAdapter(a),this.edgeCount=0}return a.prototype.addLabeledEdge=function(a,b,c,d){return this.addEdge(a,b,d,c)},a.prototype.addEdge=function(a,b,c,d){var e=this.g.getEdgeData(a,b);if(void 0!==e)return!e.has(d)&&(e.set(d,c),this.edgeCount+=1,!0);this.edgeCount+=1;var f=new Map;return f.set(d,c),this.g.addEdge(a,b,f)},a.prototype.addVertex=function(a){return this.g.addVertex(a)},a.prototype.contractEdge=function(a,b,c,e){return this.g.contractEdge(a,b,c,d(e))},a.prototype.canContractEdge=function(a,b){return this.g.canContractEdge(a,b)},a.prototype.deleteEdge=function(a,b,c){if(void 0===c)return this.edgeCount-=this.getEdgeCountBetween(a,b),this.g.deleteEdge(a,b);var d=this.g.getEdgeData(a,b);if(void 0===d)return!1;var e=d.delete(c);return e&&(this.edgeCount-=1),0===d.size&&this.g.deleteEdge(a,b),e},a.prototype.deleteVertex=function(a){return this.g.deleteVertex(a)},a.prototype.getLabeledEdgeCount=function(){return this.edgeCount},a.prototype.getEdgeCount=function(){return this.g.getEdgeCount()},a.prototype.getEdgeData=function(a,b,c){var d=this.g.getEdgeData(a,b);return void 0===d?void 0:d.get(c)},a.prototype.setEdgeData=function(a,b,c,e){var f=this.g.getEdgeData(a,b);return!!(void 0!==f&&f.has(e))&&(f.set(e,c),!0)},a.prototype.getEdges=function(){return this.g.getEdges()},a.prototype.getEdgeCountBetween=function(a,b){var c=this.g.getEdgeData(a,b);return void 0===c?0:c.size},a.prototype.getEdgeLabels=function(a,b){var c=this.g.getEdgeData(a,b);return void 0===c?f.EmptyIterator:c.keys()},a.prototype.getLabeledEdges=function(){var a=this;return f.createFlatMappedIterator(this.g.getEdges(),function(b){var c=a.g.getEdgeData(b[0],b[1]);return void 0===c?f.EmptyIterator:f.createMappedIterator(c.keys(),function(a){return[b[0],b[1],a]})})},a.prototype.getPredecessorsOf=function(a,b){var c=this;return void 0===b?this.g.getPredecessorsOf(a):f.createFilteredIterator(this.g.getPredecessorsOf(a),function(d){var e=c.g.getEdgeData(d,a);return void 0!==e&&e.has(b)})},a.prototype.getSuccessorsOf=function(a,b){var c=this;return void 0===b?this.g.getSuccessorsOf(a):f.createFilteredIterator(this.g.getSuccessorsOf(a),function(d){var e=c.g.getEdgeData(a,d);return void 0!==e&&e.has(b)})},a.prototype.getOrder=function(a){return this.g.getOrder(a)},a.prototype.supportsOrder=function(){return this.g.supportsOrder()},a.prototype.getVertexCount=function(){return this.g.getVertexCount()},a.prototype.getVertices=function(){return this.g.getVertices()},a.prototype.hasEdge=function(a,b,c){var d=this.g.getEdgeData(a,b);return void 0!==d&&(void 0===c||d.has(c))},a.prototype.hasLabeledEdge=function(a,b,c){var d=this.g.getEdgeData(a,b);return void 0!==d&&d.has(c)},a.prototype.hasVertex=function(a){return this.g.hasVertex(a)},a.prototype.isReachable=function(a,b){return this.g.isReachable(a,b)},a}();c.MultiGraphAdapter=g},{"./GenericGraphAdapter":2,"./util":6}],5:[function(a,b,c){"use strict";function d(a,b,c){for(var d=[],e=b.length,f=c.length,g=0,h=0;g<e&&h<f;){var i=a.getData(b[g]).order,j=a.getData(c[h]).order;i<j?(g+=1,d.push(i)):(h+=1,d.push(j))}for(;g<e;){var i=a.getData(b[g]);g+=1,d.push(i.order)}for(;h<f;){var j=a.getData(c[h]);h+=1,d.push(j.order)}return d}function e(a,b){return b.map(function(b){return{key:a.getData(b).order,val:b}}).sort(function(a,b){return a.key-b.key}).map(function(a){return a.val})}Object.defineProperty(c,"__esModule",{value:!0});var f=function(){function a(){this.id=0,this.stack=[],this.deltaXyB=[],this.deltaXyF=[],this.freeStack=[]}return a.prototype.isReachable=function(a,b,c){if(b===c)return!0;var d=a.getData(c).order;if(a.getData(b).order>d)return!1;var e=!this.dfs_f(b,a,d);return this.cleanAfterCycle(a),e},a.prototype.createVertexData=function(){var a=this.freeStack.pop();return{order:void 0===a?this.id++:a,visited:!1}},a.prototype.onVertexDeletion=function(a,b){var c=a.getData(b);this.freeStack.push(c.order)},a.prototype.canAddEdge=function(a,b,c){return b!==c&&this.checkCycle(a,b,c)},a.prototype.supportsOrder=function(){return!0},a.prototype.getOrder=function(a,b){return a.getData(b).order},a.prototype.checkCycle=function(a,b,c){var d=a.getData(c).order,e=a.getData(b).order;if(this.deltaXyB=[],this.deltaXyF=[],d<e){if(!this.dfs_f(c,a,e))return this.cleanAfterCycle(a),!1;this.dfs_b(b,a,d),this.reorder(a)}return!0},a.prototype.cleanAfterCycle=function(a){this.stack=[];for(var b=this.deltaXyF.pop();void 0!==b;b=this.deltaXyF.pop())a.getData(b).visited=!1},a.prototype.dfs_f=function(a,b,c){for(this.stack.push(a);0<this.stack.length;){var d=this.stack.pop(),e=b.getData(d);if(!e.visited){e.visited=!0,this.deltaXyF.push(d);for(var f,g=b.getSuccessorsOf(d),h=g.next();!h.done;h=g.next()){if(f=b.getData(h.value),f.order===c)return!1;!f.visited&&f.order<c&&this.stack.push(h.value)}}}return!0},a.prototype.dfs_b=function(a,b,c){for(this.stack.push(a);0<this.stack.length;){var d=this.stack.pop(),e=b.getData(d);if(!e.visited){e.visited=!0,this.deltaXyB.push(d);for(var f,g=b.getPredecessorsOf(d),h=g.next();!h.done;h=g.next())f=b.getData(h.value),!f.visited&&c<f.order&&this.stack.push(h.value)}}},a.prototype.reorder=function(a){this.deltaXyB=e(a,this.deltaXyB),this.deltaXyF=e(a,this.deltaXyF);for(var b,c=this.deltaXyB.concat(this.deltaXyF),f=0,g=c;f<g.length;f++)b=g[f],a.getData(b).visited=!1;for(var h=d(a,this.deltaXyB,this.deltaXyF),k=0,l=c.length;k<l;++k)a.getData(c[k]).order=h[k]},a}();c.PearceKellyDetector=f},{}],6:[function(a,b,c){"use strict";function d(a){return a}function e(a,b,c,e,f){void 0===e&&(e=d);var g=[],h=[];if(f!==b){for(var i,j=a.getSuccessorsOf(b),k=j.next();!k.done;k=j.next())i=a.getEdgeData(b,k.value),a.deleteEdge(b,k.value),g.push([k.value,i]);for(var i,l=a.getPredecessorsOf(b),k=l.next();!k.done;k=l.next())i=a.getEdgeData(k.value,b),a.deleteEdge(k.value,b),h.push([k.value,i])}if(f!==c){for(var i,m=a.getSuccessorsOf(c),k=m.next();!k.done;k=m.next())i=a.getEdgeData(c,k.value),a.deleteEdge(c,k.value),g.push([k.value,i]);for(var i,n=a.getPredecessorsOf(c),k=n.next();!k.done;k=n.next())i=a.getEdgeData(k.value,c),a.deleteEdge(k.value,c),h.push([k.value,i])}f!==b&&f!==c&&a.addVertex(f);for(var o=0,p=g;o<p.length;o++){var q=p[o],i=a.getEdgeData(f,q[0]);i===void 0?a.addEdge(f,q[0],q[1]):a.setEdgeData(f,q[0],e(i,q[1]))}for(var r=0,s=h;r<s.length;r++){var q=s[r],i=a.getEdgeData(q[0],f);i===void 0?a.addEdge(q[0],f,q[1]):a.setEdgeData(q[0],f,e(i,q[1]))}f!==c&&a.deleteVertex(c),f!==b&&a.deleteVertex(b)}Object.defineProperty(c,"__esModule",{value:!0}),c.takeFirst=d,c.DoneIteratorResult={done:!0,value:void 0},c.EmptyIterator={next:function(){return c.DoneIteratorResult}};var f=Object.prototype.hasOwnProperty;c.assign=function(a,b){for(var c in b)f.call(b,c)&&(a[c]=b[c]);return a},c.toArray=function(a){for(var b=[],c=a.next();!c.done;c=a.next())b.push(c.value);return b},c.createMappedIterator=function(a,b){return{next:function(){var d=a.next();return d.done?c.DoneIteratorResult:{done:!1,value:b(d.value)}}}},c.createFilteredIterator=function(a,b){return{next:function(){for(var c=a.next();!c.done&&!b(c.value);)c=a.next();return c}}},c.createFlatMappedIterator=function(a,b){var d=c.EmptyIterator;return{next:function(){for(var e=d.next();e.done;){var f=a.next();if(f.done)return c.DoneIteratorResult;d=b(f.value),e=d.next()}return{done:!1,value:e.value}}}},c.createArrayIterator=function(a){var b=0;return{array:a,next:function(){for(;a[b]===void 0;){if(b>a.length)return c.DoneIteratorResult;b+=1}return{done:!1,value:a[b++]}}}},c.createMappedArrayIterator=function(a,b){var d=0;return{next:function(){for(;a[d]===void 0;){if(d>a.length)return c.DoneIteratorResult;d+=1}return{done:!1,value:b(a[d++])}}}},c.canContractEdge=function(a,b,c){if(!a.hasEdge(b,c))return!1;var d=a.getEdgeData(b,c);a.deleteEdge(b,c);var e=!a.isReachable(b,c);return a.addEdge(b,c,d),e},c.contractEdge=function(a,b,c,f,g){if(void 0===f&&(f=d),!a.hasEdge(b,c))return!1;var h=a.getEdgeData(b,c);if(a.deleteEdge(b,c),a.isReachable(b,c))return a.addEdge(b,c,h),!1;var i=f(b,c);if(i!==b&&i!==c&&a.hasVertex(i))throw a.addEdge(b,c,h),new Error("Cannot use existing vertex for edge contraction: "+i);return e(a,b,c,g,i),!0}},{}],7:[function(b,c){(function(b){var d,e,f,g,h,i,j,k,l,n,m,o,s,p,q,r,t,u,v;(function(d){function e(a,b){return a!==f&&("function"==typeof Object.create?Object.defineProperty(a,"__esModule",{value:!0}):a.__esModule=!0),function(c,d){return a[c]=b?b(c,d):d}}var f="object"==typeof b?b:"object"==typeof self?self:"object"==typeof this?this:{};"function"==typeof a&&a.amd?a("tslib",["exports"],function(a){d(e(f,e(a)))}):"object"==typeof c&&"object"==typeof c.exports?d(e(f,e(c.exports))):d(e(f))})(function(a){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b])};d=function(a,d){function b(){this.constructor=a}c(a,d),a.prototype=null===d?Object.create(d):(b.prototype=d.prototype,new b)},e=Object.assign||function(a){for(var b,c=1,d=arguments.length;c<d;c++)for(var e in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,e)&&(a[e]=b[e]);return a},f=function(a,b){var c={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&0>b.indexOf(d)&&(c[d]=a[d]);if(null!=a&&"function"==typeof Object.getOwnPropertySymbols)for(var e=0,d=Object.getOwnPropertySymbols(a);e<d.length;e++)0>b.indexOf(d[e])&&(c[d[e]]=a[d[e]]);return c},g=function(a,b,e,f){var g,h=arguments.length,c=3>h?b:null===f?f=Object.getOwnPropertyDescriptor(b,e):f;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(a,b,e,f);else for(var j=a.length-1;0<=j;j--)(g=a[j])&&(c=(3>h?g(c):3<h?g(b,e,c):g(b,e))||c);return 3<h&&c&&Object.defineProperty(b,e,c),c},h=function(a,b){return function(c,d){b(c,d,a)}},i=function(a,b){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(a,b)},j=function(a,b,c,d){return new(c||(c=Promise))(function(e,f){function g(a){try{i(d.next(a))}catch(a){f(a)}}function h(a){try{i(d["throw"](a))}catch(a){f(a)}}function i(a){a.done?e(a.value):new c(function(b){b(a.value)}).then(g,h)}i((d=d.apply(a,b||[])).next())})},k=function(a,b){function c(a){return function(b){return d([a,b])}}function d(c){if(e)throw new TypeError("Generator is already executing.");for(;k;)try{if(e=1,h&&(i=h[2&c[0]?"return":c[0]?"throw":"next"])&&!(i=i.call(h,c[1])).done)return i;switch((h=0,i)&&(c=[0,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return k.label++,{value:c[1],done:!1};case 5:k.label++,h=c[1],c=[0];continue;case 7:c=k.ops.pop(),k.trys.pop();continue;default:if((i=k.trys,!(i=0<i.length&&i[i.length-1]))&&(6===c[0]||2===c[0])){k=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){k.label=c[1];break}if(6===c[0]&&k.label<i[1]){k.label=i[1],i=c;break}if(i&&k.label<i[2]){k.label=i[2],k.ops.push(c);break}i[2]&&k.ops.pop(),k.trys.pop();continue;}c=b.call(a,k)}catch(a){c=[6,a],h=0}finally{e=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}var e,h,i,j,k={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return j={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(j[Symbol.iterator]=function(){return this}),j},l=function(a,b){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])},n=function(a){var b="function"==typeof Symbol&&a[Symbol.iterator],c=0;return b?b.call(a):{next:function(){return a&&c>=a.length&&(a=void 0),{value:a&&a[c++],done:!a}}}},m=function(a,b){var c="function"==typeof Symbol&&a[Symbol.iterator];if(!c)return a;var d,f,g=c.call(a),h=[];try{for(;(void 0===b||0<b--)&&!(d=g.next()).done;)h.push(d.value)}catch(a){f={error:a}}finally{try{d&&!d.done&&(c=g["return"])&&c.call(g)}finally{if(f)throw f.error}}return h},o=function(){for(var a=[],b=0;b<arguments.length;b++)a=a.concat(m(arguments[b]));return a},s=function(a){return this instanceof s?(this.v=a,this):new s(a)},p=function(a,b,c){function d(c){m[c]&&(l[c]=function(d){return new Promise(function(f,a){1<g.push([c,d,f,a])||e(c,d)})})}function e(a,b){try{f(m[a](b))}catch(a){k(g[0][3],a)}}function f(a){a.value instanceof s?Promise.resolve(a.value.v).then(h,j):k(g[0][2],a)}function h(a){e("next",a)}function j(a){e("throw",a)}function k(a,b){(a(b),g.shift(),g.length)&&e(g[0][0],g[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var l,m=c.apply(a,b||[]),g=[];return l={},d("next"),d("throw"),d("return"),l[Symbol.asyncIterator]=function(){return this},l},q=function(a){function b(b,e){c[b]=a[b]?function(c){return(d=!d)?{value:s(a[b](c)),done:"return"===b}:e?e(c):c}:e}var c,d;return c={},b("next"),b("throw",function(a){throw a}),b("return"),c[Symbol.iterator]=function(){return this},c},r=function(a){function b(b){d[b]=a[b]&&function(d){return new Promise(function(e,f){d=a[b](d),c(e,f,d.done,d.value)})}}function c(a,b,c,d){Promise.resolve(d).then(function(b){a({value:b,done:c})},b)}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var d,e=a[Symbol.asyncIterator];return e?e.call(a):(a="function"==typeof n?n(a):a[Symbol.iterator](),d={},b("next"),b("throw"),b("return"),d[Symbol.asyncIterator]=function(){return this},d)},t=function(a,b){return Object.defineProperty?Object.defineProperty(a,"raw",{value:b}):a.raw=b,a},u=function(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b},v=function(a){return a&&a.__esModule?a:{default:a}},a("__extends",d),a("__assign",e),a("__rest",f),a("__decorate",g),a("__param",h),a("__metadata",i),a("__awaiter",j),a("__generator",k),a("__exportStar",l),a("__values",n),a("__read",m),a("__spread",o),a("__await",s),a("__asyncGenerator",p),a("__asyncDelegator",q),a("__asyncValues",r),a("__makeTemplateObject",t),a("__importStar",u),a("__importDefault",v)})}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{}]},{},[1])(1)});
(function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,b.IncrementalCycleDetect=a()}})(function(){var a;return function(){function b(d,e,g){function a(j,i){if(!e[j]){if(!d[j]){var f="function"==typeof require&&require;if(!i&&f)return f(j,!0);if(h)return h(j,!0);var c=new Error("Cannot find module '"+j+"'");throw c.code="MODULE_NOT_FOUND",c}var k=e[j]={exports:{}};d[j][0].call(k.exports,function(b){var c=d[j][1][b];return a(c||b)},k,k.exports,b,d,e,g)}return e[j].exports}for(var h="function"==typeof require&&require,c=0;c<g.length;c++)a(g[c]);return a}return b}()({1:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=a("tslib");d.__exportStar(a("./src/GraphlibAdapter"),c),d.__exportStar(a("./src/GenericGraphAdapter"),c),d.__exportStar(a("./src/MultiGraphAdapter"),c),d.__exportStar(a("./src/PearceKellyDetector"),c)},{"./src/GenericGraphAdapter":2,"./src/GraphlibAdapter":3,"./src/MultiGraphAdapter":4,"./src/PearceKellyDetector":5,tslib:7}],2:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=a("./PearceKellyDetector"),e=a("./util"),f=function(){function a(a){void 0===a&&(a={});var b=a.mapConstructor||Map;this.detector=a.cycleDetector||new d.PearceKellyDetector,this.forward=new b,this.backward=new b,this.mapConstructor=b,this.vertices=new b,this.edgeCount=0,this.adapter={getData:this.getData.bind(this),getPredecessorsOf:this.getPredecessorsOf.bind(this),getSuccessorsOf:this.getSuccessorsOf.bind(this)}}return a.prototype.canContractEdge=function(a,b){return e.canContractEdge(this,a,b)},a.prototype.contractEdge=function(a,b,c,d){return e.contractEdge(this,a,b,c,d)},a.prototype.isReachable=function(a,b){return this.detector.isReachable(this.adapter,a,b)},a.prototype.getSuccessorsOf=function(a){var b=this.forward.get(a);return void 0===b?e.EmptyIterator:b.keys()},a.prototype.getPredecessorsOf=function(a){var c=this.backward.get(a);return void 0===c?e.EmptyIterator:c.keys()},a.prototype.getVertices=function(){return this.vertices.keys()},a.prototype.getEdgeData=function(a,b){var c=this.forward.get(a);return c?c.get(b):void 0},a.prototype.getEdgeDataTo=function(a){var c=this.backward.get(a);return void 0===c?e.EmptyIterator:e.createFilteredIterator(c.values(),function(a){return void 0!==a})},a.prototype.getEdgeDataFrom=function(a){var b=this.forward.get(a);return void 0===b?e.EmptyIterator:e.createFilteredIterator(b.values(),function(a){return void 0!==a})},a.prototype.setEdgeData=function(a,c,d){var e=this.forward.get(a),f=this.backward.get(c);return!!(e&&f&&e.has(c)&&f.has(a))&&(e.set(c,d),f.set(a,d),!0)},a.prototype.getEdges=function(){return e.createFlatMappedIterator(this.forward.entries(),function(a){return e.createMappedIterator(a[1].keys(),function(b){return[a[0],b]})})},a.prototype.getEdgeCount=function(){return this.edgeCount},a.prototype.supportsOrder=function(){return this.detector.supportsOrder()},a.prototype.getOrder=function(a){return this.detector.getOrder(this.adapter,a)},a.prototype.getVertexCount=function(){return this.vertices.size},a.prototype.hasEdge=function(a,b){var c=this.forward.get(a);return!!c&&c.has(b)},a.prototype.hasVertex=function(a){return this.vertices.has(a)},a.prototype.canAddEdge=function(a,c){var d=this.forward.get(a),e=this.backward.get(c),g=this.addVertex(a),h=this.addVertex(c);return d||this.forward.set(a,d=new this.mapConstructor),e||this.backward.set(c,e=new this.mapConstructor),!d.has(c)&&this.detector.canAddEdge(this.adapter,a,c)||(g&&this.deleteVertex(a),h&&this.deleteVertex(c),!1)},a.prototype.addEdge=function(a,c,d){var e=this.forward.get(a),g=this.backward.get(c),h=this.addVertex(a),i=this.addVertex(c);return(e||this.forward.set(a,e=new this.mapConstructor),g||this.backward.set(c,g=new this.mapConstructor),e.has(c)||!this.detector.canAddEdge(this.adapter,a,c))?(h&&this.deleteVertex(a),i&&this.deleteVertex(c),!1):(e.set(c,d),g.set(a,d),this.edgeCount+=1,!0)},a.prototype.addVertex=function(a){return!this.vertices.has(a)&&(this.vertices.set(a,this.detector.createVertexData(this.adapter,a)),!0)},a.prototype.deleteEdge=function(a,c){var d=this.forward.get(a),e=this.backward.get(c);return!!(d&&e)&&!!(d.delete(c)&&e.delete(a))&&(this.edgeCount-=1,!0)},a.prototype.deleteVertex=function(a){if(!this.vertices.has(a))return!1;this.detector.onVertexDeletion(this.adapter,a);for(var b=this.getSuccessorsOf(a),c=b.next();!c.done;c=b.next())this.deleteEdge(a,c.value);for(var d=this.getPredecessorsOf(a),c=d.next();!c.done;c=d.next())this.deleteEdge(c.value,a);return this.vertices.delete(a),!0},a.prototype.getData=function(a){return this.vertices.get(a)},a}();c.GenericGraphAdapter=f},{"./PearceKellyDetector":5,"./util":6}],3:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=a("./PearceKellyDetector"),e=a("./util"),f=function(){function a(a){this.g=new a.graphlib(e.assign({directed:!0},a.graphOptions)),this.detector=a.cycleDetector||new d.PearceKellyDetector,this.adapter={getData:this.getData.bind(this),getPredecessorsOf:this.getPredecessorsOf.bind(this),getSuccessorsOf:this.getSuccessorsOf.bind(this)}}return a.prototype.canContractEdge=function(a,b){return e.canContractEdge(this,a,b)},a.prototype.contractEdge=function(a,b,c,d){return e.contractEdge(this,a,b,c,d)},a.prototype.isReachable=function(a,b){return this.detector.isReachable(this.adapter,a,b)},a.prototype.getSuccessorsOf=function(a){var b=this.g.successors(a);return b?e.createArrayIterator(b):e.EmptyIterator},a.prototype.getPredecessorsOf=function(a){var b=this.g.predecessors(a);return b?e.createArrayIterator(b):e.EmptyIterator},a.prototype.hasEdge=function(a,b){return this.g.hasEdge(a,b)},a.prototype.hasVertex=function(a){return this.g.hasNode(a)},a.prototype.getVertexCount=function(){return this.g.nodeCount()},a.prototype.getEdgeCount=function(){return this.g.edgeCount()},a.prototype.getVertexData=function(a){return this.g.node(a)},a.prototype.getEdgeDataFrom=function(a){var b=this,c=this.g.outEdges(a);return void 0===c?e.EmptyIterator:e.createFilteredIterator(e.createMappedArrayIterator(c,function(a){return b.g.edge(a.v,a.w)}),function(a){return void 0!==a})},a.prototype.getEdgeDataTo=function(a){var b=this,c=this.g.inEdges(a);return void 0===c?e.EmptyIterator:e.createFilteredIterator(e.createMappedArrayIterator(c,function(a){return b.g.edge(a.v,a.w)}),function(a){return void 0!==a})},a.prototype.getEdgeData=function(a,b){return this.g.edge(a,b)},a.prototype.setEdgeData=function(a,b,c){return!!this.g.hasEdge(a,b)&&(this.g.setEdge(a,b,c),!0)},a.prototype.getVertices=function(){return e.createArrayIterator(this.g.nodes())},a.prototype.getEdges=function(){return e.createMappedArrayIterator(this.g.edges(),function(a){return[a.v,a.w]})},a.prototype.supportsOrder=function(){return this.detector.supportsOrder()},a.prototype.getOrder=function(a){return this.detector.getOrder(this.adapter,a)},Object.defineProperty(a.prototype,"graph",{get:function(){return this.g},enumerable:!0,configurable:!0}),a.prototype.canAddEdge=function(a,b){if(this.g.hasEdge(a,b))return!1;var c=this.addVertex(a),d=this.addVertex(b);return!!this.detector.canAddEdge(this.adapter,a,b)||(c&&this.deleteVertex(a),d&&this.deleteVertex(b),!1)},a.prototype.addEdge=function(a,b,c){if(this.g.hasEdge(a,b))return!1;var d=this.addVertex(a),e=this.addVertex(b);return this.detector.canAddEdge(this.adapter,a,b)?(this.g.setEdge(a,b,c),!0):(d&&this.deleteVertex(a),e&&this.deleteVertex(b),!1)},a.prototype.addVertex=function(a,b){if(this.hasVertex(a))return!1;var c=this.detector.createVertexData(this.adapter,a);return this.g.setNode(a,void 0===b?c:e.assign(c,b)),!0},a.prototype.deleteEdge=function(a,b,c){return!!this.g.hasEdge(a,b,c)&&(this.g.removeEdge(a,b),!0)},a.prototype.deleteVertex=function(a){return!!this.g.hasNode(a)&&(this.detector.onVertexDeletion(this.adapter,a),this.g.removeNode(a),!0)},a.prototype.getData=function(a){return this.g.node(a)},a}();c.GraphlibAdapter=f},{"./PearceKellyDetector":5,"./util":6}],4:[function(a,b,c){"use strict";function d(a){return void 0===a&&(a=f.takeFirst),function(b,c){if(void 0===b)return c;if(void 0===c)return b;for(var d,e=c.entries(),f=e.next();!f.done;f=e.next())d=b.get(f.value[0]),d=void 0===d?f.value[1]:a(d,f.value[1]),b.set(f.value[0],d);return b}}Object.defineProperty(c,"__esModule",{value:!0});var e=a("./GenericGraphAdapter"),f=a("./util"),g=function(){function a(a){void 0===a&&(a={}),this.g=new e.GenericGraphAdapter(a),this.edgeCount=0}return a.prototype.addLabeledEdge=function(a,b,c,d){return this.addEdge(a,b,d,c)},a.prototype.canAddEdge=function(a,b,c){var d=this.g.getEdgeData(a,b);return void 0===d?this.g.canAddEdge(a,b):!d.has(c)},a.prototype.addEdge=function(a,b,c,d){var e=this.g.getEdgeData(a,b);if(void 0!==e)return!e.has(d)&&(e.set(d,c),this.edgeCount+=1,!0);this.edgeCount+=1;var f=new Map;return f.set(d,c),this.g.addEdge(a,b,f)},a.prototype.addVertex=function(a){return this.g.addVertex(a)},a.prototype.getEdgeDataTo=function(a,b){return void 0===b?f.createFilteredIterator(f.createFlatMappedIterator(this.g.getEdgeDataTo(a),function(a){return a.values()}),function(a){return void 0!==a}):f.createMappedIterator(f.createFilteredIterator(f.createFlatMappedIterator(this.g.getEdgeDataTo(a),function(a){return a.entries()}),function(a){return void 0!==a[1]&&a[0]===b}),function(a){return a[1]})},a.prototype.getEdgeDataFrom=function(a,b){return void 0===b?f.createFilteredIterator(f.createFlatMappedIterator(this.g.getEdgeDataFrom(a),function(a){return a.values()}),function(a){return void 0!==a}):f.createMappedIterator(f.createFilteredIterator(f.createFlatMappedIterator(this.g.getEdgeDataFrom(a),function(a){return a.entries()}),function(a){return void 0!==a[1]&&a[0]===b}),function(a){return a[1]})},a.prototype.contractEdge=function(a,b,c,e){return this.g.contractEdge(a,b,c,d(e))},a.prototype.canContractEdge=function(a,b){return this.g.canContractEdge(a,b)},a.prototype.deleteEdge=function(a,b,c){if(void 0===c)return this.edgeCount-=this.getEdgeCountBetween(a,b),this.g.deleteEdge(a,b);var d=this.g.getEdgeData(a,b);if(void 0===d)return!1;var e=d.delete(c);return e&&(this.edgeCount-=1),0===d.size&&this.g.deleteEdge(a,b),e},a.prototype.deleteVertex=function(a){return this.g.deleteVertex(a)},a.prototype.getLabeledEdgeCount=function(){return this.edgeCount},a.prototype.getEdgeCount=function(){return this.g.getEdgeCount()},a.prototype.getEdgeData=function(a,b,c){var d=this.g.getEdgeData(a,b);return void 0===d?void 0:d.get(c)},a.prototype.setEdgeData=function(a,b,c,e){var f=this.g.getEdgeData(a,b);return!!(void 0!==f&&f.has(e))&&(f.set(e,c),!0)},a.prototype.getEdges=function(){return this.g.getEdges()},a.prototype.getEdgeCountBetween=function(a,b){var c=this.g.getEdgeData(a,b);return void 0===c?0:c.size},a.prototype.getEdgeLabels=function(a,b){var c=this.g.getEdgeData(a,b);return void 0===c?f.EmptyIterator:c.keys()},a.prototype.getLabeledEdges=function(){var a=this;return f.createFlatMappedIterator(this.g.getEdges(),function(b){var c=a.g.getEdgeData(b[0],b[1]);return void 0===c?f.EmptyIterator:f.createMappedIterator(c.keys(),function(a){return[b[0],b[1],a]})})},a.prototype.getPredecessorsOf=function(a,b){var c=this;return void 0===b?this.g.getPredecessorsOf(a):f.createFilteredIterator(this.g.getPredecessorsOf(a),function(d){var e=c.g.getEdgeData(d,a);return void 0!==e&&e.has(b)})},a.prototype.getSuccessorsOf=function(a,b){var c=this;return void 0===b?this.g.getSuccessorsOf(a):f.createFilteredIterator(this.g.getSuccessorsOf(a),function(d){var e=c.g.getEdgeData(a,d);return void 0!==e&&e.has(b)})},a.prototype.getOrder=function(a){return this.g.getOrder(a)},a.prototype.supportsOrder=function(){return this.g.supportsOrder()},a.prototype.getVertexCount=function(){return this.g.getVertexCount()},a.prototype.getVertices=function(){return this.g.getVertices()},a.prototype.hasEdge=function(a,b,c){var d=this.g.getEdgeData(a,b);return void 0!==d&&(void 0===c||d.has(c))},a.prototype.hasLabeledEdge=function(a,b,c){var d=this.g.getEdgeData(a,b);return void 0!==d&&d.has(c)},a.prototype.hasVertex=function(a){return this.g.hasVertex(a)},a.prototype.isReachable=function(a,b){return this.g.isReachable(a,b)},a}();c.MultiGraphAdapter=g},{"./GenericGraphAdapter":2,"./util":6}],5:[function(a,b,c){"use strict";function d(a,b,c){for(var d=[],e=b.length,f=c.length,g=0,h=0;g<e&&h<f;){var i=a.getData(b[g]).order,j=a.getData(c[h]).order;i<j?(g+=1,d.push(i)):(h+=1,d.push(j))}for(;g<e;){var i=a.getData(b[g]);g+=1,d.push(i.order)}for(;h<f;){var j=a.getData(c[h]);h+=1,d.push(j.order)}return d}function e(a,b){return b.map(function(b){return{key:a.getData(b).order,val:b}}).sort(function(a,b){return a.key-b.key}).map(function(a){return a.val})}Object.defineProperty(c,"__esModule",{value:!0});var f=function(){function a(){this.id=0,this.stack=[],this.deltaXyB=[],this.deltaXyF=[],this.freeStack=[]}return a.prototype.isReachable=function(a,b,c){if(b===c)return!0;var d=a.getData(c).order;if(a.getData(b).order>d)return!1;var e=!this.dfs_f(b,a,d);return this.cleanAfterCycle(a),e},a.prototype.createVertexData=function(){var a=this.freeStack.pop();return{order:void 0===a?this.id++:a,visited:!1}},a.prototype.onVertexDeletion=function(a,b){var c=a.getData(b);this.freeStack.push(c.order)},a.prototype.canAddEdge=function(a,b,c){return b!==c&&this.checkCycle(a,b,c)},a.prototype.supportsOrder=function(){return!0},a.prototype.getOrder=function(a,b){return a.getData(b).order},a.prototype.checkCycle=function(a,b,c){var d=a.getData(c).order,e=a.getData(b).order;if(this.deltaXyB=[],this.deltaXyF=[],d<e){if(!this.dfs_f(c,a,e))return this.cleanAfterCycle(a),!1;this.dfs_b(b,a,d),this.reorder(a)}return!0},a.prototype.cleanAfterCycle=function(a){this.stack=[];for(var b=this.deltaXyF.pop();void 0!==b;b=this.deltaXyF.pop())a.getData(b).visited=!1},a.prototype.dfs_f=function(a,b,c){for(this.stack.push(a);0<this.stack.length;){var d=this.stack.pop(),e=b.getData(d);if(!e.visited){e.visited=!0,this.deltaXyF.push(d);for(var f,g=b.getSuccessorsOf(d),h=g.next();!h.done;h=g.next()){if(f=b.getData(h.value),f.order===c)return!1;!f.visited&&f.order<c&&this.stack.push(h.value)}}}return!0},a.prototype.dfs_b=function(a,b,c){for(this.stack.push(a);0<this.stack.length;){var d=this.stack.pop(),e=b.getData(d);if(!e.visited){e.visited=!0,this.deltaXyB.push(d);for(var f,g=b.getPredecessorsOf(d),h=g.next();!h.done;h=g.next())f=b.getData(h.value),!f.visited&&c<f.order&&this.stack.push(h.value)}}},a.prototype.reorder=function(a){this.deltaXyB=e(a,this.deltaXyB),this.deltaXyF=e(a,this.deltaXyF);for(var b,c=this.deltaXyB.concat(this.deltaXyF),f=0,g=c;f<g.length;f++)b=g[f],a.getData(b).visited=!1;for(var h=d(a,this.deltaXyB,this.deltaXyF),k=0,l=c.length;k<l;++k)a.getData(c[k]).order=h[k]},a}();c.PearceKellyDetector=f},{}],6:[function(a,b,c){"use strict";function d(a){return a}function e(a,b,c,e,f){void 0===e&&(e=d);var g=[],h=[];if(f!==b){for(var i,j=a.getSuccessorsOf(b),k=j.next();!k.done;k=j.next())i=a.getEdgeData(b,k.value),a.deleteEdge(b,k.value),g.push([k.value,i]);for(var i,l=a.getPredecessorsOf(b),k=l.next();!k.done;k=l.next())i=a.getEdgeData(k.value,b),a.deleteEdge(k.value,b),h.push([k.value,i])}if(f!==c){for(var i,m=a.getSuccessorsOf(c),k=m.next();!k.done;k=m.next())i=a.getEdgeData(c,k.value),a.deleteEdge(c,k.value),g.push([k.value,i]);for(var i,n=a.getPredecessorsOf(c),k=n.next();!k.done;k=n.next())i=a.getEdgeData(k.value,c),a.deleteEdge(k.value,c),h.push([k.value,i])}f!==b&&f!==c&&a.addVertex(f);for(var o=0,p=g;o<p.length;o++){var q=p[o],i=a.getEdgeData(f,q[0]);i===void 0?a.addEdge(f,q[0],q[1]):a.setEdgeData(f,q[0],e(i,q[1]))}for(var r=0,s=h;r<s.length;r++){var q=s[r],i=a.getEdgeData(q[0],f);i===void 0?a.addEdge(q[0],f,q[1]):a.setEdgeData(q[0],f,e(i,q[1]))}f!==c&&a.deleteVertex(c),f!==b&&a.deleteVertex(b)}Object.defineProperty(c,"__esModule",{value:!0}),c.takeFirst=d,c.DoneIteratorResult={done:!0,value:void 0},c.EmptyIterator={next:function(){return c.DoneIteratorResult}};var f=Object.prototype.hasOwnProperty;c.assign=function(a,b){for(var c in b)f.call(b,c)&&(a[c]=b[c]);return a},c.toArray=function(a){for(var b=[],c=a.next();!c.done;c=a.next())b.push(c.value);return b},c.createMappedIterator=function(a,b){return{next:function(){var d=a.next();return d.done?c.DoneIteratorResult:{done:!1,value:b(d.value)}}}},c.createFilteredIterator=function(a,b){return{next:function(){for(var c=a.next();!c.done&&!b(c.value);)c=a.next();return c}}},c.createFlatMappedIterator=function(a,b){var d=c.EmptyIterator;return{next:function(){for(var e=d.next();e.done;){var f=a.next();if(f.done)return c.DoneIteratorResult;d=b(f.value),e=d.next()}return{done:!1,value:e.value}}}},c.createArrayIterator=function(a){var b=0;return{array:a,next:function(){for(;a[b]===void 0;){if(b>a.length)return c.DoneIteratorResult;b+=1}return{done:!1,value:a[b++]}}}},c.createMappedArrayIterator=function(a,b){var d=0;return{next:function(){for(;a[d]===void 0;){if(d>a.length)return c.DoneIteratorResult;d+=1}return{done:!1,value:b(a[d++])}}}},c.canContractEdge=function(a,b,c){if(!a.hasEdge(b,c))return!1;var d=a.getEdgeData(b,c);a.deleteEdge(b,c);var e=!a.isReachable(b,c);return a.addEdge(b,c,d),e},c.contractEdge=function(a,b,c,f,g){if(void 0===f&&(f=d),!a.hasEdge(b,c))return!1;var h=a.getEdgeData(b,c);if(a.deleteEdge(b,c),a.isReachable(b,c))return a.addEdge(b,c,h),!1;var i=f(b,c);if(i!==b&&i!==c&&a.hasVertex(i))throw a.addEdge(b,c,h),new Error("Cannot use existing vertex for edge contraction: "+i);return e(a,b,c,g,i),!0}},{}],7:[function(b,c){(function(b){var d,e,f,g,h,i,j,k,l,n,m,o,s,p,q,r,t,u,v;(function(d){function e(a,b){return a!==f&&("function"==typeof Object.create?Object.defineProperty(a,"__esModule",{value:!0}):a.__esModule=!0),function(c,d){return a[c]=b?b(c,d):d}}var f="object"==typeof b?b:"object"==typeof self?self:"object"==typeof this?this:{};"function"==typeof a&&a.amd?a("tslib",["exports"],function(a){d(e(f,e(a)))}):"object"==typeof c&&"object"==typeof c.exports?d(e(f,e(c.exports))):d(e(f))})(function(a){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b])};d=function(a,d){function b(){this.constructor=a}c(a,d),a.prototype=null===d?Object.create(d):(b.prototype=d.prototype,new b)},e=Object.assign||function(a){for(var b,c=1,d=arguments.length;c<d;c++)for(var e in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,e)&&(a[e]=b[e]);return a},f=function(a,b){var c={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&0>b.indexOf(d)&&(c[d]=a[d]);if(null!=a&&"function"==typeof Object.getOwnPropertySymbols)for(var e=0,d=Object.getOwnPropertySymbols(a);e<d.length;e++)0>b.indexOf(d[e])&&(c[d[e]]=a[d[e]]);return c},g=function(a,b,e,f){var g,h=arguments.length,c=3>h?b:null===f?f=Object.getOwnPropertyDescriptor(b,e):f;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(a,b,e,f);else for(var j=a.length-1;0<=j;j--)(g=a[j])&&(c=(3>h?g(c):3<h?g(b,e,c):g(b,e))||c);return 3<h&&c&&Object.defineProperty(b,e,c),c},h=function(a,b){return function(c,d){b(c,d,a)}},i=function(a,b){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(a,b)},j=function(a,b,c,d){return new(c||(c=Promise))(function(e,f){function g(a){try{i(d.next(a))}catch(a){f(a)}}function h(a){try{i(d["throw"](a))}catch(a){f(a)}}function i(a){a.done?e(a.value):new c(function(b){b(a.value)}).then(g,h)}i((d=d.apply(a,b||[])).next())})},k=function(a,b){function c(a){return function(b){return d([a,b])}}function d(c){if(e)throw new TypeError("Generator is already executing.");for(;k;)try{if(e=1,h&&(i=2&c[0]?h["return"]:c[0]?h["throw"]||((i=h["return"])&&i.call(h),0):h.next)&&!(i=i.call(h,c[1])).done)return i;switch((h=0,i)&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return k.label++,{value:c[1],done:!1};case 5:k.label++,h=c[1],c=[0];continue;case 7:c=k.ops.pop(),k.trys.pop();continue;default:if((i=k.trys,!(i=0<i.length&&i[i.length-1]))&&(6===c[0]||2===c[0])){k=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){k.label=c[1];break}if(6===c[0]&&k.label<i[1]){k.label=i[1],i=c;break}if(i&&k.label<i[2]){k.label=i[2],k.ops.push(c);break}i[2]&&k.ops.pop(),k.trys.pop();continue;}c=b.call(a,k)}catch(a){c=[6,a],h=0}finally{e=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}var e,h,i,j,k={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return j={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(j[Symbol.iterator]=function(){return this}),j},l=function(a,b){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])},n=function(a){var b="function"==typeof Symbol&&a[Symbol.iterator],c=0;return b?b.call(a):{next:function(){return a&&c>=a.length&&(a=void 0),{value:a&&a[c++],done:!a}}}},m=function(a,b){var c="function"==typeof Symbol&&a[Symbol.iterator];if(!c)return a;var d,f,g=c.call(a),h=[];try{for(;(void 0===b||0<b--)&&!(d=g.next()).done;)h.push(d.value)}catch(a){f={error:a}}finally{try{d&&!d.done&&(c=g["return"])&&c.call(g)}finally{if(f)throw f.error}}return h},o=function(){for(var a=[],b=0;b<arguments.length;b++)a=a.concat(m(arguments[b]));return a},s=function(a){return this instanceof s?(this.v=a,this):new s(a)},p=function(a,b,c){function d(c){m[c]&&(l[c]=function(d){return new Promise(function(f,a){1<g.push([c,d,f,a])||e(c,d)})})}function e(a,b){try{f(m[a](b))}catch(a){k(g[0][3],a)}}function f(a){a.value instanceof s?Promise.resolve(a.value.v).then(h,j):k(g[0][2],a)}function h(a){e("next",a)}function j(a){e("throw",a)}function k(a,b){(a(b),g.shift(),g.length)&&e(g[0][0],g[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var l,m=c.apply(a,b||[]),g=[];return l={},d("next"),d("throw"),d("return"),l[Symbol.asyncIterator]=function(){return this},l},q=function(a){function b(b,e){c[b]=a[b]?function(c){return(d=!d)?{value:s(a[b](c)),done:"return"===b}:e?e(c):c}:e}var c,d;return c={},b("next"),b("throw",function(a){throw a}),b("return"),c[Symbol.iterator]=function(){return this},c},r=function(a){function b(b){d[b]=a[b]&&function(d){return new Promise(function(e,f){d=a[b](d),c(e,f,d.done,d.value)})}}function c(a,b,c,d){Promise.resolve(d).then(function(b){a({value:b,done:c})},b)}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var d,e=a[Symbol.asyncIterator];return e?e.call(a):(a="function"==typeof n?n(a):a[Symbol.iterator](),d={},b("next"),b("throw"),b("return"),d[Symbol.asyncIterator]=function(){return this},d)},t=function(a,b){return Object.defineProperty?Object.defineProperty(a,"raw",{value:b}):a.raw=b,a},u=function(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b},v=function(a){return a&&a.__esModule?a:{default:a}},a("__extends",d),a("__assign",e),a("__rest",f),a("__decorate",g),a("__param",h),a("__metadata",i),a("__awaiter",j),a("__generator",k),a("__exportStar",l),a("__values",n),a("__read",m),a("__spread",o),a("__await",s),a("__asyncGenerator",p),a("__asyncDelegator",q),a("__asyncValues",r),a("__makeTemplateObject",t),a("__importStar",u),a("__importDefault",v)})}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{}]},{},[1])(1)});

@@ -19,2 +19,4 @@ import { BinaryOperator, Pair } from "andross";

getEdgeData(from: TVertex, to: TVertex): TEdgeData | undefined;
getEdgeDataTo(vertex: TVertex): Iterator<TEdgeData>;
getEdgeDataFrom(vertex: TVertex): Iterator<TEdgeData>;
setEdgeData(from: TVertex, to: TVertex, data: TEdgeData | undefined): boolean;

@@ -28,2 +30,3 @@ getEdges(): Iterator<Pair<TVertex>>;

hasVertex(vertex: TVertex): boolean;
canAddEdge(from: TVertex, to: TVertex): boolean;
addEdge(from: TVertex, to: TVertex, edgeData?: TEdgeData): boolean;

@@ -33,3 +36,3 @@ addVertex(vertex: TVertex): boolean;

deleteVertex(vertex: TVertex): boolean;
private getData(key);
private getData;
}

@@ -54,8 +54,24 @@ "use strict";

};
GenericGraphAdapter.prototype.getEdgeDataTo = function (vertex) {
var b = this.backward.get(vertex);
if (b === undefined) {
return util_1.EmptyIterator;
}
return util_1.createFilteredIterator(b.values(), function (data) { return data !== undefined; });
};
GenericGraphAdapter.prototype.getEdgeDataFrom = function (vertex) {
var f = this.forward.get(vertex);
if (f === undefined) {
return util_1.EmptyIterator;
}
return util_1.createFilteredIterator(f.values(), function (data) { return data !== undefined; });
};
GenericGraphAdapter.prototype.setEdgeData = function (from, to, data) {
var map = this.forward.get(from);
if (!map || !map.has(to)) {
var f = this.forward.get(from);
var b = this.backward.get(to);
if (!f || !b || !f.has(to) || !b.has(from)) {
return false;
}
map.set(to, data);
f.set(to, data);
b.set(from, data);
return true;

@@ -87,2 +103,24 @@ };

};
GenericGraphAdapter.prototype.canAddEdge = function (from, to) {
var f = this.forward.get(from);
var b = this.backward.get(to);
var didNotHaveFrom = this.addVertex(from);
var didNotHaveTo = this.addVertex(to);
if (!f) {
this.forward.set(from, f = new this.mapConstructor());
}
if (!b) {
this.backward.set(to, b = new this.mapConstructor());
}
if (f.has(to) || !this.detector.canAddEdge(this.adapter, from, to)) {
if (didNotHaveFrom) {
this.deleteVertex(from);
}
if (didNotHaveTo) {
this.deleteVertex(to);
}
return false;
}
return true;
};
GenericGraphAdapter.prototype.addEdge = function (from, to, edgeData) {

@@ -109,3 +147,3 @@ var f = this.forward.get(from);

f.set(to, edgeData);
b.set(from, true);
b.set(from, edgeData);
this.edgeCount += 1;

@@ -112,0 +150,0 @@ return true;

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

/// <reference types="graphlib" />
import { BinaryOperator, Pair, RemoveFrom } from "andross";

@@ -21,2 +20,4 @@ import { Graph } from "graphlib";

getVertexData(vertex: string): RemoveFrom<TVertexData, VertexData>;
getEdgeDataFrom(vertex: string): Iterator<TEdgeData>;
getEdgeDataTo(vertex: string): Iterator<TEdgeData>;
getEdgeData(from: string, to: string): TEdgeData;

@@ -29,2 +30,3 @@ setEdgeData(from: string, to: string, data: TEdgeData): boolean;

readonly graph: Graph;
canAddEdge(from: string, to: string): boolean;
addEdge(from: string, to: string, data?: TEdgeData): boolean;

@@ -34,3 +36,3 @@ addVertex(vertex: string, label?: CustomVertexData<TVertexData>): boolean;

deleteVertex(vertex: string): boolean;
private getData(key);
private getData;
}

@@ -53,2 +53,18 @@ "use strict";

};
GraphlibAdapter.prototype.getEdgeDataFrom = function (vertex) {
var _this = this;
var edges = this.g.outEdges(vertex);
if (edges === undefined) {
return util_1.EmptyIterator;
}
return util_1.createFilteredIterator(util_1.createMappedArrayIterator(edges, function (edge) { return _this.g.edge(edge.v, edge.w); }), function (data) { return data !== undefined; });
};
GraphlibAdapter.prototype.getEdgeDataTo = function (vertex) {
var _this = this;
var edges = this.g.inEdges(vertex);
if (edges === undefined) {
return util_1.EmptyIterator;
}
return util_1.createFilteredIterator(util_1.createMappedArrayIterator(edges, function (edge) { return _this.g.edge(edge.v, edge.w); }), function (data) { return data !== undefined; });
};
GraphlibAdapter.prototype.getEdgeData = function (from, to) {

@@ -83,2 +99,19 @@ return this.g.edge(from, to);

});
GraphlibAdapter.prototype.canAddEdge = function (from, to) {
if (this.g.hasEdge(from, to)) {
return false;
}
var didNotHaveFrom = this.addVertex(from);
var didNotHaveTo = this.addVertex(to);
if (!this.detector.canAddEdge(this.adapter, from, to)) {
if (didNotHaveFrom) {
this.deleteVertex(from);
}
if (didNotHaveTo) {
this.deleteVertex(to);
}
return false;
}
return true;
};
GraphlibAdapter.prototype.addEdge = function (from, to, data) {

@@ -85,0 +118,0 @@ if (this.g.hasEdge(from, to)) {

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

/// <reference types="graphlib" />
import { BinaryOperator, Omit, Pair } from "andross";

@@ -35,2 +34,3 @@ import { Graph, GraphOptions } from "graphlib";

addVertex(vertex: TVertex): boolean;
canAddEdge(from: TVertex, to: TVertex): boolean;
canContractEdge(from: TVertex, to: TVertex): boolean;

@@ -42,2 +42,4 @@ contractEdge(from: TVertex, to: TVertex, vertexMerger?: BinaryOperator<TVertex>, dataMerger?: BinaryOperator<TEdgeData>): boolean;

getEdgeData(from: TVertex, to: TVertex): TEdgeData;
getEdgeDataTo(vertex: TVertex): Iterator<TEdgeData>;
getEdgeDataFrom(vertex: TVertex): Iterator<TEdgeData>;
getEdges(): Iterator<Pair<TVertex, TVertex>>;

@@ -44,0 +46,0 @@ getOrder(vertex: TVertex): number;

@@ -8,4 +8,7 @@ import { BinaryOperator, Maybe, Pair, Triple } from "andross";

addLabeledEdge(from: TVertex, to: TVertex, label?: TEdgeLabel, data?: TEdgeData): boolean;
canAddEdge(from: TVertex, to: TVertex, label?: TEdgeLabel): boolean;
addEdge(from: TVertex, to: TVertex, data?: TEdgeData, label?: TEdgeLabel): boolean;
addVertex(vertex: TVertex): boolean;
getEdgeDataTo(vertex: TVertex, label?: TEdgeLabel): Iterator<TEdgeData>;
getEdgeDataFrom(vertex: TVertex, label?: TEdgeLabel): Iterator<TEdgeData>;
contractEdge(from: TVertex, to: TVertex, vertexMerger?: BinaryOperator<TVertex>, edgeMerger?: BinaryOperator<Maybe<TEdgeData>>): boolean;

@@ -12,0 +15,0 @@ canContractEdge(from: TVertex, to: TVertex): boolean;

@@ -31,2 +31,12 @@ "use strict";

};
MultiGraphAdapter.prototype.canAddEdge = function (from, to, label) {
var srcData = this.g.getEdgeData(from, to);
if (srcData !== undefined) {
if (srcData.has(label)) {
return false;
}
return true;
}
return this.g.canAddEdge(from, to);
};
MultiGraphAdapter.prototype.addEdge = function (from, to, data, label) {

@@ -50,2 +60,14 @@ var srcData = this.g.getEdgeData(from, to);

};
MultiGraphAdapter.prototype.getEdgeDataTo = function (vertex, label) {
if (label === undefined) {
return util_1.createFilteredIterator(util_1.createFlatMappedIterator(this.g.getEdgeDataTo(vertex), function (data) { return data.values(); }), function (data) { return data !== undefined; });
}
return util_1.createMappedIterator(util_1.createFilteredIterator(util_1.createFlatMappedIterator(this.g.getEdgeDataTo(vertex), function (data) { return data.entries(); }), function (entry) { return entry[1] !== undefined && entry[0] === label; }), function (entry) { return entry[1]; });
};
MultiGraphAdapter.prototype.getEdgeDataFrom = function (vertex, label) {
if (label === undefined) {
return util_1.createFilteredIterator(util_1.createFlatMappedIterator(this.g.getEdgeDataFrom(vertex), function (data) { return data.values(); }), function (data) { return data !== undefined; });
}
return util_1.createMappedIterator(util_1.createFilteredIterator(util_1.createFlatMappedIterator(this.g.getEdgeDataFrom(vertex), function (data) { return data.entries(); }), function (entry) { return entry[1] !== undefined && entry[0] === label; }), function (entry) { return entry[1]; });
};
MultiGraphAdapter.prototype.contractEdge = function (from, to, vertexMerger, edgeMerger) {

@@ -52,0 +74,0 @@ return this.g.contractEdge(from, to, vertexMerger, createMerger(edgeMerger));

@@ -15,7 +15,7 @@ import { CycleDetector, GraphAdapter, VertexData } from "./Header";

getOrder(g: GraphAdapter<TVertex>, vertex: TVertex): number;
private checkCycle(adapter, x, y);
private cleanAfterCycle(adapter);
private dfs_f(first, adapter, ub);
private dfs_b(first, adapter, lb);
private reorder(adapter);
private checkCycle;
private cleanAfterCycle;
private dfs_f;
private dfs_b;
private reorder;
}
{
"name": "incremental-cycle-detect",
"version": "0.2.1",
"version": "0.2.2",
"description": "Keeps a directed acyclic graph topologically sorted each time you add an edge or vertex to check for cycles.",

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

@@ -144,2 +144,6 @@ Lets you add edges to a [directed acyclic graph](https://en.wikipedia.org/wiki/Directed_acyclic_graph) and be told whether this edge

# 0.2.2
- Added two methods for accessing edge data of incoming / outgoing edges: `getEdgeDataFrom`, `getEdgeDataTo`
- Added a method for checking whether an edge can be added: `canAddEdge`.
# 0.2.1

@@ -146,0 +150,0 @@ - Fixed typings for typescript.

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