bulksearch
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -1,16 +0,31 @@ | ||
/**! | ||
* BulkSearch - https://github.com/nextapps-de/bulksearch | ||
* @author: Thomas Wilkerling | ||
* @license: Apache 2.0 Licence | ||
*/ | ||
window.BulkSearch=function(l,r){function d(a){this.id=D++;this.u(a||k)}function p(a,c){return new (("int"===a||"integer"===a?Uint32Array:"short"===a?Uint16Array:"byte"===a?Uint8Array:null)||Array)(c)}function b(a){return new RegExp(a,"g")}function C(a){for(var c=0;c<h.length;c++){var n=h[c];a=a.replace(n[0],n[1])}return a}function w(a,c,n){n?a=a.split(" ").map(function(a){a=c(a);h.length&&(a=C(a));return a}).join(" "):(a=c(a),h.length&&(a=C(a)));return a}function E(a,c){var n=a.length-c.length;return 0> | ||
n?1:0<n?-1:0}var k={type:"integer",l:!1,m:!1,j:!1,o:!1,cache:!1,encode:!1,size:1E4},B={icase:function(a){return a.toLowerCase()},simple:function(){var a=b("[^a-z0-9 ]"),c=b("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),n=b("[\u00e8\u00e9\u00ea\u00eb]"),g=b("[\u00ec\u00ed\u00ee\u00ef]"),e=b("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),f=b("[\u00f9\u00fa\u00fb\u00fc\u0171]"),d=b("[\u00fd\u0177\u00ff]"),l=b("\u00f1"),z=b("\u00e7"),A=b("\u00df");return function(b){return b.toLowerCase().replace(c,"a").replace(n, | ||
"e").replace(g,"i").replace(e,"o").replace(f,"u").replace(d,"y").replace(l,"n").replace(z,"c").replace(A,"s").replace(a,"")}}(),advanced:function(){var a=b(" "),c=b("ae"),n=b("oe"),g=b("ue"),e=b("ie"),f=b("sz"),d=b("zs"),l=b("ck"),z=b("cc"),A=b("sh"),k=b("th"),m=b("dt"),r=b("ph");return function(b){if(!b)return b;b=B.simple(b);2<b.length&&(b=b.replace(c,"a").replace(n,"o").replace(g,"u").replace(e,"i").replace(f,"s").replace(d,"s").replace(A,"s").replace(l,"k").replace(z,"k").replace(k,"t").replace(m, | ||
"t").replace(r,"f"));if(1<b.length){for(var y="",t="",q="",h=0;h<b.length;h++){var u=b[h];u!==t&&(0<h&&"h"===u?(q="a"===q||"e"===q||"i"===q||"o"===q||"u"===q||"y"===q,"a"!==t&&"e"!==t&&"i"!==t&&"o"!==t&&"u"!==t&&"y"!==t||!q||(y+=u)):y+=u);q=h===b.length-1?"":b[h+1];t=u}b=y}return b=b.replace(a,"")}}()},h=[],m=1E4,D=0;d.create=d.A=function(a){return new this(a)};d.w=function(a){for(var c in a)a.hasOwnProperty(c)&&(h[h.length]=[b(c),a[c]])};d.prototype.u=function(a){a&&(this.type=a.type||this.type|| | ||
k.type,this.l=a.strict||this.l||k.l,this.o=a.ordered||this.o||k.o,this.m=a.multi||this.m||k.m,this.j="or"===a["boolean"]||this.j||k.j,this.cache=a.cache||this.cache||k.cache,this.encode=a.encode&&B[a.encode]||this.encode||k.encode&&B[k.encode],m=a.size||k.size);this.b=[p(this.type,m)];this.c={};this.f={};this.a=[""];this.s=0;this.i=!0;this.h=0;this.g=this.cache?new r(3E4,50,!0):!1};d.prototype.set=d.prototype.add=function(a,c){if(c)if(this.c[a])this.update(a,c);else{this.encode&&(c=w(c,this.encode, | ||
this.l));var b=this.a,g=this.s,e=this.f[c.length];if(e&&e.length){var f=this.c[a]=e.pop();e=f[1];var d=b[f[0]];b[f[0]]=d.substring(0,e)+c+d.substring(f[2]);this.h-=c.length}else e=b[g].length,e+c.length>m&&(e<m/2&&(m*=2),this.s=++g,e=0,b[g]="",this.b[g]=p(this.type,m)),f=this.c[a]=[g,e,0],b[g]+=c+"#";if(this.b[g].constructor===Array)for(b=0;b<c.length;b++)this.b[g][e++]=a;else this.b[g].fill(a,e,e+c.length+1),e+=c.length;f[2]=e;this.i=!1}};d.prototype.update=function(a,c){var b=this.c[a];if(b){c&& | ||
this.encode&&(c=w(c,this.encode,this.l));var g=b[1],e=b[2],f=e-g,d=c.length-f,l=c;for(0<d&&(c="");c.length<f;)c=(c+" ").substring(0,f);var h=this.a,k=b[0],m=h[k];h[k]=m.substring(0,g)+c+m.substring(e);0<d&&((g=this.f[f])?g=g.length:(this.f[f]=[],g=0),this.f[f][g]=b,this.h+=f,this.c[a]=null,this.add(a,l));this.i=!1}};d.prototype["delete"]=d.prototype.remove=function(a){this.update(a,"")};d.prototype.search=d.prototype.query=d.prototype.find=function(a, | ||
b,d){"function"===typeof b&&(d=b,b=0);if(d){var c=this;l(function(){d(c.search(a,b))},"search-"+this.id);l(function(){c=null});return null}var e=a;if(!this.i)this.cache&&this.g.reset(),this.i=!0;else if(this.cache){var f=this.g.get(a);if(f)return f}for(f=0;" "===a[f];)f++;f&&(e=a.substring(f));e=this.m?e.split(" "):[e];f=e.length;1<f&&e.sort(E);this.encode&&(e[0]=w(e[0],this.encode,!1));for(var h=[],n=0;n<this.a.length;n++){for(var k=0,m=0,r=this.a[n];-1!==(m=r.indexOf(e[0],k));){k=this.b[n][m];var p= | ||
this.c[k];if(p){m=p[2];var x=!0;if(1<f){p=r.substring(p[1],m);for(var v=1;v<f;v++)if(this.encode&&(e[v]=w(e[v],this.encode,!1)),-1===p.indexOf(e[v]))if(this.j)x=!1;else{x=!1;break}else if(this.j){x=!0;break}}if(x&&(h[h.length]=k,b&&h.length===b))break}k=m+1}if(b&&h.length===b)break}this.cache&&this.g.set(a,h);return h};d.prototype.info=function(){for(var a=this.h,b=Object.keys(this.c).length,d=0,g=0,e=0;e<this.a.length;e++)g+=this.a[e].length;g&&(a=(100/g*a*100|0)/100,d=this.b[0].constructor===Array? | ||
32:this.b[0].byteLength,d=2*g+24*b+this.a.length*m*d);return{id:this.id,length:b,chunks:this.a.length,size:m,bytes:d,fragments:Object.keys(this.f).length,fragmentation:a,status:this.i,matchers:h.length}};d.prototype.reset=d.prototype.clear=function(){this.v();this.u()};d.prototype.v=function(){this.cache&&this.g.reset();this.g=this.a=this.f=this.c=this.b=null};return d}(function(){var l={};return function(r,d){var p=l[d];p&&clearTimeout(p);return l[d]=setTimeout(r)}}(),function(){function l(){this.cache= | ||
{}}l.prototype.reset=function(){this.cache={}};l.prototype.set=function(l,d){this.cache[l]=d};l.prototype.get=function(l){return this.cache[l]};return l}()); | ||
/* | ||
BulkSearch v0.1.3 | ||
Copyright 2018 Thomas Wilkerling | ||
Released under the Apache 2.0 Licence | ||
https://github.com/nextapps-de/bulksearch | ||
*/ | ||
'use strict';(function(p,H,h){var l;(l=h.define)&&l.amd?l([],function(){return H}):(l=h.modules)?l[p.toLowerCase()]=H:"undefined"!==typeof module?module.exports=H:h[p]=H})("BulkSearch",function S(p){function h(b){b||(b=k);this.name="BulkSearch";this.id=b.id||T++;this.init(b);l(this,"index",function(){return this.a});l(this,"length",function(){return Object.keys(this.a).length})}function l(b,a,c){Object.defineProperty(b,a,{get:c})}function d(b){return new RegExp(b,"g")}function C(b,a){return new (("int"=== | ||
b||"integer"===b?Uint32Array:"short"===b?Uint16Array:"float"===b||"double"===b?Float64Array:"byte"===b?Uint8Array:Array)||Array)(a)}function m(b,a,c){if("undefined"===typeof c){for(c=0;c<a.length;c+=2)b=b.replace(a[c],a[c+1]);return b}return b.replace(a,c)}function w(b,a){b=b.length-a.length;return 0>b?1:0<b?-1:0}function U(b,a){b=b.score-a.score;return 0>b?-1:0<b?1:0}function z(b){for(var a="",c="",e="",g=0;g<b.length;g++){var f=b[g];if(f!==c)if(g&&"h"===f){if(e="a"===e||"e"===e||"i"===e||"o"=== | ||
e||"u"===e||"y"===e,("a"===c||"e"===c||"i"===c||"o"===c||"u"===c||"y"===c)&&e||" "===c)a+=f}else a+=f;e=g===b.length-1?"":b[g+1];c=f}return a}function L(b){var a={};b=b.split(M);for(var c=[],e=0,g=0;g<b.length;g++){var f=b[g];f&&!a[f]&&(a[f]="1",c[e++]=this.encode(f))}return c.join("~")}function V(b,a){var c={};if(b)for(var e=0;e<b.length;e++){var g=a?a.call(t,b[e]):b[e];c[g]=String.fromCharCode(65E3-b.length+e)}return c}function W(b,a){var c=[];if(b){var e=0,g;for(g in b)if(b.hasOwnProperty(g)){var f= | ||
a?a.call(t,g):g;c[e++]=d("(?=.{"+(f.length+3)+",})"+f+"$");c[e++]=a?a.call(t,b[g]):b[g]}}return c}function D(b){b.R||(b.R=N(function(){b.R=null;var a=b.async;a&&(b.async=!1);if(b.h.length){for(var c=O(),e;(e=b.h.shift())||0===e;){var g=b.l[e];switch(g[0]){case A.add:b.add(g[1],g[2]);break;case A.update:b.update(g[1],g[2])}b.l[e]=null;delete b.l[e];if(100<O()-c)break}b.h.length&&D(b)}a&&(b.async=a)},1,"search-async-"+b.id))}function O(){return"undefined"!==typeof performance?performance.now():(new Date).getTime()} | ||
function X(b,a,c,e){b=p("bulksearch","id"+b,function(){var b,a;self.a=function(c){if(c=c.data)if(c.search){var e=a.search(c.content,c.threshold?{limit:c.limit,threshold:c.threshold}:c.limit);self.postMessage({id:b,content:c.content,limit:c.limit,result:e})}else c.add?a.add(c.id,c.content):c.update?a.update(c.id,c.content):c.remove?a.remove(c.id):c.reset?a.reset():c.info?(c=a.info(),c.worker=b,a.N&&console.log(c)):c.register&&(b=c.id,c.options.cache=!1,c.options.async=!0,c.options.worker=!1,a=(new Function(c.register.substring(c.register.indexOf("{")+ | ||
1,c.register.lastIndexOf("}"))))(),a=new a(c.options))}},function(a){(a=a.data)&&a.result?e(a.id,a.content,a.result,a.limit):c.debug&&console.log(a)},a);var g=S.toString();c.id=a;b.postMessage(a,{register:g,options:c,id:a});return b}var k={type:"integer",H:!1,async:!1,f:!1,separator:"~",v:!1,F:!0,L:!1,cache:!1,encode:"icase",G:!1,depth:0,size:4E3},r=[],T=0,A={add:0,update:1,remove:2},M=d("[ -/]"),P={},Q={};h.new=function(b){return new this(b)};h.create=function(b){return h.new(b)};h.addMatcher=function(b){for(var a in b)b.hasOwnProperty(a)&& | ||
(r[r.length]=d(a),r[r.length]=b[a]);return this};h.registerEncoder=function(b,a){t[b]=a;return this};h.registerLanguage=function(b,a){P[b]=a.filter;Q[b]=a.stemmer;return this};h.encode=function(b,a){return t[b].call(t,a)};h.prototype.init=function(b){this.I=[];b||(b=k);var a;if(a=b.worker)if("undefined"===typeof Worker)b.worker=!1,b.async=!0,this.u=null;else{var c=this;a=parseInt(a,10)||4;c.A=-1;c.w=0;c.i=[];c.J=null;c.u=Array(a);for(var e=0;e<a;e++)c.u[e]=X(c.id,e,b||k,function(a,b,e,d){c.w!==c.f&& | ||
(c.i=c.i.concat(e),c.w++,d&&c.i.length>=d&&(c.w=c.f),c.J&&c.w===c.f&&("undefined"!==typeof c.b&&(c.i.length?c.b="":c.b||(c.b=b)),c.cache&&c.g.set(b,c.i),c.J(c.i),c.i=[]))})}this.type=b.type||this.type||k.type;this.async=b.async||this.async||k.async;this.f=b.worker||this.f||k.f;this.separator=b.separator||this.separator||k.separator;this.v=b.strict||this.v||k.v;this.L=b.ordered||this.L||k.L;this.F=b.multi||this.F||k.F;this.G=b.paging||this.G||k.G;this.depth=b.depth||this.depth||k.depth;this.H=b.suggest|| | ||
this.H||k.H;this.D=(a=b.encode)&&t[a]||("function"===typeof a?a:this.D||!1);this.N=b.debug||this.N;(a=b.matcher)&&this.addMatcher(a);if(a=b.filter)this.filter=V(P[a]||a,this.D);if(a=b.stemmer)this.stemmer=W(Q[a]||a,this.D);this.j={};this.o=b.size||k.size;this.g=(this.cache=a=b.cache||this.cache||k.cache)?new R(a):!1;this.b="";this.M={};this.m=[C(this.type,this.o)];this.a={};this.s={};this.P={};this.c=[""];this.O=0;this.C=!0;this.B=0;this.l={};this.h=[];this.g=this.cache?new R(3E4,50,!0):!1;return this}; | ||
h.prototype.encode=function(b){b&&r.length&&(b=m(b,r));b&&this.I.length&&(b=m(b,this.I));b&&this.D&&(b=this.D.call(t,b));if(b&&this.filter){b=b.split(" ");for(var a=0;a<b.length;a++)this.filter[b[a]]&&b.splice(a,1);b=b.join(" ")}b&&this.stemmer&&(b=m(b,this.stemmer));return b};h.prototype.addMatcher=function(b){var a=this.I,c;for(c in b)b.hasOwnProperty(c)&&(a[a.length]=d(c),a[a.length]=b[c]);return this};h.prototype.add=function(b,a,c){if("string"===typeof a&&a&&(b||0===b))if(this.a[b])this.update(b, | ||
a);else{if(this.f)return++this.A>=this.u.length&&(this.A=0),this.u[this.A].postMessage(this.A,{add:!0,id:b,content:a}),this.a[b]=""+this.A,this;if(this.async)return this.l[b]||(this.h[this.h.length]=b),this.l[b]=[A.add,b,a],D(this),this;if(c)a=c;else if(a){a=L.call(this,a.trim());if(!a)return this;a="~"+(this.v?a.replace(/ /g,"~"):a)}var e=this.c;c=this.O;var g=this.s[a.length],f;if(g&&g.length){this.a[b]=f=g.pop();c=f[0];g=f[1];var x=e[c];e[c]=x.substring(0,g)+a+x.substring(f[2]);this.B-=a.length}else g= | ||
e[c].length,g+a.length>this.o&&(a.length>this.o/2-2&&(this.o=2*a.length+2),g&&(this.O=++c),g=0,e[c]="",this.m[c]=C(this.type,this.o)),this.a[b]=f=[c,g,0],e[c]+=a;if(this.m[c].constructor===Array)for(e=0;e<a.length;e++)this.m[c][g++]=b;else this.m[c].fill(b,g,g+a.length),g+=a.length;f[2]=g;this.C=!1}return this};h.prototype.update=function(b,a){if("string"===typeof a&&(b||0===b)){var c=this.a[b];if(c){if(this.f)return c=parseInt(this.a[b],10),this.u[c].postMessage(c,{update:!0,id:b,content:a}),a|| | ||
delete this.a[b],this;if(this.async)return this.l[b]||(this.h[this.h.length]=b),this.l[b]=[A.update,b,a],D(this),this;var e=a;if(a){a=L.call(this,a.trim());if(!a)return this;a="~"+(this.v?a.replace(/ /g,"~"):a)}var g=c[1],f=c[2],x=f-g,d=a.length-x,h=a;for(0<d&&(a="~");a.length<x;)a=(a+" ").substring(0,x);var k=this.c,q=c[0],n=k[q];k[q]=n.substring(0,g)+a+n.substring(f);if(0<d||!e)(a=this.s[x])?a=a.length:(this.s[x]=[],a=0),this.s[x][a]=c,this.B+=x, | ||
e?(this.a[b]=null,this.j[b]=0,this.add(b,e,h)):(delete this.a[b],delete this.j[b]);this.C=!1}}return this};h.prototype.remove=function(b){this.a[b]&&this.update(b,"");return this};h.prototype.search=function(b,a,c){var e=0,g=0;b&&"object"===typeof b&&(c=a,a=b,b=b.query);if(a)if("function"===typeof a)c=a,a=1E3;else if("object"===typeof a){if(a.page){var f=a.page.split(":");e=parseInt(f[0],10);g=parseInt(f[1],10)}a.callback&&(c=a.callback);a=a.limit}a||(a=1E3);if(this.f){this.J=c;this.w=0;this.i=[]; | ||
for(var d=0;d<this.f;d++)this.u[d].postMessage(d,{search:!0,limit:a,page:e+":"+g,content:b});return null}if(c){if(e||g)a={page:e+":"+g,limit:a};var h=this;N(function(){c(h.search(b,a));h=null},1,"search-"+this.id);return null}if(this.G){var k=e+":"+g,m={current:k,prev:this.M[k]||null,next:null,results:[]};f=m.results}else f=[];if(!b||"string"!==typeof b)return m||f;var q=b;if(!this.C)this.cache&&("undefined"!==typeof this.b&&(this.b=""),this.g.reset()),this.C=!0;else if(this.cache){var n=this.g.get(b); | ||
if(n)return n}else if(this.b&&-1!==b.indexOf(this.b))return m||f;q=this.encode(q.trim());if(!q.length)return m||f;this.v&&(q="~"+q.replace(/ /g," ~"));var p=this.F?q.split(M):[q];n=p.length;if(1<n){p.sort(w);var l=this.H}for(q=[];e<this.c.length;e++){var y=g;d=0;var t=this.c[e],u,r=p[0],z=0;g=0;if(r&&"~"!==r)for(;-1!==(d=t.indexOf(r,y))||l;){if(l&&-1===d)if(z++,z===n+1)break;else{l=n>z+1;r=p[z];continue}y=this.m[e][d];if(u=this.a[y]){var B=u[1],I=u[2],E=I-B,C=!0;B=t.substring(B,I);var A=0;var v=d- | ||
u[1];var K=v-B.lastIndexOf("~",v);u=E/(E-v)+K/3;if(1<n){var D={};D[r]="1";for(d=1;d<n;d++){var J=p[d];if(J&&"~"!==J&&!D[J]){var F=B.lastIndexOf(J,v),G=B.indexOf(J,v);if(-1===G&&-1===F)if(C=!1,l)u+=E;else break;else A++,-1===G||-1!==F&&v-F<G-v?(K=F-B.lastIndexOf("~",F),u+=E/(E-(v-F))+2*K,v=F):(K=G-B.lastIndexOf("~",G),u+=E/(E-(G-v))+2*K,v=G);D[J]="1"}}u/=n}d=I-1;if(C){if(this.j[y]?this.j[y]++:this.j[y]=1,f[f.length]={score:u,id:y},a&&f.length===a)break}else l&&(I=q[A]||(q[A]=[]),I[I.length]={score:u, | ||
id:y})}y=d+1}if(a&&f.length===a){m&&e<this.c.length&&d+1<this.c[e].length&&(m.next=e+":"+d,this.M[m.next]=k);break}}if(!f.length&&l&&(k=a||1E3,l=f.length,n=q.length,l<k&&n))for(g=n-1;0<=g;g--)if(n=q[g])for(d=0;d<n.length;d++)if(f[l++]=n[d],k&&l===k){g=-1;break}if(f.length){f.sort(U);for(d=0;d<f.length;d++)f[d]=f[d].id;this.b=""}else this.b||(this.b=b);this.cache&&this.g.set(b,m||f);return m||f};h.prototype.optimize=function(){var b=this.c,a=this.a,c=this.g,e=this.j;this.reset();var d=Object.keys(a); | ||
d.sort(function(a,b){a=(e[b]||0)-(e[a]||0);return 0>a?-1:0<a?1:0});for(var f=0;f<d.length;f++){var h=d[f],k=a[h];k?(k=b[k[0]].substring(k[1],k[2]),this.add(h,k,k)):delete a[h]}c&&(this.g=c);this.j=e};h.prototype.info=function(){for(var b=this.B,a=Object.keys(this.a).length,c=Object.keys(this.s).length,e=Object.keys(this.P).length,d=0,f=0,h=0;h<this.c.length;h++)f+=this.c[h].length;f&&(b=(100/f*b*100|0)/100,d=this.m[0].byteLength||32*f,d+=2*f+24*(a+c+e));return{id:this.id,length:a,chunks:this.c.length, | ||
register:e,size:this.o,bytes:d,fragments:c,fragmented:b,status:this.C,cache:this.h.length,matcher:r.length,worker:this.f}};h.prototype.reset=function(){this.destroy();return this.init()};h.prototype.destroy=function(){this.cache&&this.g.reset();this.m=this.a=this.s=this.c=this.P=this.g=this.j=this.I=this.M=this.l=this.h=null;return this};var t={icase:function(b){return b.toLowerCase()},simple:function(){var b=[d("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",d("[\u00e8\u00e9\u00ea\u00eb]"),"e",d("[\u00ec\u00ed\u00ee\u00ef]"), | ||
"i",d("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",d("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",d("[\u00fd\u0177\u00ff]"),"y",d("\u00f1"),"n",d("\u00e7"),"c",d("\u00df"),"s",d(" & ")," and ",d("[-/]")," ",d("[^a-z0-9 ]"),"",d("\\s\\s+")," "];return function(a){a=m(a.toLowerCase(),b);return" "!==a?a:""}}(),advanced:function(){var b=[d("ae"),"a",d("ai"),"ei",d("ay"),"ei",d("ey"),"ei",d("oe"),"o",d("ue"),"u",d("ie"),"i",d("sz"),"s",d("zs"),"s",d("sh"),"s",d("ck"),"k",d("cc"),"k",d("dt"),"t",d("ph"),"f", | ||
d("pf"),"f",d("ou"),"o",d("uo"),"u"];return function(a,c){if(!a)return a;a=this.simple(a);2<a.length&&(a=m(a,b));c||1<a.length&&(a=z(a));return a}}(),extra:function(){var b=[d("p"),"b",d("z"),"s",d("[cgq]"),"k",d("n"),"m",d("d"),"t",d("[vw]"),"f",d("[aeiouy]"),""];return function(a){if(!a)return a;a=this.advanced(a,!0);if(1<a.length){a=a.split(" ");for(var c=0;c<a.length;c++){var e=a[c];1<e.length&&(a[c]=e[0]+m(e.substring(1),b))}a=a.join(" ");a=z(a)}return a}}(),balance:function(){var b=[d("[-/]"), | ||
" ",d("[^a-z0-9 ]"),"",d("\\s\\s+")," "];return function(a){return z(m(a.toLowerCase(),b))}}()},N=function(){var b={};return function(a,c,e){var d=b[e];d&&clearTimeout(d);return b[e]=setTimeout(a,c)}}(),R=function(){function b(a){this.reset();this.K=!0!==a&&a}b.prototype.reset=function(){this.cache={};this.count={};this.index={};this.keys=[]};b.prototype.set=function(a,b){if(this.K&&"undefined"===typeof this.cache[a]){var c=this.keys.length;if(c===this.K){c--;var d=this.keys[c];delete this.cache[d]; | ||
delete this.count[d];delete this.index[d]}this.index[a]=c;this.keys[c]=a;this.count[a]=-1;this.cache[a]=b;this.get(a)}else this.cache[a]=b};b.prototype.get=function(a){var b=this.cache[a];if(this.K&&b){var d=++this.count[a],g=this.index,f=g[a];if(0<f){for(var h=this.keys,k=f;this.count[h[--f]]<=d&&-1!==f;);f++;if(f!==k){for(d=k;d>f;d--)k=h[d-1],h[d]=k,g[k]=d;h[f]=a;g[a]=f}}}return b};return b}();return h}(function(){var p={},H=!("undefined"===typeof Blob||"undefined"===typeof URL||!URL.createObjectURL); | ||
return function(h,l,d,C,m){var w=h;h=H?URL.createObjectURL(new Blob(["var SUPPORT_WORKER = true;var SUPPORT_BUILTINS = true;var SUPPORT_DEBUG = true;var SUPPORT_CACHE = true;var SUPPORT_ASYNC = true;("+d.toString()+")()"],{type:"text/javascript"})):"../"+w+".js";w+="-"+l;p[w]||(p[w]=[]);p[w][m]=new Worker(h);p[w][m].onmessage=C;console.log("Register Worker: "+w+"@"+m);return{postMessage:function(d,h){p[w][d].postMessage(h)}}}}()),this); |
{ | ||
"name": "bulksearch", | ||
"version": "0.1.2", | ||
"description": "Superfast lightweight full text search engine.", | ||
"version": "0.1.3", | ||
"description": "Superfast, lightweight and read-write optimized full text search library.", | ||
"homepage": "https://nextapps-de.github.io/xone/", | ||
"author": "Thomas Wilkerling", | ||
"license": "Apache-2.0", | ||
"keywords": [], | ||
@@ -10,3 +13,3 @@ "bugs": { | ||
}, | ||
"main": "bulksearch.js", | ||
"main": "bulksearch.min.js", | ||
"preferGlobal": false, | ||
@@ -18,8 +21,33 @@ "bin": {}, | ||
}, | ||
"scripts": {}, | ||
"homepage": "https://nextapps-de.github.io/xone/", | ||
"author": "Thomas Wilkerling", | ||
"license": "Apache-2.0", | ||
"scripts": { | ||
"build": "node compile RELEASE=min SUPPORT_DEBUG=true SUPPORT_WORKER=true SUPPORT_BUILTINS=true SUPPORT_CACHE=true SUPPORT_ASYNC=true && exit 0", | ||
"build-light": "node compile RELEASE=light && exit 0", | ||
"build-custom": "node compile", | ||
"build-lang": "node compile RELEASE=lang && exit 0", | ||
"build-all": "npm run build && npm run build-light && npm run build-lang", | ||
"test-production": "nyc --reporter=html --reporter=text mocha --timeout=3000 test --exit", | ||
"test-light": "nyc --reporter=html --reporter=text mocha --timeout=3000 test/ --exit", | ||
"test-develop": "nyc --reporter=html --reporter=text mocha --timeout=3000 --exit", | ||
"test-browser": "mocha-phantomjs test/index.html", | ||
"test": "npm run test-develop && npm run test-production && npm run test-browser", | ||
"update": "node_modules/.bin/updtr --to non-breaking", | ||
"coverage": "nyc report --reporter=lcov --reporter=text-lcov | coveralls" | ||
}, | ||
"files": [ | ||
"bulksearch.js", | ||
"bulksearch.min.js", | ||
"lang/", | ||
"test/" | ||
], | ||
"dependencies": {}, | ||
"devDependencies": {} | ||
"devDependencies": { | ||
"chai": "^4.1.2", | ||
"coveralls": "^3.0.0", | ||
"google-closure-compiler": "^20180204.0.0", | ||
"mocha": "^5.0.4", | ||
"mocha-phantomjs": "^4.1.0", | ||
"nyc": "^11.5.0", | ||
"phantomjs-prebuilt": "^2.1.16", | ||
"updtr": "^2.0.0" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
746200
12
3010
766
8
1