From 86b6b16d4f9afba047323a4827a9a77779e79891 Mon Sep 17 00:00:00 2001 From: Travis Clarke Date: Wed, 25 Jul 2018 16:55:02 -0700 Subject: [PATCH] v0.0.15 --- dist/super.es.js | 2 +- dist/super.js | 2 +- dist/super.min.js | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/super.es.js b/dist/super.es.js index c239d3a..2e86006 100644 --- a/dist/super.es.js +++ b/dist/super.es.js @@ -4650,7 +4650,7 @@ var Trie = function () { return Trie; }(); -var version = "0.0.14"; +var version = "0.0.15"; var Super = { version: version, diff --git a/dist/super.js b/dist/super.js index e23b65f..31abff3 100644 --- a/dist/super.js +++ b/dist/super.js @@ -4656,7 +4656,7 @@ return Trie; }(); - var version = "0.0.14"; + var version = "0.0.15"; var Super = { version: version, diff --git a/dist/super.min.js b/dist/super.min.js index a16db0a..be6d3a6 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( this._queue=[],this._comparator=i?t._wrapComparator(i):t._defaultComparator,!(n instanceof Map)){if(!e(n))throw Error("Unable to construct from non-iterable");if(Array.isArray(n[0]))n=new Map(n);else{if(!jt(n[0]))return n.forEach(function(t){return r.insert(t)});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