aureooms-js-adjacency-list
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -15,3 +15,3 @@ { | ||
], | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"main": "js/dist/adjacency-list.js", | ||
@@ -18,0 +18,0 @@ "homepage": "http://aureooms.github.io/js-adjacency-list/", |
@@ -7,3 +7,3 @@ { | ||
"description": "adjacency list code bricks for JavaScript", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"main": "js/dist/adjacency-list.js", | ||
@@ -10,0 +10,0 @@ "name": "aureooms-js-adjacency-list", |
@@ -149,10 +149,10 @@ "use strict"; | ||
var uv = new DiEdge(u, v, this.succ); | ||
var vu = new DiEdge(v, u, this.pred); | ||
var uv = new DiEdge(u, v, this.succ.get(u)); | ||
var vu = new DiEdge(v, u, this.pred.get(v)); | ||
// add to edge list of u | ||
uv.iterator = this.succ.get(u).push(uv); | ||
uv.iterator = uv.list.push(uv); | ||
// add to edge list of v | ||
vu.iterator = this.pred.get(v).push(vu); | ||
vu.iterator = vu.list.push(vu); | ||
@@ -159,0 +159,0 @@ // set twin |
@@ -1,2 +0,2 @@ | ||
"use strict";var _slicedToArray=function(){function e(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(u){i=!0,a=u}finally{try{!n&&s["return"]&&s["return"]()}finally{if(i)throw a}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();!function(){var e=function(e,t){var r=function(e,t,r){this.u=e,this.v=t,this.iterator=null,this.twin=null,this.list=r};e.DiEdge=r;var n=function(){this.iterator=null};e.DiVertex=n;var i=function(e,t){this.u=e,this.v=t,this.iterator=null,this.uiterator=null,this.viterator=null};e.Edge=i;var a=function(e,i){var a=function(){this.V=new e,this.succ=new i,this.pred=new i};return a.prototype.vadd=function(){var t=new n;return this.succ.set(t,new e),this.pred.set(t,new e),t.iterator=this.V.push(t),t},a.prototype.vdel=function(e){var r=!0,n=!1,i=t;try{for(var a,o=this.initr(e)[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;this.edel(s)}}catch(u){n=!0,i=u}finally{try{!r&&o["return"]&&o["return"]()}finally{if(n)throw i}}var c=!0,p=!1,h=t;try{for(var f,v=this.outitr(e)[Symbol.iterator]();!(c=(f=v.next()).done);c=!0){var s=f.value;this.edel(s)}}catch(u){p=!0,h=u}finally{try{!c&&v["return"]&&v["return"]()}finally{if(p)throw h}}this.pred["delete"](e),this.succ["delete"](e),this.V.erase(e.iterator)},a.prototype.eadd=function(e,t){var n=new r(e,t,this.succ),i=new r(t,e,this.pred);return n.iterator=this.succ.get(e).push(n),i.iterator=this.pred.get(t).push(i),n.twin=i,i.twin=n,n},a.prototype.edel=function(e){e.list.erase(e.iterator),e.twin.list.erase(e.twin.iterator)},a.prototype.vitr=regeneratorRuntime.mark(function o(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this.V,"t0",1);case 1:case"end":return e.stop()}},o,this)}),a.prototype.eitr=regeneratorRuntime.mark(function s(){var e,r,n,i,a,o,u,c;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:e=!0,r=!1,n=t,s.prev=3,i=this.succ[Symbol.iterator]();case 5:if(e=(a=i.next()).done){s.next=13;break}return o=_slicedToArray(a.value,2),u=o[0],c=o[1],s.delegateYield(c,"t0",10);case 10:e=!0,s.next=5;break;case 13:s.next=19;break;case 15:s.prev=15,s.t1=s["catch"](3),r=!0,n=s.t1;case 19:s.prev=19,s.prev=20,!e&&i["return"]&&i["return"]();case 22:if(s.prev=22,!r){s.next=25;break}throw n;case 25:return s.finish(22);case 26:return s.finish(19);case 27:case"end":return s.stop()}},s,this,[[3,15,19,27],[20,,22,26]])}),a.prototype.iitr=regeneratorRuntime.mark(function u(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(this.initr(e),"t0",1);case 1:return t.delegateYield(this.outitr(e),"t1",2);case 2:case"end":return t.stop()}},u,this)}),a.prototype.initr=regeneratorRuntime.mark(function c(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(this.pred.get(e),"t0",1);case 1:case"end":return t.stop()}},c,this)}),a.prototype.outitr=regeneratorRuntime.mark(function p(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(this.succ.get(e),"t0",1);case 1:case"end":return t.stop()}},p,this)}),a.prototype.nitr=regeneratorRuntime.mark(function h(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(this.dsitr(e),"t0",1);case 1:return t.delegateYield(this.dpitr(e),"t1",2);case 2:case"end":return t.stop()}},h,this)}),a.prototype.dsitr=regeneratorRuntime.mark(function f(e){var r,n,i,a,o,s;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:r=!0,n=!1,i=t,u.prev=3,a=this.succ.get(e)[Symbol.iterator]();case 5:if(r=(o=a.next()).done){u.next=12;break}return s=o.value.v,u.next=9,s;case 9:r=!0,u.next=5;break;case 12:u.next=18;break;case 14:u.prev=14,u.t0=u["catch"](3),n=!0,i=u.t0;case 18:u.prev=18,u.prev=19,!r&&a["return"]&&a["return"]();case 21:if(u.prev=21,!n){u.next=24;break}throw i;case 24:return u.finish(21);case 25:return u.finish(18);case 26:case"end":return u.stop()}},f,this,[[3,14,18,26],[19,,21,25]])}),a.prototype.dpitr=regeneratorRuntime.mark(function v(e){var r,n,i,a,o,s;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:r=!0,n=!1,i=t,u.prev=3,a=this.pred.get(e)[Symbol.iterator]();case 5:if(r=(o=a.next()).done){u.next=12;break}return s=o.value.v,u.next=9,s;case 9:r=!0,u.next=5;break;case 12:u.next=18;break;case 14:u.prev=14,u.t0=u["catch"](3),n=!0,i=u.t0;case 18:u.prev=18,u.prev=19,!r&&a["return"]&&a["return"]();case 21:if(u.prev=21,!n){u.next=24;break}throw i;case 24:return u.finish(21);case 25:return u.finish(18);case 26:case"end":return u.stop()}},v,this,[[3,14,18,26],[19,,21,25]])}),a.prototype.edges=regeneratorRuntime.mark(function d(){var e,r,n,i,a,o;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:e=!0,r=!1,n=t,s.prev=3,i=this.eitr()[Symbol.iterator]();case 5:if(e=(a=i.next()).done){s.next=12;break}return o=a.value,s.next=9,[o.u,o.v,o];case 9:e=!0,s.next=5;break;case 12:s.next=18;break;case 14:s.prev=14,s.t0=s["catch"](3),r=!0,n=s.t0;case 18:s.prev=18,s.prev=19,!e&&i["return"]&&i["return"]();case 21:if(s.prev=21,!r){s.next=24;break}throw n;case 24:return s.finish(21);case 25:return s.finish(18);case 26:case"end":return s.stop()}},d,this,[[3,14,18,26],[19,,21,25]])}),a.prototype.incident=regeneratorRuntime.mark(function l(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(this.ingoing(e),"t0",1);case 1:return t.delegateYield(this.outgoing(e),"t1",2);case 2:case"end":return t.stop()}},l,this)}),a.prototype.ingoing=regeneratorRuntime.mark(function y(e){var r,n,i,a,o,s;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:r=!0,n=!1,i=t,u.prev=3,a=this.initr(e)[Symbol.iterator]();case 5:if(r=(o=a.next()).done){u.next=12;break}return s=o.value,u.next=9,[s.u,s.v,s];case 9:r=!0,u.next=5;break;case 12:u.next=18;break;case 14:u.prev=14,u.t0=u["catch"](3),n=!0,i=u.t0;case 18:u.prev=18,u.prev=19,!r&&a["return"]&&a["return"]();case 21:if(u.prev=21,!n){u.next=24;break}throw i;case 24:return u.finish(21);case 25:return u.finish(18);case 26:case"end":return u.stop()}},y,this,[[3,14,18,26],[19,,21,25]])}),a.prototype.outgoing=regeneratorRuntime.mark(function x(e){var r,n,i,a,o,s;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:r=!0,n=!1,i=t,u.prev=3,a=this.outitr(e)[Symbol.iterator]();case 5:if(r=(o=a.next()).done){u.next=12;break}return s=o.value,u.next=9,[s.u,s.v,s];case 9:r=!0,u.next=5;break;case 12:u.next=18;break;case 14:u.prev=14,u.t0=u["catch"](3),n=!0,i=u.t0;case 18:u.prev=18,u.prev=19,!r&&a["return"]&&a["return"]();case 21:if(u.prev=21,!n){u.next=24;break}throw i;case 24:return u.finish(21);case 25:return u.finish(18);case 26:case"end":return u.stop()}},x,this,[[3,14,18,26],[19,,21,25]])}),a.prototype.endpoints=function(e){return[e.u,e.v]},a.prototype.reverse=function(){var e=[this.pred,this.succ];return this.succ=e[0],this.pred=e[1],this},a};e.MultiDiGraph=a;var o=function(e){var r=function(){this.V=new e,this.E=new e};return r.prototype.vadd=function(){var t=new s(new e);return t.iterator=this.V.push(t),t},r.prototype.vdel=function(e){var r=!0,n=!1,i=t;try{for(var a,o=this.iitr(e)[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;this.edel(s)}}catch(u){n=!0,i=u}finally{try{!r&&o["return"]&&o["return"]()}finally{if(n)throw i}}this.V.erase(e.iterator)},r.prototype.eadd=function(e,t){var r=new i(e,t);return r.iterator=this.E.push(r),r.uiterator=e.E.push(r),e!==t&&(r.viterator=t.E.push(r)),r},r.prototype.edel=function(e){this.E.erase(e.iterator),e.u.E.erase(e.uiterator),e.u!==e.v&&e.v.E.erase(e.viterator)},r.prototype.vitr=regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this.V,"t0",1);case 1:case"end":return e.stop()}},n,this)}),r.prototype.eitr=regeneratorRuntime.mark(function a(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this.E,"t0",1);case 1:case"end":return e.stop()}},a,this)}),r.prototype.iitr=regeneratorRuntime.mark(function o(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(e.E,"t0",1);case 1:case"end":return t.stop()}},o,this)}),r.prototype.initr=r.prototype.iitr,r.prototype.outitr=r.prototype.iitr,r.prototype.nitr=regeneratorRuntime.mark(function u(e){var r,n,i,a,o,s,c,p;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:r=!0,n=!1,i=t,u.prev=3,a=e.E[Symbol.iterator]();case 5:if(r=(o=a.next()).done){u.next=14;break}return s=o.value,c=s.u,p=s.v,u.next=11,c===e?p:c;case 11:r=!0,u.next=5;break;case 14:u.next=20;break;case 16:u.prev=16,u.t0=u["catch"](3),n=!0,i=u.t0;case 20:u.prev=20,u.prev=21,!r&&a["return"]&&a["return"]();case 23:if(u.prev=23,!n){u.next=26;break}throw i;case 26:return u.finish(23);case 27:return u.finish(20);case 28:case"end":return u.stop()}},u,this,[[3,16,20,28],[21,,23,27]])}),r.prototype.dsitr=r.prototype.nitr,r.prototype.dpitr=r.prototype.nitr,r.prototype.edges=regeneratorRuntime.mark(function c(){var e,r,n,i,a,o;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:e=!0,r=!1,n=t,s.prev=3,i=this.eitr()[Symbol.iterator]();case 5:if(e=(a=i.next()).done){s.next=12;break}return o=a.value,s.next=9,[o.u,o.v,o];case 9:e=!0,s.next=5;break;case 12:s.next=18;break;case 14:s.prev=14,s.t0=s["catch"](3),r=!0,n=s.t0;case 18:s.prev=18,s.prev=19,!e&&i["return"]&&i["return"]();case 21:if(s.prev=21,!r){s.next=24;break}throw n;case 24:return s.finish(21);case 25:return s.finish(18);case 26:case"end":return s.stop()}},c,this,[[3,14,18,26],[19,,21,25]])}),r.prototype.incident=regeneratorRuntime.mark(function p(e){var r,n,i,a,o,s;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:r=!0,n=!1,i=t,u.prev=3,a=this.iitr(e)[Symbol.iterator]();case 5:if(r=(o=a.next()).done){u.next=12;break}return s=o.value,u.next=9,[s.u,s.v,s];case 9:r=!0,u.next=5;break;case 12:u.next=18;break;case 14:u.prev=14,u.t0=u["catch"](3),n=!0,i=u.t0;case 18:u.prev=18,u.prev=19,!r&&a["return"]&&a["return"]();case 21:if(u.prev=21,!n){u.next=24;break}throw i;case 24:return u.finish(21);case 25:return u.finish(18);case 26:case"end":return u.stop()}},p,this,[[3,14,18,26],[19,,21,25]])}),r.prototype.ingoing=r.prototype.incident,r.prototype.outgoing=r.prototype.incident,r.prototype.endpoints=function(e){return[e.u,e.v]},r.prototype.reverse=function(){},r};e.MultiGraph=o;var s=function(e){this.iterator=null,this.E=e};return e.Vertex=s,e};"object"==typeof exports?e(exports):"function"==typeof define&&define.amd?define("aureooms-js-adjacency-list",[],function(){return e({})}):"object"==typeof window&&"object"==typeof window.document?e(window.adjacencylist={}):console.error("unable to detect type of module to define for aureooms-js-adjacency-list")}(); | ||
"use strict";var _slicedToArray=function(){function e(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(u){i=!0,a=u}finally{try{!n&&s["return"]&&s["return"]()}finally{if(i)throw a}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();!function(){var e=function(e,t){var r=function(e,t,r){this.u=e,this.v=t,this.iterator=null,this.twin=null,this.list=r};e.DiEdge=r;var n=function(){this.iterator=null};e.DiVertex=n;var i=function(e,t){this.u=e,this.v=t,this.iterator=null,this.uiterator=null,this.viterator=null};e.Edge=i;var a=function(e,i){var a=function(){this.V=new e,this.succ=new i,this.pred=new i};return a.prototype.vadd=function(){var t=new n;return this.succ.set(t,new e),this.pred.set(t,new e),t.iterator=this.V.push(t),t},a.prototype.vdel=function(e){var r=!0,n=!1,i=t;try{for(var a,o=this.initr(e)[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;this.edel(s)}}catch(u){n=!0,i=u}finally{try{!r&&o["return"]&&o["return"]()}finally{if(n)throw i}}var c=!0,p=!1,h=t;try{for(var f,v=this.outitr(e)[Symbol.iterator]();!(c=(f=v.next()).done);c=!0){var s=f.value;this.edel(s)}}catch(u){p=!0,h=u}finally{try{!c&&v["return"]&&v["return"]()}finally{if(p)throw h}}this.pred["delete"](e),this.succ["delete"](e),this.V.erase(e.iterator)},a.prototype.eadd=function(e,t){var n=new r(e,t,this.succ.get(e)),i=new r(t,e,this.pred.get(t));return n.iterator=n.list.push(n),i.iterator=i.list.push(i),n.twin=i,i.twin=n,n},a.prototype.edel=function(e){e.list.erase(e.iterator),e.twin.list.erase(e.twin.iterator)},a.prototype.vitr=regeneratorRuntime.mark(function o(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this.V,"t0",1);case 1:case"end":return e.stop()}},o,this)}),a.prototype.eitr=regeneratorRuntime.mark(function s(){var e,r,n,i,a,o,u,c;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:e=!0,r=!1,n=t,s.prev=3,i=this.succ[Symbol.iterator]();case 5:if(e=(a=i.next()).done){s.next=13;break}return o=_slicedToArray(a.value,2),u=o[0],c=o[1],s.delegateYield(c,"t0",10);case 10:e=!0,s.next=5;break;case 13:s.next=19;break;case 15:s.prev=15,s.t1=s["catch"](3),r=!0,n=s.t1;case 19:s.prev=19,s.prev=20,!e&&i["return"]&&i["return"]();case 22:if(s.prev=22,!r){s.next=25;break}throw n;case 25:return s.finish(22);case 26:return s.finish(19);case 27:case"end":return s.stop()}},s,this,[[3,15,19,27],[20,,22,26]])}),a.prototype.iitr=regeneratorRuntime.mark(function u(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(this.initr(e),"t0",1);case 1:return t.delegateYield(this.outitr(e),"t1",2);case 2:case"end":return t.stop()}},u,this)}),a.prototype.initr=regeneratorRuntime.mark(function c(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(this.pred.get(e),"t0",1);case 1:case"end":return t.stop()}},c,this)}),a.prototype.outitr=regeneratorRuntime.mark(function p(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(this.succ.get(e),"t0",1);case 1:case"end":return t.stop()}},p,this)}),a.prototype.nitr=regeneratorRuntime.mark(function h(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(this.dsitr(e),"t0",1);case 1:return t.delegateYield(this.dpitr(e),"t1",2);case 2:case"end":return t.stop()}},h,this)}),a.prototype.dsitr=regeneratorRuntime.mark(function f(e){var r,n,i,a,o,s;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:r=!0,n=!1,i=t,u.prev=3,a=this.succ.get(e)[Symbol.iterator]();case 5:if(r=(o=a.next()).done){u.next=12;break}return s=o.value.v,u.next=9,s;case 9:r=!0,u.next=5;break;case 12:u.next=18;break;case 14:u.prev=14,u.t0=u["catch"](3),n=!0,i=u.t0;case 18:u.prev=18,u.prev=19,!r&&a["return"]&&a["return"]();case 21:if(u.prev=21,!n){u.next=24;break}throw i;case 24:return u.finish(21);case 25:return u.finish(18);case 26:case"end":return u.stop()}},f,this,[[3,14,18,26],[19,,21,25]])}),a.prototype.dpitr=regeneratorRuntime.mark(function v(e){var r,n,i,a,o,s;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:r=!0,n=!1,i=t,u.prev=3,a=this.pred.get(e)[Symbol.iterator]();case 5:if(r=(o=a.next()).done){u.next=12;break}return s=o.value.v,u.next=9,s;case 9:r=!0,u.next=5;break;case 12:u.next=18;break;case 14:u.prev=14,u.t0=u["catch"](3),n=!0,i=u.t0;case 18:u.prev=18,u.prev=19,!r&&a["return"]&&a["return"]();case 21:if(u.prev=21,!n){u.next=24;break}throw i;case 24:return u.finish(21);case 25:return u.finish(18);case 26:case"end":return u.stop()}},v,this,[[3,14,18,26],[19,,21,25]])}),a.prototype.edges=regeneratorRuntime.mark(function d(){var e,r,n,i,a,o;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:e=!0,r=!1,n=t,s.prev=3,i=this.eitr()[Symbol.iterator]();case 5:if(e=(a=i.next()).done){s.next=12;break}return o=a.value,s.next=9,[o.u,o.v,o];case 9:e=!0,s.next=5;break;case 12:s.next=18;break;case 14:s.prev=14,s.t0=s["catch"](3),r=!0,n=s.t0;case 18:s.prev=18,s.prev=19,!e&&i["return"]&&i["return"]();case 21:if(s.prev=21,!r){s.next=24;break}throw n;case 24:return s.finish(21);case 25:return s.finish(18);case 26:case"end":return s.stop()}},d,this,[[3,14,18,26],[19,,21,25]])}),a.prototype.incident=regeneratorRuntime.mark(function l(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(this.ingoing(e),"t0",1);case 1:return t.delegateYield(this.outgoing(e),"t1",2);case 2:case"end":return t.stop()}},l,this)}),a.prototype.ingoing=regeneratorRuntime.mark(function y(e){var r,n,i,a,o,s;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:r=!0,n=!1,i=t,u.prev=3,a=this.initr(e)[Symbol.iterator]();case 5:if(r=(o=a.next()).done){u.next=12;break}return s=o.value,u.next=9,[s.u,s.v,s];case 9:r=!0,u.next=5;break;case 12:u.next=18;break;case 14:u.prev=14,u.t0=u["catch"](3),n=!0,i=u.t0;case 18:u.prev=18,u.prev=19,!r&&a["return"]&&a["return"]();case 21:if(u.prev=21,!n){u.next=24;break}throw i;case 24:return u.finish(21);case 25:return u.finish(18);case 26:case"end":return u.stop()}},y,this,[[3,14,18,26],[19,,21,25]])}),a.prototype.outgoing=regeneratorRuntime.mark(function x(e){var r,n,i,a,o,s;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:r=!0,n=!1,i=t,u.prev=3,a=this.outitr(e)[Symbol.iterator]();case 5:if(r=(o=a.next()).done){u.next=12;break}return s=o.value,u.next=9,[s.u,s.v,s];case 9:r=!0,u.next=5;break;case 12:u.next=18;break;case 14:u.prev=14,u.t0=u["catch"](3),n=!0,i=u.t0;case 18:u.prev=18,u.prev=19,!r&&a["return"]&&a["return"]();case 21:if(u.prev=21,!n){u.next=24;break}throw i;case 24:return u.finish(21);case 25:return u.finish(18);case 26:case"end":return u.stop()}},x,this,[[3,14,18,26],[19,,21,25]])}),a.prototype.endpoints=function(e){return[e.u,e.v]},a.prototype.reverse=function(){var e=[this.pred,this.succ];return this.succ=e[0],this.pred=e[1],this},a};e.MultiDiGraph=a;var o=function(e){var r=function(){this.V=new e,this.E=new e};return r.prototype.vadd=function(){var t=new s(new e);return t.iterator=this.V.push(t),t},r.prototype.vdel=function(e){var r=!0,n=!1,i=t;try{for(var a,o=this.iitr(e)[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;this.edel(s)}}catch(u){n=!0,i=u}finally{try{!r&&o["return"]&&o["return"]()}finally{if(n)throw i}}this.V.erase(e.iterator)},r.prototype.eadd=function(e,t){var r=new i(e,t);return r.iterator=this.E.push(r),r.uiterator=e.E.push(r),e!==t&&(r.viterator=t.E.push(r)),r},r.prototype.edel=function(e){this.E.erase(e.iterator),e.u.E.erase(e.uiterator),e.u!==e.v&&e.v.E.erase(e.viterator)},r.prototype.vitr=regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this.V,"t0",1);case 1:case"end":return e.stop()}},n,this)}),r.prototype.eitr=regeneratorRuntime.mark(function a(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this.E,"t0",1);case 1:case"end":return e.stop()}},a,this)}),r.prototype.iitr=regeneratorRuntime.mark(function o(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(e.E,"t0",1);case 1:case"end":return t.stop()}},o,this)}),r.prototype.initr=r.prototype.iitr,r.prototype.outitr=r.prototype.iitr,r.prototype.nitr=regeneratorRuntime.mark(function u(e){var r,n,i,a,o,s,c,p;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:r=!0,n=!1,i=t,u.prev=3,a=e.E[Symbol.iterator]();case 5:if(r=(o=a.next()).done){u.next=14;break}return s=o.value,c=s.u,p=s.v,u.next=11,c===e?p:c;case 11:r=!0,u.next=5;break;case 14:u.next=20;break;case 16:u.prev=16,u.t0=u["catch"](3),n=!0,i=u.t0;case 20:u.prev=20,u.prev=21,!r&&a["return"]&&a["return"]();case 23:if(u.prev=23,!n){u.next=26;break}throw i;case 26:return u.finish(23);case 27:return u.finish(20);case 28:case"end":return u.stop()}},u,this,[[3,16,20,28],[21,,23,27]])}),r.prototype.dsitr=r.prototype.nitr,r.prototype.dpitr=r.prototype.nitr,r.prototype.edges=regeneratorRuntime.mark(function c(){var e,r,n,i,a,o;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:e=!0,r=!1,n=t,s.prev=3,i=this.eitr()[Symbol.iterator]();case 5:if(e=(a=i.next()).done){s.next=12;break}return o=a.value,s.next=9,[o.u,o.v,o];case 9:e=!0,s.next=5;break;case 12:s.next=18;break;case 14:s.prev=14,s.t0=s["catch"](3),r=!0,n=s.t0;case 18:s.prev=18,s.prev=19,!e&&i["return"]&&i["return"]();case 21:if(s.prev=21,!r){s.next=24;break}throw n;case 24:return s.finish(21);case 25:return s.finish(18);case 26:case"end":return s.stop()}},c,this,[[3,14,18,26],[19,,21,25]])}),r.prototype.incident=regeneratorRuntime.mark(function p(e){var r,n,i,a,o,s;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:r=!0,n=!1,i=t,u.prev=3,a=this.iitr(e)[Symbol.iterator]();case 5:if(r=(o=a.next()).done){u.next=12;break}return s=o.value,u.next=9,[s.u,s.v,s];case 9:r=!0,u.next=5;break;case 12:u.next=18;break;case 14:u.prev=14,u.t0=u["catch"](3),n=!0,i=u.t0;case 18:u.prev=18,u.prev=19,!r&&a["return"]&&a["return"]();case 21:if(u.prev=21,!n){u.next=24;break}throw i;case 24:return u.finish(21);case 25:return u.finish(18);case 26:case"end":return u.stop()}},p,this,[[3,14,18,26],[19,,21,25]])}),r.prototype.ingoing=r.prototype.incident,r.prototype.outgoing=r.prototype.incident,r.prototype.endpoints=function(e){return[e.u,e.v]},r.prototype.reverse=function(){},r};e.MultiGraph=o;var s=function(e){this.iterator=null,this.E=e};return e.Vertex=s,e};"object"==typeof exports?e(exports):"function"==typeof define&&define.amd?define("aureooms-js-adjacency-list",[],function(){return e({})}):"object"==typeof window&&"object"==typeof window.document?e(window.adjacencylist={}):console.error("unable to detect type of module to define for aureooms-js-adjacency-list")}(); | ||
//# sourceMappingURL=js/dist/adjacency-list.js.map |
@@ -61,10 +61,10 @@ | ||
const uv = new DiEdge( u , v , this.succ ) ; | ||
const vu = new DiEdge( v , u , this.pred ) ; | ||
const uv = new DiEdge( u , v , this.succ.get( u ) ) ; | ||
const vu = new DiEdge( v , u , this.pred.get( v ) ) ; | ||
// add to edge list of u | ||
uv.iterator = this.succ.get( u ).push( uv ) ; | ||
uv.iterator = uv.list.push( uv ) ; | ||
// add to edge list of v | ||
vu.iterator = this.pred.get( v ).push( vu ) ; | ||
vu.iterator = vu.list.push( vu ) ; | ||
@@ -71,0 +71,0 @@ // set twin |
{ | ||
"main": "js/dist/adjacency-list.js", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"bugs": { | ||
@@ -5,0 +5,0 @@ "url": "https://github.com/aureooms/js-adjacency-list/issues" |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
4
0
102837