@lumino/algorithm
Advanced tools
Comparing version 1.6.0 to 1.6.1
@@ -1,2 +0,2 @@ | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t=t||self).lumino_algorithm={})}(this,(function(t){"use strict";function n(t){return"function"==typeof t.iter?t.iter():new e(t)}function r(t,r){for(var e,i=0,o=n(t);void 0!==(e=o.next());)if(!1===r(e,i++))return}!function(t){function n(t,n,r,e){void 0===r&&(r=0),void 0===e&&(e=-1);var i,o=t.length;if(0===o)return-1;r=r<0?Math.max(0,r+o):Math.min(r,o-1),i=(e=e<0?Math.max(0,e+o):Math.min(e,o-1))<r?e+1+(o-r):e-r+1;for(var u=0;u<i;++u){var a=(r+u)%o;if(t[a]===n)return a}return-1}function r(t,n,r,e){void 0===r&&(r=-1),void 0===e&&(e=0);var i,o=t.length;if(0===o)return-1;i=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))<(e=e<0?Math.max(0,e+o):Math.min(e,o-1))?r+1+(o-e):r-e+1;for(var u=0;u<i;++u){var a=(r-u+o)%o;if(t[a]===n)return a}return-1}function e(t,n,r,e){void 0===r&&(r=0),void 0===e&&(e=-1);var i,o=t.length;if(0===o)return-1;r=r<0?Math.max(0,r+o):Math.min(r,o-1),i=(e=e<0?Math.max(0,e+o):Math.min(e,o-1))<r?e+1+(o-r):e-r+1;for(var u=0;u<i;++u){var a=(r+u)%o;if(n(t[a],a))return a}return-1}function i(t,n,r,e){void 0===r&&(r=-1),void 0===e&&(e=0);var i,o=t.length;if(0===o)return-1;i=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))<(e=e<0?Math.max(0,e+o):Math.min(e,o-1))?r+1+(o-e):r-e+1;for(var u=0;u<i;++u){var a=(r-u+o)%o;if(n(t[a],a))return a}return-1}function o(t,n,r){void 0===n&&(n=0),void 0===r&&(r=-1);var e=t.length;if(!(e<=1))for(n=n<0?Math.max(0,n+e):Math.min(n,e-1),r=r<0?Math.max(0,r+e):Math.min(r,e-1);n<r;){var i=t[n],o=t[r];t[n++]=o,t[r--]=i}}function u(t,n){var r=t.length;if(n<0&&(n+=r),!(n<0||n>=r)){for(var e=t[n],i=n+1;i<r;++i)t[i-1]=t[i];return t.length=r-1,e}}t.firstIndexOf=n,t.lastIndexOf=r,t.findFirstIndex=e,t.findLastIndex=i,t.findFirstValue=function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=-1);var o=e(t,n,r,i);return-1!==o?t[o]:void 0},t.findLastValue=function(t,n,r,e){void 0===r&&(r=-1),void 0===e&&(e=0);var o=i(t,n,r,e);return-1!==o?t[o]:void 0},t.lowerBound=function(t,n,r,e,i){void 0===e&&(e=0),void 0===i&&(i=-1);var o=t.length;if(0===o)return 0;for(var u=e=e<0?Math.max(0,e+o):Math.min(e,o-1),a=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))-e+1;a>0;){var f=a>>1,h=u+f;r(t[h],n)<0?(u=h+1,a-=f+1):a=f}return u},t.upperBound=function(t,n,r,e,i){void 0===e&&(e=0),void 0===i&&(i=-1);var o=t.length;if(0===o)return 0;for(var u=e=e<0?Math.max(0,e+o):Math.min(e,o-1),a=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))-e+1;a>0;){var f=a>>1,h=u+f;r(t[h],n)>0?a=f:(u=h+1,a-=f+1)}return u},t.shallowEqual=function(t,n,r){if(t===n)return!0;if(t.length!==n.length)return!1;for(var e=0,i=t.length;e<i;++e)if(r?!r(t[e],n[e]):t[e]!==n[e])return!1;return!0},t.slice=function(t,n){void 0===n&&(n={});var r=n.start,e=n.stop,i=n.step;if(void 0===i&&(i=1),0===i)throw new Error("Slice `step` cannot be zero.");var o,u=t.length;void 0===r?r=i<0?u-1:0:r<0?r=Math.max(r+u,i<0?-1:0):r>=u&&(r=i<0?u-1:u),void 0===e?e=i<0?-1:u:e<0?e=Math.max(e+u,i<0?-1:0):e>=u&&(e=i<0?u-1:u),o=i<0&&e>=r||i>0&&r>=e?0:i<0?Math.floor((e-r+1)/i+1):Math.floor((e-r-1)/i+1);for(var a=[],f=0;f<o;++f)a[f]=t[r+f*i];return a},t.move=function(t,n,r){var e=t.length;if(!(e<=1)&&(n=n<0?Math.max(0,n+e):Math.min(n,e-1))!==(r=r<0?Math.max(0,r+e):Math.min(r,e-1))){for(var i=t[n],o=n<r?1:-1,u=n;u!==r;u+=o)t[u]=t[u+o];t[r]=i}},t.reverse=o,t.rotate=function(t,n,r,e){void 0===r&&(r=0),void 0===e&&(e=-1);var i=t.length;if(!(i<=1||(r=r<0?Math.max(0,r+i):Math.min(r,i-1))>=(e=e<0?Math.max(0,e+i):Math.min(e,i-1)))){var u=e-r+1;if(n>0?n%=u:n<0&&(n=(n%u+u)%u),0!==n){var a=r+n;o(t,r,a-1),o(t,a,e),o(t,r,e)}}},t.fill=function(t,n,r,e){void 0===r&&(r=0),void 0===e&&(e=-1);var i=t.length;if(0!==i){var o;r=r<0?Math.max(0,r+i):Math.min(r,i-1),o=(e=e<0?Math.max(0,e+i):Math.min(e,i-1))<r?e+1+(i-r):e-r+1;for(var u=0;u<o;++u)t[(r+u)%i]=n}},t.insert=function(t,n,r){var e=t.length;n=n<0?Math.max(0,n+e):Math.min(n,e);for(var i=e;i>n;--i)t[i]=t[i-1];t[n]=r},t.removeAt=u,t.removeFirstOf=function(t,r,e,i){void 0===e&&(e=0),void 0===i&&(i=-1);var o=n(t,r,e,i);return-1!==o&&u(t,o),o},t.removeLastOf=function(t,n,e,i){void 0===e&&(e=-1),void 0===i&&(i=0);var o=r(t,n,e,i);return-1!==o&&u(t,o),o},t.removeAllOf=function(t,n,r,e){void 0===r&&(r=0),void 0===e&&(e=-1);var i=t.length;if(0===i)return 0;r=r<0?Math.max(0,r+i):Math.min(r,i-1),e=e<0?Math.max(0,e+i):Math.min(e,i-1);for(var o=0,u=0;u<i;++u)r<=e&&u>=r&&u<=e&&t[u]===n?o++:e<r&&(u<=e||u>=r)&&t[u]===n?o++:o>0&&(t[u-o]=t[u]);return o>0&&(t.length=i-o),o},t.removeFirstWhere=function(t,n,r,i){var o;void 0===r&&(r=0),void 0===i&&(i=-1);var a=e(t,n,r,i);return-1!==a&&(o=u(t,a)),{index:a,value:o}},t.removeLastWhere=function(t,n,r,e){var o;void 0===r&&(r=-1),void 0===e&&(e=0);var a=i(t,n,r,e);return-1!==a&&(o=u(t,a)),{index:a,value:o}},t.removeAllWhere=function(t,n,r,e){void 0===r&&(r=0),void 0===e&&(e=-1);var i=t.length;if(0===i)return 0;r=r<0?Math.max(0,r+i):Math.min(r,i-1),e=e<0?Math.max(0,e+i):Math.min(e,i-1);for(var o=0,u=0;u<i;++u)r<=e&&u>=r&&u<=e&&n(t[u],u)?o++:e<r&&(u<=e||u>=r)&&n(t[u],u)?o++:o>0&&(t[u-o]=t[u]);return o>0&&(t.length=i-o),o}}(t.ArrayExt||(t.ArrayExt={}));var e=function(){function t(t){this._index=0,this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var n=new t(this._source);return n._index=this._index,n},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}(),i=function(){function t(t,n){void 0===n&&(n=Object.keys(t)),this._index=0,this._source=t,this._keys=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var n=new t(this._source,this._keys);return n._index=this._index,n},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?t:this.next()}},t}(),o=function(){function t(t,n){void 0===n&&(n=Object.keys(t)),this._index=0,this._source=t,this._keys=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var n=new t(this._source,this._keys);return n._index=this._index,n},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?this._source[t]:this.next()}},t}(),u=function(){function t(t,n){void 0===n&&(n=Object.keys(t)),this._index=0,this._source=t,this._keys=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var n=new t(this._source,this._keys);return n._index=this._index,n},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?[t,this._source[t]]:this.next()}},t}(),a=function(){function t(t){this._fn=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){throw new Error("An `FnIterator` cannot be cloned.")},t.prototype.next=function(){return this._fn.call(void 0)},t}();var f=function(){function t(t){this._cloned=!1,this._source=t,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var n=new t(this._source.clone());return n._active=this._active&&this._active.clone(),n._cloned=!0,this._cloned=!0,n},t.prototype.next=function(){if(void 0===this._active){var t=this._source.next();if(void 0===t)return;this._active=this._cloned?t.clone():t}var n=this._active.next();return void 0!==n?n:(this._active=void 0,this.next())},t}();var h=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();var c=function(){function t(t,n){this._source=t,this._index=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._index)},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return[this._index++,t]},t}();var s=function(){function t(t,n){this._index=0,this._source=t,this._fn=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var n=new t(this._source.clone(),this._fn);return n._index=this._index,n},t.prototype.next=function(){for(var t,n=this._fn,r=this._source;void 0!==(t=r.next());)if(n(t,this._index++))return t},t}();var v=function(){function t(t,n){this._index=0,this._source=t,this._fn=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var n=new t(this._source.clone(),this._fn);return n._index=this._index,n},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return this._fn.call(void 0,t,this._index++)},t}();var d,_=function(){function t(t,n,r){this._index=0,this._start=t,this._stop=n,this._step=r,this._length=d.rangeLength(t,n,r)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var n=new t(this._start,this._stop,this._step);return n._index=this._index,n},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}();!function(t){t.rangeLength=function(t,n,r){return 0===r?1/0:t>n&&r>0?0:t<n&&r<0?0:Math.ceil((n-t)/r)}}(d||(d={}));var p=function(){function t(t,n){this._value=t,this._count=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();var x=function(){function t(t){this._source=t,this._index=t.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var n=new t(this._source);return n._index=this._index,n},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();var l=function(){function t(t,n){this._source=t,this._step=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var t=this._source.next(),n=this._step-1;n>0;--n)this._source.next();return t},t}();!function(t){function n(t,n,r){void 0===r&&(r=0);for(var e=new Array(n.length),i=0,o=r,u=n.length;i<u;++i,++o){if(-1===(o=t.indexOf(n[i],o)))return null;e[i]=o}return e}t.findIndices=n,t.matchSumOfSquares=function(t,r,e){void 0===e&&(e=0);var i=n(t,r,e);if(!i)return null;for(var o=0,u=0,a=i.length;u<a;++u){var f=i[u]-e;o+=f*f}return{score:o,indices:i}},t.matchSumOfDeltas=function(t,r,e){void 0===e&&(e=0);var i=n(t,r,e);if(!i)return null;for(var o=0,u=e-1,a=0,f=i.length;a<f;++a){var h=i[a];o+=h-u-1,u=h}return{score:o,indices:i}},t.highlight=function(t,n,r){for(var e=[],i=0,o=0,u=n.length;i<u;){for(var a=n[i],f=n[i];++i<u&&n[i]===f+1;)f++;o<a&&e.push(t.slice(o,a)),a<f+1&&e.push(r(t.slice(a,f+1))),o=f+1}return o<t.length&&e.push(t.slice(o)),e},t.cmp=function(t,n){return t<n?-1:t>n?1:0}}(t.StringExt||(t.StringExt={}));var m=function(){function t(t,n){this._source=t,this._count=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var t=this._source.next();if(void 0!==t)return this._count--,t}},t}();var y=function(){function t(t){this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map((function(t){return t.clone()})))},t.prototype.next=function(){for(var t=new Array(this._source.length),n=0,r=this._source.length;n<r;++n){var e=this._source[n].next();if(void 0===e)return;t[n]=e}return t},t}();t.ArrayIterator=e,t.ChainIterator=f,t.EmptyIterator=h,t.EnumerateIterator=c,t.FilterIterator=s,t.FnIterator=a,t.ItemIterator=u,t.KeyIterator=i,t.MapIterator=v,t.RangeIterator=_,t.RepeatIterator=p,t.RetroArrayIterator=x,t.StrideIterator=l,t.TakeIterator=m,t.ValueIterator=o,t.ZipIterator=y,t.chain=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new f(n(t.map(n)))},t.each=r,t.empty=function(){return new h},t.enumerate=function(t,r){return void 0===r&&(r=0),new c(n(t),r)},t.every=function(t,r){for(var e,i=0,o=n(t);void 0!==(e=o.next());)if(!r(e,i++))return!1;return!0},t.filter=function(t,r){return new s(n(t),r)},t.find=function(t,r){for(var e,i=0,o=n(t);void 0!==(e=o.next());)if(r(e,i++))return e},t.findIndex=function(t,r){for(var e,i=0,o=n(t);void 0!==(e=o.next());)if(r(e,i++))return i-1;return-1},t.iter=n,t.iterFn=function(t){return new a(t)},t.iterItems=function(t){return new u(t)},t.iterKeys=function(t){return new i(t)},t.iterValues=function(t){return new o(t)},t.map=function(t,r){return new v(n(t),r)},t.max=function(t,r){var e=n(t),i=e.next();if(void 0!==i){for(var o=i;void 0!==(i=e.next());)r(i,o)>0&&(o=i);return o}},t.min=function(t,r){var e=n(t),i=e.next();if(void 0!==i){for(var o=i;void 0!==(i=e.next());)r(i,o)<0&&(o=i);return o}},t.minmax=function(t,r){var e=n(t),i=e.next();if(void 0!==i){for(var o=i,u=i;void 0!==(i=e.next());)r(i,o)<0?o=i:r(i,u)>0&&(u=i);return[o,u]}},t.once=function(t){return new p(t,1)},t.range=function(t,n,r){return void 0===n?new _(0,t,1):new _(t,n,void 0===r?1:r)},t.reduce=function(t,r,e){var i=0,o=n(t),u=o.next();if(void 0===u&&void 0===e)throw new TypeError("Reduce of empty iterable with no initial value.");if(void 0===u)return e;var a,f,h=o.next();if(void 0===h&&void 0===e)return u;if(void 0===h)return r(e,u,i++);for(a=r(void 0===e?u:r(e,u,i++),h,i++);void 0!==(f=o.next());)a=r(a,f,i++);return a},t.repeat=function(t,n){return new p(t,n)},t.retro=function(t){return"function"==typeof t.retro?t.retro():new x(t)},t.some=function(t,r){for(var e,i=0,o=n(t);void 0!==(e=o.next());)if(r(e,i++))return!0;return!1},t.stride=function(t,r){return new l(n(t),r)},t.take=function(t,r){return new m(n(t),r)},t.toArray=function(t){for(var r,e=0,i=[],o=n(t);void 0!==(r=o.next());)i[e++]=r;return i},t.toObject=function(t){for(var r,e=n(t),i={};void 0!==(r=e.next());)i[r[0]]=r[1];return i},t.topologicSort=function(t){var n=[],e=new Set,i=new Map;return r(t,(function(t){var n=t[0],r=t[1],e=i.get(r);e?e.push(n):i.set(r,[n])})),i.forEach((function(t,n){o(n)})),n;function o(t){if(!e.has(t)){e.add(t);var r=i.get(t);r&&r.forEach(o),n.push(t)}}},t.zip=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new y(t.map(n))},Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).lumino_algorithm={})}(this,(function(t){"use strict";function n(t){return"function"==typeof t.iter?t.iter():new e(t)}function r(t,r){for(var e,i=0,o=n(t);void 0!==(e=o.next());)if(!1===r(e,i++))return}t.ArrayExt=void 0,function(t){function n(t,n,r,e){void 0===r&&(r=0),void 0===e&&(e=-1);var i,o=t.length;if(0===o)return-1;r=r<0?Math.max(0,r+o):Math.min(r,o-1),i=(e=e<0?Math.max(0,e+o):Math.min(e,o-1))<r?e+1+(o-r):e-r+1;for(var u=0;u<i;++u){var a=(r+u)%o;if(t[a]===n)return a}return-1}function r(t,n,r,e){void 0===r&&(r=-1),void 0===e&&(e=0);var i,o=t.length;if(0===o)return-1;i=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))<(e=e<0?Math.max(0,e+o):Math.min(e,o-1))?r+1+(o-e):r-e+1;for(var u=0;u<i;++u){var a=(r-u+o)%o;if(t[a]===n)return a}return-1}function e(t,n,r,e){void 0===r&&(r=0),void 0===e&&(e=-1);var i,o=t.length;if(0===o)return-1;r=r<0?Math.max(0,r+o):Math.min(r,o-1),i=(e=e<0?Math.max(0,e+o):Math.min(e,o-1))<r?e+1+(o-r):e-r+1;for(var u=0;u<i;++u){var a=(r+u)%o;if(n(t[a],a))return a}return-1}function i(t,n,r,e){void 0===r&&(r=-1),void 0===e&&(e=0);var i,o=t.length;if(0===o)return-1;i=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))<(e=e<0?Math.max(0,e+o):Math.min(e,o-1))?r+1+(o-e):r-e+1;for(var u=0;u<i;++u){var a=(r-u+o)%o;if(n(t[a],a))return a}return-1}function o(t,n,r){void 0===n&&(n=0),void 0===r&&(r=-1);var e=t.length;if(!(e<=1))for(n=n<0?Math.max(0,n+e):Math.min(n,e-1),r=r<0?Math.max(0,r+e):Math.min(r,e-1);n<r;){var i=t[n],o=t[r];t[n++]=o,t[r--]=i}}function u(t,n){var r=t.length;if(n<0&&(n+=r),!(n<0||n>=r)){for(var e=t[n],i=n+1;i<r;++i)t[i-1]=t[i];return t.length=r-1,e}}t.firstIndexOf=n,t.lastIndexOf=r,t.findFirstIndex=e,t.findLastIndex=i,t.findFirstValue=function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=-1);var o=e(t,n,r,i);return-1!==o?t[o]:void 0},t.findLastValue=function(t,n,r,e){void 0===r&&(r=-1),void 0===e&&(e=0);var o=i(t,n,r,e);return-1!==o?t[o]:void 0},t.lowerBound=function(t,n,r,e,i){void 0===e&&(e=0),void 0===i&&(i=-1);var o=t.length;if(0===o)return 0;for(var u=e=e<0?Math.max(0,e+o):Math.min(e,o-1),a=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))-e+1;a>0;){var f=a>>1,h=u+f;r(t[h],n)<0?(u=h+1,a-=f+1):a=f}return u},t.upperBound=function(t,n,r,e,i){void 0===e&&(e=0),void 0===i&&(i=-1);var o=t.length;if(0===o)return 0;for(var u=e=e<0?Math.max(0,e+o):Math.min(e,o-1),a=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))-e+1;a>0;){var f=a>>1,h=u+f;r(t[h],n)>0?a=f:(u=h+1,a-=f+1)}return u},t.shallowEqual=function(t,n,r){if(t===n)return!0;if(t.length!==n.length)return!1;for(var e=0,i=t.length;e<i;++e)if(r?!r(t[e],n[e]):t[e]!==n[e])return!1;return!0},t.slice=function(t,n){void 0===n&&(n={});var r=n.start,e=n.stop,i=n.step;if(void 0===i&&(i=1),0===i)throw new Error("Slice `step` cannot be zero.");var o,u=t.length;void 0===r?r=i<0?u-1:0:r<0?r=Math.max(r+u,i<0?-1:0):r>=u&&(r=i<0?u-1:u),void 0===e?e=i<0?-1:u:e<0?e=Math.max(e+u,i<0?-1:0):e>=u&&(e=i<0?u-1:u),o=i<0&&e>=r||i>0&&r>=e?0:i<0?Math.floor((e-r+1)/i+1):Math.floor((e-r-1)/i+1);for(var a=[],f=0;f<o;++f)a[f]=t[r+f*i];return a},t.move=function(t,n,r){var e=t.length;if(!(e<=1)&&(n=n<0?Math.max(0,n+e):Math.min(n,e-1))!==(r=r<0?Math.max(0,r+e):Math.min(r,e-1))){for(var i=t[n],o=n<r?1:-1,u=n;u!==r;u+=o)t[u]=t[u+o];t[r]=i}},t.reverse=o,t.rotate=function(t,n,r,e){void 0===r&&(r=0),void 0===e&&(e=-1);var i=t.length;if(!(i<=1||(r=r<0?Math.max(0,r+i):Math.min(r,i-1))>=(e=e<0?Math.max(0,e+i):Math.min(e,i-1)))){var u=e-r+1;if(n>0?n%=u:n<0&&(n=(n%u+u)%u),0!==n){var a=r+n;o(t,r,a-1),o(t,a,e),o(t,r,e)}}},t.fill=function(t,n,r,e){void 0===r&&(r=0),void 0===e&&(e=-1);var i=t.length;if(0!==i){var o;r=r<0?Math.max(0,r+i):Math.min(r,i-1),o=(e=e<0?Math.max(0,e+i):Math.min(e,i-1))<r?e+1+(i-r):e-r+1;for(var u=0;u<o;++u)t[(r+u)%i]=n}},t.insert=function(t,n,r){var e=t.length;n=n<0?Math.max(0,n+e):Math.min(n,e);for(var i=e;i>n;--i)t[i]=t[i-1];t[n]=r},t.removeAt=u,t.removeFirstOf=function(t,r,e,i){void 0===e&&(e=0),void 0===i&&(i=-1);var o=n(t,r,e,i);return-1!==o&&u(t,o),o},t.removeLastOf=function(t,n,e,i){void 0===e&&(e=-1),void 0===i&&(i=0);var o=r(t,n,e,i);return-1!==o&&u(t,o),o},t.removeAllOf=function(t,n,r,e){void 0===r&&(r=0),void 0===e&&(e=-1);var i=t.length;if(0===i)return 0;r=r<0?Math.max(0,r+i):Math.min(r,i-1),e=e<0?Math.max(0,e+i):Math.min(e,i-1);for(var o=0,u=0;u<i;++u)r<=e&&u>=r&&u<=e&&t[u]===n||e<r&&(u<=e||u>=r)&&t[u]===n?o++:o>0&&(t[u-o]=t[u]);return o>0&&(t.length=i-o),o},t.removeFirstWhere=function(t,n,r,i){var o;void 0===r&&(r=0),void 0===i&&(i=-1);var a=e(t,n,r,i);return-1!==a&&(o=u(t,a)),{index:a,value:o}},t.removeLastWhere=function(t,n,r,e){var o;void 0===r&&(r=-1),void 0===e&&(e=0);var a=i(t,n,r,e);return-1!==a&&(o=u(t,a)),{index:a,value:o}},t.removeAllWhere=function(t,n,r,e){void 0===r&&(r=0),void 0===e&&(e=-1);var i=t.length;if(0===i)return 0;r=r<0?Math.max(0,r+i):Math.min(r,i-1),e=e<0?Math.max(0,e+i):Math.min(e,i-1);for(var o=0,u=0;u<i;++u)r<=e&&u>=r&&u<=e&&n(t[u],u)||e<r&&(u<=e||u>=r)&&n(t[u],u)?o++:o>0&&(t[u-o]=t[u]);return o>0&&(t.length=i-o),o}}(t.ArrayExt||(t.ArrayExt={}));var e=function(){function t(t){this._index=0,this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var n=new t(this._source);return n._index=this._index,n},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}(),i=function(){function t(t,n){void 0===n&&(n=Object.keys(t)),this._index=0,this._source=t,this._keys=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var n=new t(this._source,this._keys);return n._index=this._index,n},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?t:this.next()}},t}(),o=function(){function t(t,n){void 0===n&&(n=Object.keys(t)),this._index=0,this._source=t,this._keys=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var n=new t(this._source,this._keys);return n._index=this._index,n},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?this._source[t]:this.next()}},t}(),u=function(){function t(t,n){void 0===n&&(n=Object.keys(t)),this._index=0,this._source=t,this._keys=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var n=new t(this._source,this._keys);return n._index=this._index,n},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?[t,this._source[t]]:this.next()}},t}(),a=function(){function t(t){this._fn=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){throw new Error("An `FnIterator` cannot be cloned.")},t.prototype.next=function(){return this._fn.call(void 0)},t}();var f=function(){function t(t){this._cloned=!1,this._source=t,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var n=new t(this._source.clone());return n._active=this._active&&this._active.clone(),n._cloned=!0,this._cloned=!0,n},t.prototype.next=function(){if(void 0===this._active){var t=this._source.next();if(void 0===t)return;this._active=this._cloned?t.clone():t}var n=this._active.next();return void 0!==n?n:(this._active=void 0,this.next())},t}();var h=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();var c=function(){function t(t,n){this._source=t,this._index=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._index)},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return[this._index++,t]},t}();var s=function(){function t(t,n){this._index=0,this._source=t,this._fn=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var n=new t(this._source.clone(),this._fn);return n._index=this._index,n},t.prototype.next=function(){for(var t,n=this._fn,r=this._source;void 0!==(t=r.next());)if(n(t,this._index++))return t},t}();var v=function(){function t(t,n){this._index=0,this._source=t,this._fn=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var n=new t(this._source.clone(),this._fn);return n._index=this._index,n},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return this._fn.call(void 0,t,this._index++)},t}();var d,_=function(){function t(t,n,r){this._index=0,this._start=t,this._stop=n,this._step=r,this._length=d.rangeLength(t,n,r)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var n=new t(this._start,this._stop,this._step);return n._index=this._index,n},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}();!function(t){t.rangeLength=function(t,n,r){return 0===r?1/0:t>n&&r>0||t<n&&r<0?0:Math.ceil((n-t)/r)}}(d||(d={}));var p=function(){function t(t,n){this._value=t,this._count=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();var x=function(){function t(t){this._source=t,this._index=t.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var n=new t(this._source);return n._index=this._index,n},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();var l=function(){function t(t,n){this._source=t,this._step=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var t=this._source.next(),n=this._step-1;n>0;--n)this._source.next();return t},t}();t.StringExt=void 0,function(t){function n(t,n,r){void 0===r&&(r=0);for(var e=new Array(n.length),i=0,o=r,u=n.length;i<u;++i,++o){if(-1===(o=t.indexOf(n[i],o)))return null;e[i]=o}return e}t.findIndices=n,t.matchSumOfSquares=function(t,r,e){void 0===e&&(e=0);var i=n(t,r,e);if(!i)return null;for(var o=0,u=0,a=i.length;u<a;++u){var f=i[u]-e;o+=f*f}return{score:o,indices:i}},t.matchSumOfDeltas=function(t,r,e){void 0===e&&(e=0);var i=n(t,r,e);if(!i)return null;for(var o=0,u=e-1,a=0,f=i.length;a<f;++a){var h=i[a];o+=h-u-1,u=h}return{score:o,indices:i}},t.highlight=function(t,n,r){for(var e=[],i=0,o=0,u=n.length;i<u;){for(var a=n[i],f=n[i];++i<u&&n[i]===f+1;)f++;o<a&&e.push(t.slice(o,a)),a<f+1&&e.push(r(t.slice(a,f+1))),o=f+1}return o<t.length&&e.push(t.slice(o)),e},t.cmp=function(t,n){return t<n?-1:t>n?1:0}}(t.StringExt||(t.StringExt={}));var m=function(){function t(t,n){this._source=t,this._count=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var t=this._source.next();if(void 0!==t)return this._count--,t}},t}();var y=function(){function t(t){this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map((function(t){return t.clone()})))},t.prototype.next=function(){for(var t=new Array(this._source.length),n=0,r=this._source.length;n<r;++n){var e=this._source[n].next();if(void 0===e)return;t[n]=e}return t},t}();t.ArrayIterator=e,t.ChainIterator=f,t.EmptyIterator=h,t.EnumerateIterator=c,t.FilterIterator=s,t.FnIterator=a,t.ItemIterator=u,t.KeyIterator=i,t.MapIterator=v,t.RangeIterator=_,t.RepeatIterator=p,t.RetroArrayIterator=x,t.StrideIterator=l,t.TakeIterator=m,t.ValueIterator=o,t.ZipIterator=y,t.chain=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new f(n(t.map(n)))},t.each=r,t.empty=function(){return new h},t.enumerate=function(t,r){return void 0===r&&(r=0),new c(n(t),r)},t.every=function(t,r){for(var e,i=0,o=n(t);void 0!==(e=o.next());)if(!r(e,i++))return!1;return!0},t.filter=function(t,r){return new s(n(t),r)},t.find=function(t,r){for(var e,i=0,o=n(t);void 0!==(e=o.next());)if(r(e,i++))return e},t.findIndex=function(t,r){for(var e,i=0,o=n(t);void 0!==(e=o.next());)if(r(e,i++))return i-1;return-1},t.iter=n,t.iterFn=function(t){return new a(t)},t.iterItems=function(t){return new u(t)},t.iterKeys=function(t){return new i(t)},t.iterValues=function(t){return new o(t)},t.map=function(t,r){return new v(n(t),r)},t.max=function(t,r){var e=n(t),i=e.next();if(void 0!==i){for(var o=i;void 0!==(i=e.next());)r(i,o)>0&&(o=i);return o}},t.min=function(t,r){var e=n(t),i=e.next();if(void 0!==i){for(var o=i;void 0!==(i=e.next());)r(i,o)<0&&(o=i);return o}},t.minmax=function(t,r){var e=n(t),i=e.next();if(void 0!==i){for(var o=i,u=i;void 0!==(i=e.next());)r(i,o)<0?o=i:r(i,u)>0&&(u=i);return[o,u]}},t.once=function(t){return new p(t,1)},t.range=function(t,n,r){return void 0===n?new _(0,t,1):new _(t,n,void 0===r?1:r)},t.reduce=function(t,r,e){var i=0,o=n(t),u=o.next();if(void 0===u&&void 0===e)throw new TypeError("Reduce of empty iterable with no initial value.");if(void 0===u)return e;var a,f,h=o.next();if(void 0===h&&void 0===e)return u;if(void 0===h)return r(e,u,i++);for(a=r(void 0===e?u:r(e,u,i++),h,i++);void 0!==(f=o.next());)a=r(a,f,i++);return a},t.repeat=function(t,n){return new p(t,n)},t.retro=function(t){return"function"==typeof t.retro?t.retro():new x(t)},t.some=function(t,r){for(var e,i=0,o=n(t);void 0!==(e=o.next());)if(r(e,i++))return!0;return!1},t.stride=function(t,r){return new l(n(t),r)},t.take=function(t,r){return new m(n(t),r)},t.toArray=function(t){for(var r,e=0,i=[],o=n(t);void 0!==(r=o.next());)i[e++]=r;return i},t.toObject=function(t){for(var r,e=n(t),i={};void 0!==(r=e.next());)i[r[0]]=r[1];return i},t.topologicSort=function(t){var n=[],e=new Set,i=new Map;return r(t,(function(t){var n=t[0],r=t[1],e=i.get(r);e?e.push(n):i.set(r,[n])})),i.forEach((function(t,n){o(n)})),n;function o(t){if(!e.has(t)){e.add(t);var r=i.get(t);r&&r.forEach(o),n.push(t)}}},t.zip=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new y(t.map(n))},Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.min.js.map |
{ | ||
"name": "@lumino/algorithm", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "Lumino Algorithms and Iterators", | ||
@@ -21,2 +21,7 @@ "homepage": "https://github.com/jupyterlab/lumino", | ||
], | ||
"main": "dist/index.js", | ||
"jsdelivr": "dist/index.min.js", | ||
"unpkg": "dist/index.min.js", | ||
"module": "dist/index.es6", | ||
"types": "types/index.d.ts", | ||
"files": [ | ||
@@ -27,6 +32,2 @@ "dist/*", | ||
], | ||
"main": "dist/index.js", | ||
"unpkg": "dist/index.min.js", | ||
"module": "dist/index.es6", | ||
"types": "types/index.d.ts", | ||
"scripts": { | ||
@@ -50,17 +51,17 @@ "api": "api-extractor run --local --verbose", | ||
"@types/mocha": "^2.2.39", | ||
"chai": "^3.5.0", | ||
"karma": "^4.4.1", | ||
"karma-chrome-launcher": "^2.0.0", | ||
"karma-firefox-launcher": "^1.0.0", | ||
"chai": "^4.3.4", | ||
"karma": "^6.3.4", | ||
"karma-chrome-launcher": "^3.1.0", | ||
"karma-firefox-launcher": "^2.1.1", | ||
"karma-ie-launcher": "^1.0.0", | ||
"karma-mocha": "^1.3.0", | ||
"karma-mocha-reporter": "^2.2.2", | ||
"mocha": "^6.2.2", | ||
"rimraf": "^2.5.2", | ||
"rollup": "^2.22.1", | ||
"karma-mocha": "^2.0.1", | ||
"karma-mocha-reporter": "^2.2.5", | ||
"mocha": "^9.0.3", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.56.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-postcss": "^2.0.3", | ||
"rollup-plugin-sourcemaps": "^0.5.0", | ||
"terser": "^4.6.2", | ||
"tslib": "1.10.0", | ||
"rollup-plugin-postcss": "^4.0.0", | ||
"rollup-plugin-sourcemaps": "^0.6.3", | ||
"terser": "^5.7.1", | ||
"tslib": "^2.3.0", | ||
"typedoc": "~0.15.0", | ||
@@ -73,5 +74,3 @@ "typescript": "~3.6.0", | ||
"access": "public" | ||
}, | ||
"jsdelivr": "dist/index.min.js", | ||
"gitHead": "cbb8cfd804b647ff7a150799353b27c2dc17f373" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
0
12605
846988
61