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

@lumino/collections

Package Overview
Dependencies
Maintainers
4
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lumino/collections - npm Package Compare versions

Comparing version 1.3.1 to 1.3.2

34

dist/index.es6.js

@@ -30,3 +30,3 @@ import { each, empty, ArrayExt } from '@lumino/algorithm';

},
enumerable: false,
enumerable: true,
configurable: true

@@ -44,3 +44,3 @@ });

},
enumerable: false,
enumerable: true,
configurable: true

@@ -61,3 +61,3 @@ });

},
enumerable: false,
enumerable: true,
configurable: true

@@ -78,3 +78,3 @@ });

},
enumerable: false,
enumerable: true,
configurable: true

@@ -347,3 +347,3 @@ });

},
enumerable: false,
enumerable: true,
configurable: true

@@ -358,3 +358,3 @@ });

},
enumerable: false,
enumerable: true,
configurable: true

@@ -369,3 +369,3 @@ });

},
enumerable: false,
enumerable: true,
configurable: true

@@ -401,3 +401,3 @@ });

},
enumerable: false,
enumerable: true,
configurable: true

@@ -412,3 +412,3 @@ });

},
enumerable: false,
enumerable: true,
configurable: true

@@ -423,3 +423,3 @@ });

},
enumerable: false,
enumerable: true,
configurable: true

@@ -1382,3 +1382,3 @@ });

},
enumerable: false,
enumerable: true,
configurable: true

@@ -1399,3 +1399,3 @@ });

},
enumerable: false,
enumerable: true,
configurable: true

@@ -1418,3 +1418,3 @@ });

},
enumerable: false,
enumerable: true,
configurable: true

@@ -1434,3 +1434,3 @@ });

},
enumerable: false,
enumerable: true,
configurable: true

@@ -1450,3 +1450,3 @@ });

},
enumerable: false,
enumerable: true,
configurable: true

@@ -1466,3 +1466,3 @@ });

},
enumerable: false,
enumerable: true,
configurable: true

@@ -1482,3 +1482,3 @@ });

},
enumerable: false,
enumerable: true,
configurable: true

@@ -1485,0 +1485,0 @@ });

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@lumino/algorithm")):"function"==typeof define&&define.amd?define(["exports","@lumino/algorithm"],e):e((t=t||self).lumino_collections={},t.lumino_algorithm)}(this,(function(t,e){"use strict";var i,r,n;t.BPlusTree=function(){function t(t){this._root=new r.LeafNode,this.cmp=t}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return 0===this._root.size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._root.size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"first",{get:function(){var t=r.firstLeaf(this._root);return t.size>0?t.items[0]:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){var t=r.lastLeaf(this._root);return t.size>0?t.items[t.size-1]:void 0},enumerable:!1,configurable:!0}),t.prototype.iter=function(){return r.iterItems(this._root)},t.prototype.retro=function(){return r.retroItems(this._root)},t.prototype.slice=function(t,e){return r.sliceItems(this._root,t,e)},t.prototype.retroSlice=function(t,e){return r.retroSliceItems(this._root,t,e)},t.prototype.at=function(t){return r.itemAt(this._root,t)},t.prototype.has=function(t,e){return r.hasItem(this._root,t,e)},t.prototype.indexOf=function(t,e){return r.indexOf(this._root,t,e)},t.prototype.get=function(t,e){return r.getItem(this._root,t,e)},t.prototype.assign=function(t){this.clear(),this.update(t)},t.prototype.insert=function(t){var e=r.insertItem(this._root,t,this.cmp);return this._root=r.maybeSplitRoot(this._root),e},t.prototype.update=function(t){var i=this;e.each(t,(function(t){i.insert(t)}))},t.prototype.delete=function(t,e){var i=r.deleteItem(this._root,t,e);return this._root=r.maybeExtractRoot(this._root),i},t.prototype.remove=function(t){var e=r.removeItem(this._root,t);return this._root=r.maybeExtractRoot(this._root),e},t.prototype.clear=function(){r.clear(this._root),this._root=new r.LeafNode},t}(),(i=t.BPlusTree||(t.BPlusTree={})).from=function(t,e){var r=new i(e);return r.assign(t),r},function(t){var i=function(){function t(){this.items=[],this.sizes=[],this.children=[]}return Object.defineProperty(t.prototype,"type",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.sizes[this.sizes.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.children.length},enumerable:!1,configurable:!0}),t}();t.BranchNode=i;var r=function(){function t(){this.next=null,this.prev=null,this.items=[]}return Object.defineProperty(t.prototype,"type",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.items.length},enumerable:!1,configurable:!0}),t}();function n(t){for(;0===t.type;)t=t.children[0];return t}function o(t){for(;0===t.type;)t=t.children[t.children.length-1];return t}function s(t){0===t.type?(e.each(t.children,s),t.children.length=0,t.sizes.length=0,t.items.length=0):(t.items.length=0,t.next=null,t.prev=null)}t.LeafNode=r,t.firstLeaf=n,t.lastLeaf=o,t.iterItems=function(t){var e=n(t);return new f(e,0,-1)},t.retroItems=function(t){var e=o(t);return new l(e,e.size-1,-1)},t.sliceItems=function(t,i,r){i=void 0===i?0:i<0?Math.max(0,i+t.size):Math.min(i,t.size),r=void 0===r?t.size:r<0?Math.max(0,r+t.size):Math.min(r,t.size);var n=Math.max(0,r-i);if(0===n)return e.empty();for(;0===t.type;){var o=p(t.sizes,i);o>0&&(i-=t.sizes[o-1]),t=t.children[o]}return new f(t,i,n)},t.retroSliceItems=function(t,i,r){i=void 0===i?t.size-1:i<0?Math.max(-1,i+t.size):Math.min(i,t.size-1),r=void 0===r?-1:r<0?Math.max(-1,r+t.size):Math.min(r,t.size-1);var n=Math.max(0,i-r);if(0===n)return e.empty();for(;0===t.type;){var o=p(t.sizes,i);o>0&&(i-=t.sizes[o-1]),t=t.children[o]}return new l(t,i,n)},t.itemAt=function(t,e){if(e<0&&(e+=t.size),!(e<0||e>=t.size)){for(;0===t.type;){var i=p(t.sizes,e);i>0&&(e-=t.sizes[i-1]),t=t.children[i]}return t.items[e]}},t.hasItem=function(t,e,i){for(;0===t.type;){var r=a(t.items,e,i);t=t.children[r]}return c(t.items,e,i)>=0},t.indexOf=function(t,e,i){for(var r=0;0===t.type;){var n=a(t.items,e,i);n>0&&(r+=t.sizes[n-1]),t=t.children[n]}var o=c(t.items,e,i);return o>=0?r+o:-r+o},t.getItem=function(t,e,i){for(;0===t.type;){var r=a(t.items,e,i);t=t.children[r]}var n=c(t.items,e,i);return n>=0?t.items[n]:void 0},t.insertItem=function t(i,r,n){if(1===i.type){var o,s=c(i.items,r,n);return s>=0?(o=i.items[s],i.items[s]=r):(o=void 0,e.ArrayExt.insert(i.items,-s-1,r)),o}var h=a(i.items,r,n),f=i.children[h],l=f.size,p=t(f,r,n),_=f.size;if(i.items[h]=f.items[0],l===_)return p;if(f.width>u){var y=m(f);e.ArrayExt.insert(i.children,h+1,y),e.ArrayExt.insert(i.items,h+1,y.items[0])}return d(i,h),p},t.deleteItem=function t(i,r,n){if(1===i.type){var o=c(i.items,r,n);if(o<0)return;return e.ArrayExt.removeAt(i.items,o)}var s=a(i.items,r,n),u=i.children[s],f=u.size,l=t(u,r,n);return f===u.size?l:(i.items[s]=u.items[0],u.width<h&&(s=_(i,s)),d(i,s),l)},t.removeItem=function t(i,r){if(r<0&&(r+=i.size),!(r<0||r>=i.size)){if(1===i.type)return e.ArrayExt.removeAt(i.items,r);var n=p(i.sizes,r);n>0&&(r-=i.sizes[n]);var o=i.children[n],s=t(o,r);return i.items[n]=o.items[0],o.width<h&&(n=_(i,n)),d(i,n),s}},t.clear=s,t.maybeSplitRoot=function(t){if(t.width<=u)return t;var e=new i,r=m(t);return e.sizes[0]=t.size,e.sizes[1]=t.size+r.size,e.children[0]=t,e.children[1]=r,e.items[0]=t.items[0],e.items[1]=r.items[0],e},t.maybeExtractRoot=function(t){if(1===t.type)return t;if(t.children.length>1)return t;var e=t.children.pop();return s(t),e};var u=32,h=u>>1,f=function(){function t(t,e,i){this._node=t,this._index=e,this._count=i}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node,this._index,this._count)},t.prototype.next=function(){if(null!==this._node&&0!==this._count)return this._index>=this._node.size?(this._node=this._node.next,this._index=0,this.next()):(this._count>0&&this._count--,this._node.items[this._index++])},t}(),l=function(){function t(t,e,i){this._node=t,this._index=e,this._count=i}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node,this._index,this._count)},t.prototype.next=function(){if(null!==this._node&&0!==this._count)return this._index>=this._node.size&&(this._index=this._node.size-1),this._index<0?(this._node=this._node.prev,this._index=this._node?this._node.size-1:-1,this.next()):(this._count>0&&this._count--,this._node.items[this._index--])},t}();function p(t,e){for(var i=t.length,r=0;r<i;++r)if(t[r]>e)return r;return i-1}function a(t,e,i){for(var r=t.length,n=1;n<r;++n)if(i(t[n],e)>0)return n-1;return r-1}function c(t,e,i){for(var r=t.length,n=0;n<r;++n){var o=i(t[n],e);if(0===o)return n;if(o>0)return-n-1}return-r-1}function d(t,e){for(var i=t.sizes,r=t.children,n=e>0?i[e-1]:0,o=r.length;e<o;++e)n=i[e]=n+r[e].size;i.length=r.length}function m(t){if(1===t.type){for(var e=new r,n=t.items,o=e.items,s=h,u=n.length;s<u;++s)o.push(n[s]);return n.length=h,t.next&&(t.next.prev=e),e.next=t.next,e.prev=t,t.next=e,e}var f=new i,l=t.children,p=f.children;for(s=h,u=l.length;s<u;++s)p.push(l[s]);l.length=h;var a=t.items,c=f.items;for(s=h,u=a.length;s<u;++s)c.push(a[s]);return a.length=h,d(t,h),d(f,0),f}function _(t,i){var r,n,o,u,f,l,p=t.children[i],a=0===i?t.children[i+1]:t.children[i-1],c=0===i,m=1===p.type,_=a.width>h;if(m&&_&&c){var y=a;return(v=p).items.push(y.items.shift()),t.items[i+1]=y.items[0],i}if(m&&_&&!c){y=a;return(v=p).items.unshift(y.items.pop()),t.items[i]=v.items[0],i-1}if(m&&!_&&c){var v=p;return(r=(y=a).items).unshift.apply(r,v.items),e.ArrayExt.removeAt(t.children,i),e.ArrayExt.removeAt(t.items,i+1),v.prev&&(v.prev.next=y),y.prev=v.prev,s(v),i}if(m&&!_&&!c){v=p;return(n=(y=a).items).push.apply(n,v.items),e.ArrayExt.removeAt(t.children,i),e.ArrayExt.removeAt(t.items,i),v.next&&(v.next.prev=y),y.next=v.next,s(v),i-1}if(!m&&_&&c){y=a;return(v=p).children.push(y.children.shift()),v.items.push(y.items.shift()),t.items[i+1]=y.items[0],d(v,v.width-1),d(y,0),i}if(!m&&_&&!c){y=a;return(v=p).children.unshift(y.children.pop()),v.items.unshift(y.items.pop()),t.items[i]=v.items[0],d(v,0),d(y,y.width-1),i-1}if(!m&&!_&&c){v=p;return(o=(y=a).children).unshift.apply(o,v.children),(u=y.items).unshift.apply(u,v.items),e.ArrayExt.removeAt(t.children,i),e.ArrayExt.removeAt(t.items,i+1),d(y,0),v.children.length=0,s(v),i}if(!m&&!_&&!c){v=p;return(f=(y=a).children).push.apply(f,v.children),(l=y.items).push.apply(l,v.items),e.ArrayExt.removeAt(t.children,i),e.ArrayExt.removeAt(t.items,i),d(y,0),v.children.length=0,s(v),i-1}throw"unreachable"}}(r||(r={})),t.LinkedList=function(){function t(){this._first=null,this._last=null,this._size=0}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return 0===this._size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"first",{get:function(){return this._first?this._first.value:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){return this._last?this._last.value:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"firstNode",{get:function(){return this._first},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastNode",{get:function(){return this._last},enumerable:!1,configurable:!0}),t.prototype.iter=function(){return new t.ForwardValueIterator(this._first)},t.prototype.retro=function(){return new t.RetroValueIterator(this._last)},t.prototype.nodes=function(){return new t.ForwardNodeIterator(this._first)},t.prototype.retroNodes=function(){return new t.RetroNodeIterator(this._last)},t.prototype.assign=function(t){var i=this;this.clear(),e.each(t,(function(t){i.addLast(t)}))},t.prototype.push=function(t){this.addLast(t)},t.prototype.pop=function(){return this.removeLast()},t.prototype.shift=function(t){this.addFirst(t)},t.prototype.unshift=function(){return this.removeFirst()},t.prototype.addFirst=function(t){var e=new n.LinkedListNode(this,t);return this._first?(e.next=this._first,this._first.prev=e,this._first=e):(this._first=e,this._last=e),this._size++,e},t.prototype.addLast=function(t){var e=new n.LinkedListNode(this,t);return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._first=e,this._last=e),this._size++,e},t.prototype.insertBefore=function(t,e){if(!e||e===this._first)return this.addFirst(t);if(!(e instanceof n.LinkedListNode)||e.list!==this)throw new Error("Reference node is not owned by the list.");var i=new n.LinkedListNode(this,t),r=e,o=r.prev;return i.next=r,i.prev=o,r.prev=i,o.next=i,this._size++,i},t.prototype.insertAfter=function(t,e){if(!e||e===this._last)return this.addLast(t);if(!(e instanceof n.LinkedListNode)||e.list!==this)throw new Error("Reference node is not owned by the list.");var i=new n.LinkedListNode(this,t),r=e,o=r.next;return i.next=o,i.prev=r,r.next=i,o.prev=i,this._size++,i},t.prototype.removeFirst=function(){var t=this._first;if(t)return t===this._last?(this._first=null,this._last=null):(this._first=t.next,this._first.prev=null),t.list=null,t.next=null,t.prev=null,this._size--,t.value},t.prototype.removeLast=function(){var t=this._last;if(t)return t===this._first?(this._first=null,this._last=null):(this._last=t.prev,this._last.next=null),t.list=null,t.next=null,t.prev=null,this._size--,t.value},t.prototype.removeNode=function(t){if(!(t instanceof n.LinkedListNode)||t.list!==this)throw new Error("Node is not owned by the list.");var e=t;e===this._first&&e===this._last?(this._first=null,this._last=null):e===this._first?(this._first=e.next,this._first.prev=null):e===this._last?(this._last=e.prev,this._last.next=null):(e.next.prev=e.prev,e.prev.next=e.next),e.list=null,e.next=null,e.prev=null,this._size--},t.prototype.clear=function(){for(var t=this._first;t;){var e=t.next;t.list=null,t.prev=null,t.next=null,t=e}this._first=null,this._last=null,this._size=0},t}(),function(t){t.from=function(e){var i=new t;return i.assign(e),i};var e=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.next,t.value}},t}();t.ForwardValueIterator=e;var i=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.prev,t.value}},t}();t.RetroValueIterator=i;var r=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.next,t}},t}();t.ForwardNodeIterator=r;var n=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.prev,t}},t}();t.RetroNodeIterator=n}(t.LinkedList||(t.LinkedList={})),function(t){var e=function(t,e){this.list=null,this.next=null,this.prev=null,this.list=t,this.value=e};t.LinkedListNode=e}(n||(n={})),Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@lumino/algorithm")):"function"==typeof define&&define.amd?define(["exports","@lumino/algorithm"],e):e((t=t||self).lumino_collections={},t.lumino_algorithm)}(this,(function(t,e){"use strict";var i,r,n;t.BPlusTree=function(){function t(t){this._root=new r.LeafNode,this.cmp=t}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return 0===this._root.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._root.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"first",{get:function(){var t=r.firstLeaf(this._root);return t.size>0?t.items[0]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){var t=r.lastLeaf(this._root);return t.size>0?t.items[t.size-1]:void 0},enumerable:!0,configurable:!0}),t.prototype.iter=function(){return r.iterItems(this._root)},t.prototype.retro=function(){return r.retroItems(this._root)},t.prototype.slice=function(t,e){return r.sliceItems(this._root,t,e)},t.prototype.retroSlice=function(t,e){return r.retroSliceItems(this._root,t,e)},t.prototype.at=function(t){return r.itemAt(this._root,t)},t.prototype.has=function(t,e){return r.hasItem(this._root,t,e)},t.prototype.indexOf=function(t,e){return r.indexOf(this._root,t,e)},t.prototype.get=function(t,e){return r.getItem(this._root,t,e)},t.prototype.assign=function(t){this.clear(),this.update(t)},t.prototype.insert=function(t){var e=r.insertItem(this._root,t,this.cmp);return this._root=r.maybeSplitRoot(this._root),e},t.prototype.update=function(t){var i=this;e.each(t,(function(t){i.insert(t)}))},t.prototype.delete=function(t,e){var i=r.deleteItem(this._root,t,e);return this._root=r.maybeExtractRoot(this._root),i},t.prototype.remove=function(t){var e=r.removeItem(this._root,t);return this._root=r.maybeExtractRoot(this._root),e},t.prototype.clear=function(){r.clear(this._root),this._root=new r.LeafNode},t}(),(i=t.BPlusTree||(t.BPlusTree={})).from=function(t,e){var r=new i(e);return r.assign(t),r},function(t){var i=function(){function t(){this.items=[],this.sizes=[],this.children=[]}return Object.defineProperty(t.prototype,"type",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.sizes[this.sizes.length-1]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.children.length},enumerable:!0,configurable:!0}),t}();t.BranchNode=i;var r=function(){function t(){this.next=null,this.prev=null,this.items=[]}return Object.defineProperty(t.prototype,"type",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),t}();function n(t){for(;0===t.type;)t=t.children[0];return t}function o(t){for(;0===t.type;)t=t.children[t.children.length-1];return t}function s(t){0===t.type?(e.each(t.children,s),t.children.length=0,t.sizes.length=0,t.items.length=0):(t.items.length=0,t.next=null,t.prev=null)}t.LeafNode=r,t.firstLeaf=n,t.lastLeaf=o,t.iterItems=function(t){var e=n(t);return new f(e,0,-1)},t.retroItems=function(t){var e=o(t);return new l(e,e.size-1,-1)},t.sliceItems=function(t,i,r){i=void 0===i?0:i<0?Math.max(0,i+t.size):Math.min(i,t.size),r=void 0===r?t.size:r<0?Math.max(0,r+t.size):Math.min(r,t.size);var n=Math.max(0,r-i);if(0===n)return e.empty();for(;0===t.type;){var o=p(t.sizes,i);o>0&&(i-=t.sizes[o-1]),t=t.children[o]}return new f(t,i,n)},t.retroSliceItems=function(t,i,r){i=void 0===i?t.size-1:i<0?Math.max(-1,i+t.size):Math.min(i,t.size-1),r=void 0===r?-1:r<0?Math.max(-1,r+t.size):Math.min(r,t.size-1);var n=Math.max(0,i-r);if(0===n)return e.empty();for(;0===t.type;){var o=p(t.sizes,i);o>0&&(i-=t.sizes[o-1]),t=t.children[o]}return new l(t,i,n)},t.itemAt=function(t,e){if(e<0&&(e+=t.size),!(e<0||e>=t.size)){for(;0===t.type;){var i=p(t.sizes,e);i>0&&(e-=t.sizes[i-1]),t=t.children[i]}return t.items[e]}},t.hasItem=function(t,e,i){for(;0===t.type;){var r=a(t.items,e,i);t=t.children[r]}return c(t.items,e,i)>=0},t.indexOf=function(t,e,i){for(var r=0;0===t.type;){var n=a(t.items,e,i);n>0&&(r+=t.sizes[n-1]),t=t.children[n]}var o=c(t.items,e,i);return o>=0?r+o:-r+o},t.getItem=function(t,e,i){for(;0===t.type;){var r=a(t.items,e,i);t=t.children[r]}var n=c(t.items,e,i);return n>=0?t.items[n]:void 0},t.insertItem=function t(i,r,n){if(1===i.type){var o,s=c(i.items,r,n);return s>=0?(o=i.items[s],i.items[s]=r):(o=void 0,e.ArrayExt.insert(i.items,-s-1,r)),o}var h=a(i.items,r,n),f=i.children[h],l=f.size,p=t(f,r,n),_=f.size;if(i.items[h]=f.items[0],l===_)return p;if(f.width>u){var y=m(f);e.ArrayExt.insert(i.children,h+1,y),e.ArrayExt.insert(i.items,h+1,y.items[0])}return d(i,h),p},t.deleteItem=function t(i,r,n){if(1===i.type){var o=c(i.items,r,n);if(o<0)return;return e.ArrayExt.removeAt(i.items,o)}var s=a(i.items,r,n),u=i.children[s],f=u.size,l=t(u,r,n);return f===u.size?l:(i.items[s]=u.items[0],u.width<h&&(s=_(i,s)),d(i,s),l)},t.removeItem=function t(i,r){if(r<0&&(r+=i.size),!(r<0||r>=i.size)){if(1===i.type)return e.ArrayExt.removeAt(i.items,r);var n=p(i.sizes,r);n>0&&(r-=i.sizes[n]);var o=i.children[n],s=t(o,r);return i.items[n]=o.items[0],o.width<h&&(n=_(i,n)),d(i,n),s}},t.clear=s,t.maybeSplitRoot=function(t){if(t.width<=u)return t;var e=new i,r=m(t);return e.sizes[0]=t.size,e.sizes[1]=t.size+r.size,e.children[0]=t,e.children[1]=r,e.items[0]=t.items[0],e.items[1]=r.items[0],e},t.maybeExtractRoot=function(t){if(1===t.type)return t;if(t.children.length>1)return t;var e=t.children.pop();return s(t),e};var u=32,h=u>>1,f=function(){function t(t,e,i){this._node=t,this._index=e,this._count=i}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node,this._index,this._count)},t.prototype.next=function(){if(null!==this._node&&0!==this._count)return this._index>=this._node.size?(this._node=this._node.next,this._index=0,this.next()):(this._count>0&&this._count--,this._node.items[this._index++])},t}(),l=function(){function t(t,e,i){this._node=t,this._index=e,this._count=i}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node,this._index,this._count)},t.prototype.next=function(){if(null!==this._node&&0!==this._count)return this._index>=this._node.size&&(this._index=this._node.size-1),this._index<0?(this._node=this._node.prev,this._index=this._node?this._node.size-1:-1,this.next()):(this._count>0&&this._count--,this._node.items[this._index--])},t}();function p(t,e){for(var i=t.length,r=0;r<i;++r)if(t[r]>e)return r;return i-1}function a(t,e,i){for(var r=t.length,n=1;n<r;++n)if(i(t[n],e)>0)return n-1;return r-1}function c(t,e,i){for(var r=t.length,n=0;n<r;++n){var o=i(t[n],e);if(0===o)return n;if(o>0)return-n-1}return-r-1}function d(t,e){for(var i=t.sizes,r=t.children,n=e>0?i[e-1]:0,o=r.length;e<o;++e)n=i[e]=n+r[e].size;i.length=r.length}function m(t){if(1===t.type){for(var e=new r,n=t.items,o=e.items,s=h,u=n.length;s<u;++s)o.push(n[s]);return n.length=h,t.next&&(t.next.prev=e),e.next=t.next,e.prev=t,t.next=e,e}var f=new i,l=t.children,p=f.children;for(s=h,u=l.length;s<u;++s)p.push(l[s]);l.length=h;var a=t.items,c=f.items;for(s=h,u=a.length;s<u;++s)c.push(a[s]);return a.length=h,d(t,h),d(f,0),f}function _(t,i){var r,n,o,u,f,l,p=t.children[i],a=0===i?t.children[i+1]:t.children[i-1],c=0===i,m=1===p.type,_=a.width>h;if(m&&_&&c){var y=a;return(v=p).items.push(y.items.shift()),t.items[i+1]=y.items[0],i}if(m&&_&&!c){y=a;return(v=p).items.unshift(y.items.pop()),t.items[i]=v.items[0],i-1}if(m&&!_&&c){var v=p;return(r=(y=a).items).unshift.apply(r,v.items),e.ArrayExt.removeAt(t.children,i),e.ArrayExt.removeAt(t.items,i+1),v.prev&&(v.prev.next=y),y.prev=v.prev,s(v),i}if(m&&!_&&!c){v=p;return(n=(y=a).items).push.apply(n,v.items),e.ArrayExt.removeAt(t.children,i),e.ArrayExt.removeAt(t.items,i),v.next&&(v.next.prev=y),y.next=v.next,s(v),i-1}if(!m&&_&&c){y=a;return(v=p).children.push(y.children.shift()),v.items.push(y.items.shift()),t.items[i+1]=y.items[0],d(v,v.width-1),d(y,0),i}if(!m&&_&&!c){y=a;return(v=p).children.unshift(y.children.pop()),v.items.unshift(y.items.pop()),t.items[i]=v.items[0],d(v,0),d(y,y.width-1),i-1}if(!m&&!_&&c){v=p;return(o=(y=a).children).unshift.apply(o,v.children),(u=y.items).unshift.apply(u,v.items),e.ArrayExt.removeAt(t.children,i),e.ArrayExt.removeAt(t.items,i+1),d(y,0),v.children.length=0,s(v),i}if(!m&&!_&&!c){v=p;return(f=(y=a).children).push.apply(f,v.children),(l=y.items).push.apply(l,v.items),e.ArrayExt.removeAt(t.children,i),e.ArrayExt.removeAt(t.items,i),d(y,0),v.children.length=0,s(v),i-1}throw"unreachable"}}(r||(r={})),t.LinkedList=function(){function t(){this._first=null,this._last=null,this._size=0}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return 0===this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"first",{get:function(){return this._first?this._first.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){return this._last?this._last.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstNode",{get:function(){return this._first},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastNode",{get:function(){return this._last},enumerable:!0,configurable:!0}),t.prototype.iter=function(){return new t.ForwardValueIterator(this._first)},t.prototype.retro=function(){return new t.RetroValueIterator(this._last)},t.prototype.nodes=function(){return new t.ForwardNodeIterator(this._first)},t.prototype.retroNodes=function(){return new t.RetroNodeIterator(this._last)},t.prototype.assign=function(t){var i=this;this.clear(),e.each(t,(function(t){i.addLast(t)}))},t.prototype.push=function(t){this.addLast(t)},t.prototype.pop=function(){return this.removeLast()},t.prototype.shift=function(t){this.addFirst(t)},t.prototype.unshift=function(){return this.removeFirst()},t.prototype.addFirst=function(t){var e=new n.LinkedListNode(this,t);return this._first?(e.next=this._first,this._first.prev=e,this._first=e):(this._first=e,this._last=e),this._size++,e},t.prototype.addLast=function(t){var e=new n.LinkedListNode(this,t);return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._first=e,this._last=e),this._size++,e},t.prototype.insertBefore=function(t,e){if(!e||e===this._first)return this.addFirst(t);if(!(e instanceof n.LinkedListNode)||e.list!==this)throw new Error("Reference node is not owned by the list.");var i=new n.LinkedListNode(this,t),r=e,o=r.prev;return i.next=r,i.prev=o,r.prev=i,o.next=i,this._size++,i},t.prototype.insertAfter=function(t,e){if(!e||e===this._last)return this.addLast(t);if(!(e instanceof n.LinkedListNode)||e.list!==this)throw new Error("Reference node is not owned by the list.");var i=new n.LinkedListNode(this,t),r=e,o=r.next;return i.next=o,i.prev=r,r.next=i,o.prev=i,this._size++,i},t.prototype.removeFirst=function(){var t=this._first;if(t)return t===this._last?(this._first=null,this._last=null):(this._first=t.next,this._first.prev=null),t.list=null,t.next=null,t.prev=null,this._size--,t.value},t.prototype.removeLast=function(){var t=this._last;if(t)return t===this._first?(this._first=null,this._last=null):(this._last=t.prev,this._last.next=null),t.list=null,t.next=null,t.prev=null,this._size--,t.value},t.prototype.removeNode=function(t){if(!(t instanceof n.LinkedListNode)||t.list!==this)throw new Error("Node is not owned by the list.");var e=t;e===this._first&&e===this._last?(this._first=null,this._last=null):e===this._first?(this._first=e.next,this._first.prev=null):e===this._last?(this._last=e.prev,this._last.next=null):(e.next.prev=e.prev,e.prev.next=e.next),e.list=null,e.next=null,e.prev=null,this._size--},t.prototype.clear=function(){for(var t=this._first;t;){var e=t.next;t.list=null,t.prev=null,t.next=null,t=e}this._first=null,this._last=null,this._size=0},t}(),function(t){t.from=function(e){var i=new t;return i.assign(e),i};var e=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.next,t.value}},t}();t.ForwardValueIterator=e;var i=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.prev,t.value}},t}();t.RetroValueIterator=i;var r=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.next,t}},t}();t.ForwardNodeIterator=r;var n=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.prev,t}},t}();t.RetroNodeIterator=n}(t.LinkedList||(t.LinkedList={})),function(t){var e=function(t,e){this.list=null,this.next=null,this.prev=null,this.list=t,this.value=e};t.LinkedListNode=e}(n||(n={})),Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.min.js.map
{
"name": "@lumino/collections",
"version": "1.3.1",
"version": "1.3.2",
"description": "Lumino Generic Collections",

@@ -24,4 +24,3 @@ "homepage": "https://github.com/jupyterlab/lumino",

"src/*",
"types/*",
"types-3.4/*"
"types/*"
],

@@ -33,15 +32,7 @@ "main": "dist/index.js",

"types": "types/index.d.ts",
"typesVersions": {
"<3.8": {
"*": [
"types-3.4/index.d.ts"
]
}
},
"scripts": {
"api": "api-extractor run --local --verbose",
"minimize": "terser dist/index.js -c -m --source-map \"content='dist/index.js.map',url='index.min.js.map'\" -o dist/index.min.js",
"build": "tsc --build && npm run gen-legacy-types && rollup -c",
"build": "tsc --build && rollup -c",
"build:test": "tsc --build tests && cd tests && webpack",
"gen-legacy-types": "downlevel-dts ./types ./types-3.4",
"clean": "rimraf ./lib && rimraf *.tsbuildinfo && rimraf ./types && rimraf ./dist",

@@ -57,3 +48,3 @@ "clean:test": "rimraf tests/build",

"dependencies": {
"@lumino/algorithm": "^1.3.1"
"@lumino/algorithm": "^1.3.2"
},

@@ -65,3 +56,2 @@ "devDependencies": {

"chai": "^3.5.0",
"downlevel-dts": "^0.4.0",
"karma": "^4.4.1",

@@ -81,4 +71,4 @@ "karma-chrome-launcher": "^2.0.0",

"tslib": "1.10.0",
"typedoc": "~0.17.7",
"typescript": "~3.9.2",
"typedoc": "~0.15.0",
"typescript": "~3.6.4",
"webpack": "^4.41.3",

@@ -90,3 +80,3 @@ "webpack-cli": "^3.3.10"

},
"gitHead": "a1059be73c2084ecf7b7a4e97551448d8b98a5bf"
"gitHead": "ed3875c795eb1777f282b5450644af7d590cdef3"
}

@@ -28,3 +28,3 @@ import { IIterable, IIterator, IRetroable, IterableOrArrayLike } from "@lumino/algorithm";

*/
get isEmpty(): boolean;
readonly isEmpty: boolean;
/**

@@ -36,3 +36,3 @@ * The size of the tree.

*/
get size(): number;
readonly size: number;
/**

@@ -46,3 +46,3 @@ * The first item in the tree.

*/
get first(): T | undefined;
readonly first: T | undefined;
/**

@@ -56,3 +56,3 @@ * The last item in the tree.

*/
get last(): T | undefined;
readonly last: T | undefined;
/**

@@ -59,0 +59,0 @@ * Create an iterator over the items in the tree.

@@ -16,3 +16,3 @@ import { IIterable, IIterator, IRetroable, IterableOrArrayLike } from '@lumino/algorithm';

*/
get isEmpty(): boolean;
readonly isEmpty: boolean;
/**

@@ -27,3 +27,3 @@ * The size of the list.

*/
get size(): number;
readonly size: number;
/**

@@ -40,3 +40,3 @@ * The length of the list.

*/
get length(): number;
readonly length: number;
/**

@@ -50,3 +50,3 @@ * The first value in the list.

*/
get first(): T | undefined;
readonly first: T | undefined;
/**

@@ -60,3 +60,3 @@ * The last value in the list.

*/
get last(): T | undefined;
readonly last: T | undefined;
/**

@@ -70,3 +70,3 @@ * The first node in the list.

*/
get firstNode(): LinkedList.INode<T> | null;
readonly firstNode: LinkedList.INode<T> | null;
/**

@@ -80,3 +80,3 @@ * The last node in the list.

*/
get lastNode(): LinkedList.INode<T> | null;
readonly lastNode: LinkedList.INode<T> | null;
/**

@@ -83,0 +83,0 @@ * Create an iterator over the values in the list.

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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