diff --git a/dist/super.es.js b/dist/super.es.js index c0ef57e..40b3372 100644 --- a/dist/super.es.js +++ b/dist/super.es.js @@ -4592,7 +4592,7 @@ var Trie = function () { return Trie; }(); -var version = "0.0.10"; +var version = "0.0.11"; var Super = { version: version, diff --git a/dist/super.js b/dist/super.js index 91127be..a80bd61 100644 --- a/dist/super.js +++ b/dist/super.js @@ -4598,7 +4598,7 @@ return Trie; }(); - var version = "0.0.10"; + var version = "0.0.11"; var Super = { version: version, diff --git a/dist/super.min.js b/dist/super.min.js index 391eb4e..15e9786 100644 --- a/dist/super.min.js +++ b/dist/super.min.js @@ -18,4 +18,4 @@ return i[r]=t(e[r])}),i}throw Error("Unable to copy object: "+e)}var e=arguments 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 F(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 A(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 A(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