var Tokensearch=function(e,t){if(!e||0===e.length)throw new Error("Empty collection!");var o=this;if(this.collection=[],e.forEach(function(e){o.collection.push({item:e})}),t=t||{},this.delimiter=t.delimiter||Tokensearch.defaultOptions.delimiter,this.maxFilterTokenEntries=t.maxFilterTokenEntries||Tokensearch.defaultOptions.maxFilterTokenEntries,this.defaultThreshold=t.threshold||Tokensearch.defaultOptions.threshold,this.collectionKeys=t.collectionKeys||Tokensearch.defaultOptions.collectionKeys,0===this.collectionKeys.length)throw new Error("No collectionKeys defined!");this.collectionDataTokenSize=this.collectionKeys.length,this._prepareSearchTokens()};Tokensearch.defaultOptions={delimiter:/[\s-]+/,threshold:.7,maxFilterTokenEntries:5,collectionKeys:[]},Tokensearch.prototype._prepareSearchTokens=function(){var e=this;this.collection.forEach(function(t){var o=[];e.collectionKeys.forEach(function(i){t.item[i].trim().toLowerCase().split(e.delimiter).forEach(function(e){o=o.concat(e)})}),t.dataEntryTokens=o.filter(e._onlyUnique)})},Tokensearch.prototype._onlyUnique=function(e,t,o){return o.indexOf(e)===t},Tokensearch.prototype.search=function(e,t){for(var o=[],i=t||this.defaultThreshold,n=e.trim().split(this.delimiter).filter(this._onlyUnique),r=0,s=Math.min(n.length,this.maxFilterTokenEntries);s>r;r++)o.push(n[r].toLowerCase());var c=[],l=0;this.collection.forEach(function(e){var t=0,i=0;e.dataEntryTokens.forEach(function(e){for(var n=o.length,r=0;n>r;r++){var s=o[r];if(e.indexOf(s)>-1){i++,t+=e===s?2:1;break}}}),i&&(t+=i,t>l&&(l=t),c.push({item:e.item,score:t}))});var h=[],a=1/l;return c.forEach(function(e){e.score=1-e.score*a,e.score<=i&&h.push(e)}),h.sort(function(e,t){return e.score-t.score})},module.exports=Tokensearch;
@@ -1,19 +1,35 @@
-var Tokensearch
+!function(e)%7B%22use strict%22;var t
 =fun
@@ -36,17 +36,17 @@
 ction(e,
-t
+o
 )%7Bif(!e%7C
@@ -100,17 +100,17 @@
 !%22);var 
-o
+i
 =this;if
@@ -151,17 +151,17 @@
 tion(e)%7B
-o
+i
 .collect
@@ -185,11 +185,11 @@
 )%7D),
-t=t
+o=o
 %7C%7C%7B%7D
@@ -204,17 +204,17 @@
 limiter=
-t
+o
 .delimit
@@ -217,27 +217,17 @@
 imiter%7C%7C
-Tokensearch
+t
 .default
@@ -271,17 +271,17 @@
 Entries=
-t
+o
 .maxFilt
@@ -296,27 +296,17 @@
 ntries%7C%7C
-Tokensearch
+t
 .default
@@ -357,17 +357,17 @@
 reshold=
-t
+o
 .thresho
@@ -370,27 +370,17 @@
 eshold%7C%7C
-Tokensearch
+t
 .default
@@ -417,17 +417,17 @@
 ionKeys=
-t
+o
 .collect
@@ -435,27 +435,17 @@
 onKeys%7C%7C
-Tokensearch
+t
 .default
@@ -629,27 +629,17 @@
 kens()%7D;
-Tokensearch
+t
 .default
@@ -722,27 +722,17 @@
 eys:%5B%5D%7D,
-Tokensearch
+t
 .prototy
@@ -992,27 +992,17 @@
 que)%7D)%7D,
-Tokensearch
+t
 .prototy
@@ -1057,27 +1057,17 @@
 e)===t%7D,
-Tokensearch
+t
 .prototy
@@ -1656,23 +1656,119 @@
 %7D)%7D,
-module.exports=
+%22object%22==typeof exports?module.exports=t:%22function%22==typeof define&&define.amd?define(function()%7Breturn t%7D):e.
 Toke
@@ -1774,9 +1774,18 @@
 ensearch
+=t%7D(this)
 ;

update minified lib version