diff --git a/.nvmrc b/.nvmrc index 5d3ba08..a63bb50 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v10.2.1 +v10.7.0 diff --git a/dist/super.es.js b/dist/super.es.js index 0b2da56..ea437b3 100644 --- a/dist/super.es.js +++ b/dist/super.es.js @@ -4607,7 +4607,7 @@ var Trie = function () { return Trie; }(); -var version = "0.0.11"; +var version = "0.0.12"; var Super = { version: version, diff --git a/dist/super.js b/dist/super.js index 4f8e80a..805a4d0 100644 --- a/dist/super.js +++ b/dist/super.js @@ -4613,7 +4613,7 @@ return Trie; }(); - var version = "0.0.11"; + var version = "0.0.12"; var Super = { version: version, diff --git a/dist/super.min.js b/dist/super.min.js index 997f479..1e55fe0 100644 --- a/dist/super.min.js +++ b/dist/super.min.js @@ -18,4 +18,4 @@ for(var u,a=G[Symbol.iterator]();!(n=(u=a.next()).done);n=!0){var l=u.value,f=E( ;n=new Map(n.map(function(t){return[t.priority,t.value]}))}}var o=!0,u=!1,a=void 0;try{for(var l,f=n.entries()[Symbol.iterator]();!(o=(l=f.next()).done);o=!0){var c=l.value,h=E(c,2);this.insert(h[1],h[0])}}catch(t){u=!0,a=t}finally{try{!o&&f.return&&f.return()}finally{if(u)throw a}}}return M(t,[{key:"isEmpty",value:function(){return 0===this._queue.length}},{key:"clear",value:function(){this._queue.length=0}},{key:"insert",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if((void 0===e?"undefined":j(e))!==k.NUMBER)throw Error("Unable to insert non-number priority: "+e);return this._queue.push(new J(t,e)),this._queue.sort(this._comparator),this.size}},{key:"deleteMax",value:function(){return this._queue.shift()}},{key:"deleteHigh",value:function(){return this.deleteMax()}},{key:"deleteMin",value:function(){return this._queue.pop()}},{key:"deleteLow",value:function(){return this.deleteMin()}},{key:"toArray",value:function(){return this._queue.slice(0)}},{key:"size",get:function(){return this._queue.length}},{key:"max",get:function(){return this._queue[0]}},{key:"high",get:function(){return this.max}},{key:"min",get:function(){return this._queue[this._queue.length-1]}},{key:"low",get:function(){return this.min}}],[{key:"_wrapComparator",value:function(t){return function(e,r){return t(e.value,r.value)}}},{key:"_defaultComparator",value:function(t,e){return t.priority0&&void 0!==arguments[0]?arguments[0]:xt.ROOT;S(this,t),this._char=e,this._isCompleteWord=!1,this._children=new Map}return M(t,[{key:"has",value:function(t){return this._children.has(t)}},{key:"get",value:function(t){return this._children.get(t)}},{key:"set",value:function(t,e){this._children.set(t,e)}},{key:"delete",value:function(t){this._children.delete(t)}},{key:"count",get:function(){return this._children.size}},{key:"char",get:function(){return this._char}},{key:"isCompleteWord",get:function(){return this._isCompleteWord}},{key:"isLeafNode",get:function(){return 0===this.count}}]),t}(),Tt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];S(this,t),this._root=new Et;var r=!0,n=!1,i=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done);r=!0){this.insert(o.value)}}catch(t){n=!0,i=t}finally{try{!r&&u.return&&u.return()}finally{if(n)throw i}}}return M(t,[{key:"insert",value:function(t){ -if((void 0===t?"undefined":j(t))!==k.STRING)throw Error("Unable to insert non-string value: "+t);var e=this.root,r=!0,n=!1,i=void 0;try{for(var o,u=t[Symbol.iterator]();!(r=(o=u.next()).done);r=!0){var a=o.value;if(e.has(a))e=e.get(a);else{var l=new Et(a);e.set(a,l),e=l}}}catch(t){n=!0,i=t}finally{try{!r&&u.return&&u.return()}finally{if(n)throw i}}e._isCompleteWord=!0}},{key:"remove",value:function(t){function e(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!r)return!1;if(n===t.length)return r._isCompleteWord=!1,r.isLeafNode;var i=t[n];return e(r.get(i),n+1)?(r.delete(i),r.isLeafNode):void 0}if((void 0===t?"undefined":j(t))!==k.STRING)throw Error("Unable to remove non-string value: "+t);return e(this.root)}},{key:"search",value:function(t){for(var e=this.root,r=0;r1&&void 0!==arguments[1]?arguments[1]:0;if(!r)return!1;if(n===t.length)return r._isCompleteWord=!1,r.isLeafNode;var i=t[n];return e(r.get(i),n+1)?(r.delete(i),r.isLeafNode):void 0}if((void 0===t?"undefined":j(t))!==k.STRING)throw Error("Unable to remove non-string value: "+t);return e(this.root)}},{key:"search",value:function(t){for(var e=this.root,r=0;r