mirror of
https://github.com/nextapps-de/flexsearch.git
synced 2025-08-26 07:15:36 +02:00
fix node.js exports, resolve eval
This commit is contained in:
25
.babelrc
25
.babelrc
@@ -1,25 +0,0 @@
|
||||
{
|
||||
"plugins": [
|
||||
"babel-plugin-minify-constant-folding",
|
||||
"babel-plugin-minify-dead-code-elimination",
|
||||
"babel-plugin-minify-flip-comparisons",
|
||||
"babel-plugin-minify-guarded-expressions",
|
||||
"babel-plugin-minify-infinity",
|
||||
"babel-plugin-minify-mangle-names",
|
||||
"babel-plugin-minify-replace",
|
||||
"babel-plugin-minify-simplify",
|
||||
"babel-plugin-minify-type-constructors",
|
||||
"babel-plugin-transform-member-expression-literals",
|
||||
"babel-plugin-transform-merge-sibling-variables",
|
||||
"babel-plugin-transform-minify-booleans",
|
||||
"babel-plugin-transform-property-literals",
|
||||
"babel-plugin-transform-simplify-comparison-operators",
|
||||
"babel-plugin-transform-undefined-to-void"
|
||||
],
|
||||
"ignore": [
|
||||
"config/**"
|
||||
],
|
||||
"minified": true,
|
||||
"compact": true,
|
||||
"comments": false
|
||||
}
|
6
dist/flexsearch.bundle.debug.js
vendored
6
dist/flexsearch.bundle.debug.js
vendored
@@ -1,11 +1,11 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.40 (Bundle)
|
||||
* FlexSearch.js v0.7.41 (Bundle)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
* https://github.com/nextapps-de/flexsearch
|
||||
*/
|
||||
(function _factory(self){'use strict';
|
||||
(function _f(self){'use strict';try{if(module)self=module}catch(e){}self._factory=_f;
|
||||
var t;
|
||||
function u(a) {
|
||||
return "undefined" !== typeof a ? a : !0;
|
||||
@@ -602,7 +602,7 @@ function Q(a) {
|
||||
function wa(a, b, c) {
|
||||
let d;
|
||||
try {
|
||||
d = b ? eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")') : a ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + ua.toString()], {type:"text/javascript"}))) : new Worker(C(c) ? c : "worker/worker.js", {type:"module"});
|
||||
d = b ? new (require("worker_threads")["Worker"])(__dirname + "/node/node.js") : a ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + ua.toString()], {type:"text/javascript"}))) : new Worker(C(c) ? c : "worker/worker.js", {type:"module"});
|
||||
} catch (e) {
|
||||
}
|
||||
return d;
|
||||
|
6
dist/flexsearch.bundle.min.js
vendored
6
dist/flexsearch.bundle.min.js
vendored
@@ -1,11 +1,11 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.40 (Bundle)
|
||||
* FlexSearch.js v0.7.41 (Bundle)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
* https://github.com/nextapps-de/flexsearch
|
||||
*/
|
||||
(function _factory(self){'use strict';var t;function u(a){return"undefined"!==typeof a?a:!0}function v(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=x();return b}function x(){return Object.create(null)}function aa(a,b){return b.length-a.length}function C(a){return"string"===typeof a}function D(a){return"object"===typeof a}function E(a){return"function"===typeof a};function ba(a,b){var c=ca;if(a&&(b&&(a=F(a,b)),this.H&&(a=F(a,this.H)),this.J&&1<a.length&&(a=F(a,this.J)),c||""===c)){b=a.split(c);if(this.filter){a=this.filter;c=b.length;const d=[];for(let e=0,f=0;e<c;e++){const h=b[e];h&&!a[h]&&(d[f++]=h)}a=d}else a=b;return a}return a}const ca=/[\p{Z}\p{S}\p{P}\p{C}]+/u,da=/[\u0300-\u036f]/g;
|
||||
(function _f(self){'use strict';try{if(module)self=module}catch(e){}self._factory=_f;var t;function u(a){return"undefined"!==typeof a?a:!0}function v(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=x();return b}function x(){return Object.create(null)}function aa(a,b){return b.length-a.length}function C(a){return"string"===typeof a}function D(a){return"object"===typeof a}function E(a){return"function"===typeof a};function ba(a,b){var c=ca;if(a&&(b&&(a=F(a,b)),this.H&&(a=F(a,this.H)),this.J&&1<a.length&&(a=F(a,this.J)),c||""===c)){b=a.split(c);if(this.filter){a=this.filter;c=b.length;const d=[];for(let e=0,f=0;e<c;e++){const h=b[e];h&&!a[h]&&(d[f++]=h)}a=d}else a=b;return a}return a}const ca=/[\p{Z}\p{S}\p{P}\p{C}]+/u,da=/[\u0300-\u036f]/g;
|
||||
function ea(a,b){const c=Object.keys(a),d=c.length,e=[];let f="",h=0;for(let g=0,k,m;g<d;g++)k=c[g],(m=a[k])?(e[h++]=G(b?"(?!\\b)"+k+"(\\b|_)":k),e[h++]=m):f+=(f?"|":"")+k;f&&(e[h++]=G(b?"(?!\\b)("+f+")(\\b|_)":"("+f+")"),e[h]="");return e}function F(a,b){for(let c=0,d=b.length;c<d&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a}function G(a){return new RegExp(a,"g")}function fa(a){let b="",c="";for(let d=0,e=a.length,f;d<e;d++)(f=a[d])!==c&&(b+=c=f);return b};var ia={encode:ha,F:!1,G:""};function ha(a){return ba.call(this,(""+a).toLowerCase(),!1)};const ja={},I={};function ka(a){J(a,"add");J(a,"append");J(a,"search");J(a,"update");J(a,"remove")}function J(a,b){a[b+"Async"]=function(){const c=this,d=arguments;var e=d[d.length-1];let f;E(e)&&(f=e,delete d[d.length-1]);e=new Promise(function(h){setTimeout(function(){c.async=!0;const g=c[b].apply(c,d);c.async=!1;h(g)})});return f?(e.then(f),this):e}};function la(a,b,c,d){const e=a.length;let f=[],h,g,k=0;d&&(d=[]);for(let m=e-1;0<=m;m--){const n=a[m],w=n.length,q=x();let r=!h;for(let l=0;l<w;l++){const p=n[l],A=p.length;if(A)for(let B=0,z,y;B<A;B++)if(y=p[B],h){if(h[y]){if(!m)if(c)c--;else if(f[k++]=y,k===b)return f;if(m||d)q[y]=1;r=!0}if(d&&(z=(g[y]||0)+1,g[y]=z,z<e)){const H=d[z-2]||(d[z-2]=[]);H[H.length]=y}}else q[y]=1}if(d)h||(g=q);else if(!r)return[];h=q}if(d)for(let m=d.length-1,n,w;0<=m;m--){n=d[m];w=n.length;for(let q=0,r;q<w;q++)if(r=
|
||||
n[q],!h[r]){if(c)c--;else if(f[k++]=r,k===b)return f;h[r]=1}}return f}function ma(a,b){const c=x(),d=x(),e=[];for(let f=0;f<a.length;f++)c[a[f]]=1;for(let f=0,h;f<b.length;f++){h=b[f];for(let g=0,k;g<h.length;g++)k=h[g],c[k]&&!d[k]&&(d[k]=1,e[e.length]=k)}return e};function K(a){this.l=!0!==a&&a;this.cache=x();this.h=[]}function na(a,b,c){D(a)&&(a=a.query);let d=this.cache.get(a);d||(d=this.search(a,b,c),this.cache.set(a,d));return d}K.prototype.set=function(a,b){if(!this.cache[a]){var c=this.h.length;c===this.l?delete this.cache[this.h[c-1]]:c++;for(--c;0<c;c--)this.h[c]=this.h[c-1];this.h[0]=a}this.cache[a]=b};K.prototype.get=function(a){const b=this.cache[a];if(this.l&&b&&(a=this.h.indexOf(a))){const c=this.h[a-1];this.h[a-1]=this.h[a];this.h[a]=c}return b};const pa={memory:{charset:"latin:extra",D:3,B:4,m:!1},performance:{D:3,B:3,s:!1,context:{depth:2,D:1}},match:{charset:"latin:extra",G:"reverse"},score:{charset:"latin:advanced",D:20,B:3,context:{depth:3,D:9}},"default":{}};function qa(a,b,c,d,e,f,h,g){setTimeout(function(){const k=a(c?c+"."+d:d,JSON.stringify(h));k&&k.then?k.then(function(){b.export(a,b,c,e,f+1,g)}):b.export(a,b,c,e,f+1,g)})};function L(a,b){if(!(this instanceof L))return new L(a);var c;if(a){C(a)?a=pa[a]:(c=a.preset)&&(a=Object.assign({},c[c],a));c=a.charset;var d=a.lang;C(c)&&(-1===c.indexOf(":")&&(c+=":default"),c=I[c]);C(d)&&(d=ja[d])}else a={};let e,f,h=a.context||{};this.encode=a.encode||c&&c.encode||ha;this.register=b||x();this.D=e=a.resolution||9;this.G=b=c&&c.G||a.tokenize||"strict";this.depth="strict"===b&&h.depth;this.l=u(h.bidirectional);this.s=f=u(a.optimize);this.m=u(a.fastupdate);this.B=a.minlength||1;this.C=
|
||||
a.boost;this.map=f?v(e):x();this.A=e=h.resolution||1;this.h=f?v(e):x();this.F=c&&c.F||a.rtl;this.H=(b=a.matcher||d&&d.H)&&ea(b,!1);this.J=(b=a.stemmer||d&&d.J)&&ea(b,!0);if(c=b=a.filter||d&&d.filter){c=b;d=x();for(let g=0,k=c.length;g<k;g++)d[c[g]]=1;c=d}this.filter=c;this.cache=(b=a.cache)&&new K(b)}t=L.prototype;t.append=function(a,b){return this.add(a,b,!0)};
|
||||
@@ -21,7 +21,7 @@ function O(a,b,c,d,e){let f=0;if(a.constructor===Array)if(e)b=a.indexOf(b),-1!==
|
||||
t.export=function(a,b,c,d,e,f){let h=!0;"undefined"===typeof f&&(h=new Promise(m=>{f=m}));let g,k;switch(e||(e=0)){case 0:g="reg";if(this.m){k=x();for(let m in this.register)k[m]=1}else k=this.register;break;case 1:g="cfg";k={doc:0,opt:this.s?1:0};break;case 2:g="map";k=this.map;break;case 3:g="ctx";k=this.h;break;default:"undefined"===typeof c&&f&&f();return}qa(a,b||this,c,g,d,e,k,f);return h};
|
||||
t.import=function(a,b){if(b)switch(C(b)&&(b=JSON.parse(b)),a){case "cfg":this.s=!!b.opt;break;case "reg":this.m=!1;this.register=b;break;case "map":this.map=b;break;case "ctx":this.h=b}};ka(L.prototype);function ua(a){a=a.data;var b=self._index;const c=a.args;var d=a.task;switch(d){case "init":d=a.options||{};a=a.factory;b=d.encode;d.cache=!1;b&&0===b.indexOf("function")&&(d.encode=Function("return "+b)());a?(Function("return "+a)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new L(d);break;default:a=a.id,b=b[d].apply(b,c),postMessage("search"===d?{id:a,msg:b}:{id:a})}};let va=0;function P(a){if(!(this instanceof P))return new P(a);var b;a?E(b=a.encode)&&(a.encode=b.toString()):a={};(b=(self||window)._factory)&&(b=b.toString());const c="undefined"===typeof window&&self.exports,d=this;this.o=wa(b,c,a.worker);this.h=x();if(this.o){if(c)this.o.on("message",function(e){d.h[e.id](e.msg);delete d.h[e.id]});else this.o.onmessage=function(e){e=e.data;d.h[e.id](e.msg);delete d.h[e.id]};this.o.postMessage({task:"init",factory:b,options:a})}}Q("add");Q("append");Q("search");
|
||||
Q("update");Q("remove");function Q(a){P.prototype[a]=P.prototype[a+"Async"]=function(){const b=this,c=[].slice.call(arguments);var d=c[c.length-1];let e;E(d)&&(e=d,c.splice(c.length-1,1));d=new Promise(function(f){setTimeout(function(){b.h[++va]=f;b.o.postMessage({task:a,id:va,args:c})})});return e?(d.then(e),this):d}}
|
||||
function wa(a,b,c){let d;try{d=b?eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")'):a?new Worker(URL.createObjectURL(new Blob(["onmessage="+ua.toString()],{type:"text/javascript"}))):new Worker(C(c)?c:"worker/worker.js",{type:"module"})}catch(e){}return d};function S(a){if(!(this instanceof S))return new S(a);var b=a.document||a.doc||a,c;this.K=[];this.h=[];this.A=[];this.register=x();this.key=(c=b.key||b.id)&&T(c,this.A)||"id";this.m=u(a.fastupdate);this.C=(c=b.store)&&!0!==c&&[];this.store=c&&x();this.I=(c=b.tag)&&T(c,this.A);this.l=c&&x();this.cache=(c=a.cache)&&new K(c);a.cache=!1;this.o=a.worker;this.async=!1;c=x();let d=b.index||b.field||b;C(d)&&(d=[d]);for(let e=0,f,h;e<d.length;e++)f=d[e],C(f)||(h=f,f=f.field),h=D(h)?Object.assign({},a,h):a,
|
||||
function wa(a,b,c){let d;try{d=b?new (require("worker_threads")["Worker"])(__dirname + "/node/node.js"):a?new Worker(URL.createObjectURL(new Blob(["onmessage="+ua.toString()],{type:"text/javascript"}))):new Worker(C(c)?c:"worker/worker.js",{type:"module"})}catch(e){}return d};function S(a){if(!(this instanceof S))return new S(a);var b=a.document||a.doc||a,c;this.K=[];this.h=[];this.A=[];this.register=x();this.key=(c=b.key||b.id)&&T(c,this.A)||"id";this.m=u(a.fastupdate);this.C=(c=b.store)&&!0!==c&&[];this.store=c&&x();this.I=(c=b.tag)&&T(c,this.A);this.l=c&&x();this.cache=(c=a.cache)&&new K(c);a.cache=!1;this.o=a.worker;this.async=!1;c=x();let d=b.index||b.field||b;C(d)&&(d=[d]);for(let e=0,f,h;e<d.length;e++)f=d[e],C(f)||(h=f,f=f.field),h=D(h)?Object.assign({},a,h):a,
|
||||
this.o&&(c[f]=new P(h),c[f].o||(this.o=!1)),this.o||(c[f]=new L(h,this.register)),this.K[e]=T(f,this.A),this.h[e]=f;if(this.C)for(a=b.store,C(a)&&(a=[a]),b=0;b<a.length;b++)this.C[b]=T(a[b],this.A);this.index=c}function T(a,b){const c=a.split(":");let d=0;for(let e=0;e<c.length;e++)a=c[e],0<=a.indexOf("[]")&&(a=a.substring(0,a.length-2))&&(b[d]=!0),a&&(c[d++]=a);d<c.length&&(c.length=d);return 1<d?c:c[0]}function U(a,b){if(C(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a}
|
||||
function V(a,b,c,d,e){a=a[e];if(d===c.length-1)b[e]=a;else if(a)if(a.constructor===Array)for(b=b[e]=Array(a.length),e=0;e<a.length;e++)V(a,b,c,d,e);else b=b[e]||(b[e]=x()),e=c[++d],V(a,b,c,d,e)}function X(a,b,c,d,e,f,h,g){if(a=a[h])if(d===b.length-1){if(a.constructor===Array){if(c[d]){for(b=0;b<a.length;b++)e.add(f,a[b],!0,!0);return}a=a.join(" ")}e.add(f,a,g,!0)}else if(a.constructor===Array)for(h=0;h<a.length;h++)X(a,b,c,d,e,f,h,g);else h=b[++d],X(a,b,c,d,e,f,h,g)}t=S.prototype;
|
||||
t.add=function(a,b,c){D(a)&&(b=a,a=U(b,this.key));if(b&&(a||0===a)){if(!c&&this.register[a])return this.update(a,b);for(let d=0,e,f;d<this.h.length;d++)f=this.h[d],e=this.K[d],C(e)&&(e=[e]),X(b,e,this.A,0,this.index[f],a,e[0],c);if(this.I){let d=U(b,this.I),e=x();C(d)&&(d=[d]);for(let f=0,h,g;f<d.length;f++)if(h=d[f],!e[h]&&(e[h]=1,g=this.l[h]||(this.l[h]=[]),!c||!g.includes(a)))if(g[g.length]=a,this.m){const k=this.register[a]||(this.register[a]=[]);k[k.length]=g}}if(this.store&&(!c||!this.store[a])){let d;
|
||||
|
4
dist/flexsearch.bundle.module.debug.js
vendored
4
dist/flexsearch.bundle.module.debug.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.40 (Bundle.module)
|
||||
* FlexSearch.js v0.7.41 (Bundle.module)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
@@ -601,7 +601,7 @@ function T(a) {
|
||||
function ua(a, b, c) {
|
||||
let d;
|
||||
try {
|
||||
d = b ? eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")') : a ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + sa.toString()], {type:"text/javascript"}))) : new Worker(C(c) ? c : "worker/worker.js", {type:"module"});
|
||||
d = b ? new (require("worker_threads")["Worker"])(__dirname + "/node/node.js") : a ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + sa.toString()], {type:"text/javascript"}))) : new Worker(C(c) ? c : "worker/worker.js", {type:"module"});
|
||||
} catch (e) {
|
||||
}
|
||||
return d;
|
||||
|
4
dist/flexsearch.bundle.module.min.js
vendored
4
dist/flexsearch.bundle.module.min.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.40 (Bundle.module)
|
||||
* FlexSearch.js v0.7.41 (Bundle.module)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
@@ -21,7 +21,7 @@ function Q(a,b,c,d,e){let f=0;if(a.constructor===Array)if(e)b=a.indexOf(b),-1!==
|
||||
t.export=function(a,b,c,d,e,f){let h=!0;"undefined"===typeof f&&(h=new Promise(m=>{f=m}));let g,k;switch(e||(e=0)){case 0:g="reg";if(this.m){k=x();for(let m in this.register)k[m]=1}else k=this.register;break;case 1:g="cfg";k={doc:0,opt:this.s?1:0};break;case 2:g="map";k=this.map;break;case 3:g="ctx";k=this.h;break;default:"undefined"===typeof c&&f&&f();return}oa(a,b||this,c,g,d,e,k,f);return h};
|
||||
t.import=function(a,b){if(b)switch(C(b)&&(b=JSON.parse(b)),a){case "cfg":this.s=!!b.opt;break;case "reg":this.m=!1;this.register=b;break;case "map":this.map=b;break;case "ctx":this.h=b}};ia(N.prototype);function sa(a){a=a.data;var b=self._index;const c=a.args;var d=a.task;switch(d){case "init":d=a.options||{};a=a.factory;b=d.encode;d.cache=!1;b&&0===b.indexOf("function")&&(d.encode=Function("return "+b)());a?(Function("return "+a)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new N(d);break;default:a=a.id,b=b[d].apply(b,c),postMessage("search"===d?{id:a,msg:b}:{id:a})}};let ta=0;function S(a){if(!(this instanceof S))return new S(a);var b;a?E(b=a.encode)&&(a.encode=b.toString()):a={};(b=(self||window)._factory)&&(b=b.toString());const c="undefined"===typeof window&&self.exports,d=this;this.o=ua(b,c,a.worker);this.h=x();if(this.o){if(c)this.o.on("message",function(e){d.h[e.id](e.msg);delete d.h[e.id]});else this.o.onmessage=function(e){e=e.data;d.h[e.id](e.msg);delete d.h[e.id]};this.o.postMessage({task:"init",factory:b,options:a})}}T("add");T("append");T("search");
|
||||
T("update");T("remove");function T(a){S.prototype[a]=S.prototype[a+"Async"]=function(){const b=this,c=[].slice.call(arguments);var d=c[c.length-1];let e;E(d)&&(e=d,c.splice(c.length-1,1));d=new Promise(function(f){setTimeout(function(){b.h[++ta]=f;b.o.postMessage({task:a,id:ta,args:c})})});return e?(d.then(e),this):d}}
|
||||
function ua(a,b,c){let d;try{d=b?eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")'):a?new Worker(URL.createObjectURL(new Blob(["onmessage="+sa.toString()],{type:"text/javascript"}))):new Worker(C(c)?c:"worker/worker.js",{type:"module"})}catch(e){}return d};function U(a){if(!(this instanceof U))return new U(a);var b=a.document||a.doc||a,c;this.K=[];this.h=[];this.A=[];this.register=x();this.key=(c=b.key||b.id)&&V(c,this.A)||"id";this.m=u(a.fastupdate);this.C=(c=b.store)&&!0!==c&&[];this.store=c&&x();this.I=(c=b.tag)&&V(c,this.A);this.l=c&&x();this.cache=(c=a.cache)&&new M(c);a.cache=!1;this.o=a.worker;this.async=!1;c=x();let d=b.index||b.field||b;C(d)&&(d=[d]);for(let e=0,f,h;e<d.length;e++)f=d[e],C(f)||(h=f,f=f.field),h=D(h)?Object.assign({},a,h):a,
|
||||
function ua(a,b,c){let d;try{d=b?new (require("worker_threads")["Worker"])(__dirname + "/node/node.js"):a?new Worker(URL.createObjectURL(new Blob(["onmessage="+sa.toString()],{type:"text/javascript"}))):new Worker(C(c)?c:"worker/worker.js",{type:"module"})}catch(e){}return d};function U(a){if(!(this instanceof U))return new U(a);var b=a.document||a.doc||a,c;this.K=[];this.h=[];this.A=[];this.register=x();this.key=(c=b.key||b.id)&&V(c,this.A)||"id";this.m=u(a.fastupdate);this.C=(c=b.store)&&!0!==c&&[];this.store=c&&x();this.I=(c=b.tag)&&V(c,this.A);this.l=c&&x();this.cache=(c=a.cache)&&new M(c);a.cache=!1;this.o=a.worker;this.async=!1;c=x();let d=b.index||b.field||b;C(d)&&(d=[d]);for(let e=0,f,h;e<d.length;e++)f=d[e],C(f)||(h=f,f=f.field),h=D(h)?Object.assign({},a,h):a,
|
||||
this.o&&(c[f]=new S(h),c[f].o||(this.o=!1)),this.o||(c[f]=new N(h,this.register)),this.K[e]=V(f,this.A),this.h[e]=f;if(this.C)for(a=b.store,C(a)&&(a=[a]),b=0;b<a.length;b++)this.C[b]=V(a[b],this.A);this.index=c}function V(a,b){const c=a.split(":");let d=0;for(let e=0;e<c.length;e++)a=c[e],0<=a.indexOf("[]")&&(a=a.substring(0,a.length-2))&&(b[d]=!0),a&&(c[d++]=a);d<c.length&&(c.length=d);return 1<d?c:c[0]}function X(a,b){if(C(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a}
|
||||
function Y(a,b,c,d,e){a=a[e];if(d===c.length-1)b[e]=a;else if(a)if(a.constructor===Array)for(b=b[e]=Array(a.length),e=0;e<a.length;e++)Y(a,b,c,d,e);else b=b[e]||(b[e]=x()),e=c[++d],Y(a,b,c,d,e)}function Z(a,b,c,d,e,f,h,g){if(a=a[h])if(d===b.length-1){if(a.constructor===Array){if(c[d]){for(b=0;b<a.length;b++)e.add(f,a[b],!0,!0);return}a=a.join(" ")}e.add(f,a,g,!0)}else if(a.constructor===Array)for(h=0;h<a.length;h++)Z(a,b,c,d,e,f,h,g);else h=b[++d],Z(a,b,c,d,e,f,h,g)}t=U.prototype;
|
||||
t.add=function(a,b,c){D(a)&&(b=a,a=X(b,this.key));if(b&&(a||0===a)){if(!c&&this.register[a])return this.update(a,b);for(let d=0,e,f;d<this.h.length;d++)f=this.h[d],e=this.K[d],C(e)&&(e=[e]),Z(b,e,this.A,0,this.index[f],a,e[0],c);if(this.I){let d=X(b,this.I),e=x();C(d)&&(d=[d]);for(let f=0,h,g;f<d.length;f++)if(h=d[f],!e[h]&&(e[h]=1,g=this.l[h]||(this.l[h]=[]),!c||!g.includes(a)))if(g[g.length]=a,this.m){const k=this.register[a]||(this.register[a]=[]);k[k.length]=g}}if(this.store&&(!c||!this.store[a])){let d;
|
||||
|
2
dist/flexsearch.compact.debug.js
vendored
2
dist/flexsearch.compact.debug.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.40 (Compact)
|
||||
* FlexSearch.js v0.7.41 (Compact)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
|
2
dist/flexsearch.compact.min.js
vendored
2
dist/flexsearch.compact.min.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.40 (Compact)
|
||||
* FlexSearch.js v0.7.41 (Compact)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
|
2
dist/flexsearch.compact.module.debug.js
vendored
2
dist/flexsearch.compact.module.debug.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.40 (Compact.module)
|
||||
* FlexSearch.js v0.7.41 (Compact.module)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
|
2
dist/flexsearch.compact.module.min.js
vendored
2
dist/flexsearch.compact.module.min.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.40 (Compact.module)
|
||||
* FlexSearch.js v0.7.41 (Compact.module)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
|
4
dist/flexsearch.es5.debug.js
vendored
4
dist/flexsearch.es5.debug.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.40 (Es5)
|
||||
* FlexSearch.js v0.7.41 (Es5)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
@@ -973,7 +973,7 @@ function S(a) {
|
||||
}
|
||||
function Ca(a, b, c) {
|
||||
try {
|
||||
var d = b ? eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")') : a ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + Aa.toString()], {type:"text/javascript"}))) : new Worker(E(c) ? c : "worker/worker.js", {type:"module"});
|
||||
var d = b ? new (require("worker_threads")["Worker"])(__dirname + "/node/node.js") : a ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + Aa.toString()], {type:"text/javascript"}))) : new Worker(E(c) ? c : "worker/worker.js", {type:"module"});
|
||||
} catch (e) {
|
||||
}
|
||||
return d;
|
||||
|
4
dist/flexsearch.es5.min.js
vendored
4
dist/flexsearch.es5.min.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.40 (Es5)
|
||||
* FlexSearch.js v0.7.41 (Es5)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
@@ -35,7 +35,7 @@ function Q(a,b,c,d,e){var g=0;if(a.constructor===Array)if(e)b=a.indexOf(b),-1!==
|
||||
t.export=function(a,b,c,d,e,g){var f=!0;"undefined"===typeof g&&(f=new Promise(function(m){g=m}));switch(e||(e=0)){case 0:var h="reg";if(this.s){var k=D();for(var l in this.register)k[l]=1}else k=this.register;break;case 1:h="cfg";k={doc:0,opt:this.B?1:0};break;case 2:h="map";k=this.map;break;case 3:h="ctx";k=this.h;break;default:"undefined"===typeof c&&g&&g();return}wa(a,b||this,c,h,d,e,k,g);return f};
|
||||
t.import=function(a,b){if(b)switch(E(b)&&(b=JSON.parse(b)),a){case "cfg":this.B=!!b.opt;break;case "reg":this.s=!1;this.register=b;break;case "map":this.map=b;break;case "ctx":this.h=b}};ra(N.prototype);function Aa(a){a=a.data;var b=self._index,c=a.args,d=a.task;switch(d){case "init":d=a.options||{};a=a.factory;b=d.encode;d.cache=!1;b&&0===b.indexOf("function")&&(d.encode=Function("return "+b)());a?(Function("return "+a)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new N(d);break;default:a=a.id,b=b[d].apply(b,c),postMessage("search"===d?{id:a,msg:b}:{id:a})}};var Ba=0;function R(a){if(!(this instanceof R))return new R(a);var b;a?G(b=a.encode)&&(a.encode=b.toString()):a={};(b=(self||window)._factory)&&(b=b.toString());var c="undefined"===typeof window&&self.exports,d=this;this.A=Ca(b,c,a.worker);this.h=D();if(this.A){if(c)this.A.on("message",function(e){d.h[e.id](e.msg);delete d.h[e.id]});else this.A.onmessage=function(e){e=e.data;d.h[e.id](e.msg);delete d.h[e.id]};this.A.postMessage({task:"init",factory:b,options:a})}}S("add");S("append");S("search");
|
||||
S("update");S("remove");function S(a){R.prototype[a]=R.prototype[a+"Async"]=function(){var b=this,c=[].slice.call(arguments),d=c[c.length-1];if(G(d)){var e=d;c.splice(c.length-1,1)}d=new Promise(function(g){setTimeout(function(){b.h[++Ba]=g;b.A.postMessage({task:a,id:Ba,args:c})})});return e?(d.then(e),this):d}}
|
||||
function Ca(a,b,c){try{var d=b?eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")'):a?new Worker(URL.createObjectURL(new Blob(["onmessage="+Aa.toString()],{type:"text/javascript"}))):new Worker(E(c)?c:"worker/worker.js",{type:"module"})}catch(e){}return d};function T(a){if(!(this instanceof T))return new T(a);var b=a.document||a.doc||a,c;this.I=[];this.h=[];this.m=[];this.register=D();this.key=(c=b.key||b.id)&&U(c,this.m)||"id";this.s=C(a.fastupdate);this.o=(c=b.store)&&!0!==c&&[];this.store=c&&D();this.D=(c=b.tag)&&U(c,this.m);this.l=c&&D();this.cache=(c=a.cache)&&new M(c);a.cache=!1;this.A=a.worker;this.async=!1;c=D();var d=b.index||b.field||b;E(d)&&(d=[d]);for(var e=0,g,f=void 0;e<d.length;e++)g=d[e],E(g)||(f=g,g=g.field),f=F(f)?Object.assign({},
|
||||
function Ca(a,b,c){try{var d=b?new (require("worker_threads")["Worker"])(__dirname + "/node/node.js"):a?new Worker(URL.createObjectURL(new Blob(["onmessage="+Aa.toString()],{type:"text/javascript"}))):new Worker(E(c)?c:"worker/worker.js",{type:"module"})}catch(e){}return d};function T(a){if(!(this instanceof T))return new T(a);var b=a.document||a.doc||a,c;this.I=[];this.h=[];this.m=[];this.register=D();this.key=(c=b.key||b.id)&&U(c,this.m)||"id";this.s=C(a.fastupdate);this.o=(c=b.store)&&!0!==c&&[];this.store=c&&D();this.D=(c=b.tag)&&U(c,this.m);this.l=c&&D();this.cache=(c=a.cache)&&new M(c);a.cache=!1;this.A=a.worker;this.async=!1;c=D();var d=b.index||b.field||b;E(d)&&(d=[d]);for(var e=0,g,f=void 0;e<d.length;e++)g=d[e],E(g)||(f=g,g=g.field),f=F(f)?Object.assign({},
|
||||
a,f):a,this.A&&(c[g]=new R(f),c[g].A||(this.A=!1)),this.A||(c[g]=new N(f,this.register)),this.I[e]=U(g,this.m),this.h[e]=g;if(this.o)for(a=b.store,E(a)&&(a=[a]),b=0;b<a.length;b++)this.o[b]=U(a[b],this.m);this.index=c}function U(a,b){for(var c=a.split(":"),d=0,e=0;e<c.length;e++)a=c[e],0<=a.indexOf("[]")&&(a=a.substring(0,a.length-2))&&(b[d]=!0),a&&(c[d++]=a);d<c.length&&(c.length=d);return 1<d?c:c[0]}function V(a,b){if(E(b))a=a[b];else for(var c=0;a&&c<b.length;c++)a=a[b[c]];return a}
|
||||
function W(a,b,c,d,e){a=a[e];if(d===c.length-1)b[e]=a;else if(a)if(a.constructor===Array)for(b=b[e]=Array(a.length),e=0;e<a.length;e++)W(a,b,c,d,e);else b=b[e]||(b[e]=D()),e=c[++d],W(a,b,c,d,e)}function X(a,b,c,d,e,g,f,h){if(a=a[f])if(d===b.length-1){if(a.constructor===Array){if(c[d]){for(b=0;b<a.length;b++)e.add(g,a[b],!0,!0);return}a=a.join(" ")}e.add(g,a,h,!0)}else if(a.constructor===Array)for(f=0;f<a.length;f++)X(a,b,c,d,e,g,f,h);else f=b[++d],X(a,b,c,d,e,g,f,h)}t=T.prototype;
|
||||
t.add=function(a,b,c){F(a)&&(b=a,a=V(b,this.key));if(b&&(a||0===a)){if(!c&&this.register[a])return this.update(a,b);for(var d=0,e,g;d<this.h.length;d++)g=this.h[d],e=this.I[d],E(e)&&(e=[e]),X(b,e,this.m,0,this.index[g],a,e[0],c);if(this.D){d=V(b,this.D);e=D();E(d)&&(d=[d]);g=0;for(var f;g<d.length;g++)if(f=d[g],!e[f]&&(e[f]=1,f=this.l[f]||(this.l[f]=[]),!c||!f.includes(a)))if(f[f.length]=a,this.s){var h=this.register[a]||(this.register[a]=[]);h[h.length]=f}}if(this.store&&(!c||!this.store[a])){if(this.o){var k=
|
||||
|
2
dist/flexsearch.light.debug.js
vendored
2
dist/flexsearch.light.debug.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.40 (Light)
|
||||
* FlexSearch.js v0.7.41 (Light)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
|
2
dist/flexsearch.light.min.js
vendored
2
dist/flexsearch.light.min.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.40 (Light)
|
||||
* FlexSearch.js v0.7.41 (Light)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
|
2
dist/flexsearch.light.module.debug.js
vendored
2
dist/flexsearch.light.module.debug.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.40 (Light.module)
|
||||
* FlexSearch.js v0.7.41 (Light.module)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
|
2
dist/flexsearch.light.module.min.js
vendored
2
dist/flexsearch.light.module.min.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.40 (Light.module)
|
||||
* FlexSearch.js v0.7.41 (Light.module)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
|
2
dist/module-debug/worker/index.js
vendored
2
dist/module-debug/worker/index.js
vendored
@@ -129,7 +129,7 @@ function create(factory, is_node_js, worker_path) {
|
||||
|
||||
try {
|
||||
|
||||
worker = is_node_js ? eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")') : factory ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + handler.toString()], { type: "text/javascript" }))) : new Worker(is_string(worker_path) ? worker_path : "worker/worker.js", { type: "module" });
|
||||
worker = is_node_js ? eval('new (require("worker_threads")["Worker"])(__dirname + "/node/node.js")') : factory ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + handler.toString()], { type: "text/javascript" }))) : new Worker(is_string(worker_path) ? worker_path : "worker/worker.js", { type: "module" });
|
||||
} catch (e) {}
|
||||
|
||||
return worker;
|
||||
|
2
dist/module-min/worker/index.js
vendored
2
dist/module-min/worker/index.js
vendored
@@ -1 +1 @@
|
||||
import{create_object,is_function,is_object,is_string}from"../common.js";import handler from"./handler.js";let pid=0;function WorkerIndex(a){if(!(this instanceof WorkerIndex))return new WorkerIndex(a);let b;a?is_function(b=a.encode)&&(a.encode=b.toString()):a={};let c=(self||window)._factory;c&&(c=c.toString());const d="undefined"==typeof window&&self.exports,e=this;this.worker=create(c,d,a.worker),this.resolver=create_object();this.worker&&(d?this.worker.on("message",function(a){e.resolver[a.id](a.msg),delete e.resolver[a.id]}):this.worker.onmessage=function(a){a=a.data,e.resolver[a.id](a.msg),delete e.resolver[a.id]},this.worker.postMessage({task:"init",factory:c,options:a}))}export default WorkerIndex;register("add"),register("append"),register("search"),register("update"),register("remove");function register(a){WorkerIndex.prototype[a]=WorkerIndex.prototype[a+"Async"]=function(){const b=this,c=[].slice.call(arguments),d=c[c.length-1];let e;is_function(d)&&(e=d,c.splice(c.length-1,1));const f=new Promise(function(d){setTimeout(function(){b.resolver[++pid]=d,b.worker.postMessage({task:a,id:pid,args:c})})});return e?(f.then(e),this):f}}function create(factory,is_node_js,worker_path){let worker;try{worker=is_node_js?eval("new (require(\"worker_threads\")[\"Worker\"])(\"../dist/node/node.js\")"):factory?new Worker(URL.createObjectURL(new Blob(["onmessage="+handler.toString()],{type:"text/javascript"}))):new Worker(is_string(worker_path)?worker_path:"worker/worker.js",{type:"module"})}catch(a){}return worker}
|
||||
import{create_object,is_function,is_object,is_string}from"../common.js";import handler from"./handler.js";let pid=0;function WorkerIndex(a){if(!(this instanceof WorkerIndex))return new WorkerIndex(a);let b;a?is_function(b=a.encode)&&(a.encode=b.toString()):a={};let c=(self||window)._factory;c&&(c=c.toString());const d="undefined"==typeof window&&self.exports,e=this;this.worker=create(c,d,a.worker),this.resolver=create_object();this.worker&&(d?this.worker.on("message",function(a){e.resolver[a.id](a.msg),delete e.resolver[a.id]}):this.worker.onmessage=function(a){a=a.data,e.resolver[a.id](a.msg),delete e.resolver[a.id]},this.worker.postMessage({task:"init",factory:c,options:a}))}export default WorkerIndex;register("add"),register("append"),register("search"),register("update"),register("remove");function register(a){WorkerIndex.prototype[a]=WorkerIndex.prototype[a+"Async"]=function(){const b=this,c=[].slice.call(arguments),d=c[c.length-1];let e;is_function(d)&&(e=d,c.splice(c.length-1,1));const f=new Promise(function(d){setTimeout(function(){b.resolver[++pid]=d,b.worker.postMessage({task:a,id:pid,args:c})})});return e?(f.then(e),this):f}}function create(factory,is_node_js,worker_path){let worker;try{worker=is_node_js?eval("new (require(\"worker_threads\")[\"Worker\"])(__dirname + \"/node/node.js\")"):factory?new Worker(URL.createObjectURL(new Blob(["onmessage="+handler.toString()],{type:"text/javascript"}))):new Worker(is_string(worker_path)?worker_path:"worker/worker.js",{type:"module"})}catch(a){}return worker}
|
2
dist/module/worker/index.js
vendored
2
dist/module/worker/index.js
vendored
@@ -129,7 +129,7 @@ function create(factory, is_node_js, worker_path) {
|
||||
|
||||
try {
|
||||
|
||||
worker = is_node_js ? eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")') : factory ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + handler.toString()], { type: "text/javascript" }))) : new Worker(is_string(worker_path) ? worker_path : "worker/worker.js", { type: "module" });
|
||||
worker = is_node_js ? eval('new (require("worker_threads")["Worker"])(__dirname + "/node/node.js")') : factory ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + handler.toString()], { type: "text/javascript" }))) : new Worker(is_string(worker_path) ? worker_path : "worker/worker.js", { type: "module" });
|
||||
} catch (e) {}
|
||||
|
||||
return worker;
|
||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "flexsearch",
|
||||
"version": "0.7.40",
|
||||
"version": "0.7.41",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "flexsearch",
|
||||
"version": "0.7.40",
|
||||
"version": "0.7.41",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.26.0",
|
||||
|
@@ -2,7 +2,7 @@
|
||||
"public": true,
|
||||
"preferGlobal": false,
|
||||
"name": "flexsearch",
|
||||
"version": "0.7.40",
|
||||
"version": "0.7.41",
|
||||
"description": "Next-Generation full text search library with zero dependencies.",
|
||||
"homepage": "https://github.com/nextapps-de/flexsearch/",
|
||||
"author": "Thomas Wilkerling",
|
||||
|
@@ -135,7 +135,7 @@ function create(factory, is_node_js, worker_path){
|
||||
|
||||
worker = is_node_js ?
|
||||
|
||||
eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")')
|
||||
eval('new (require("worker_threads")["Worker"])(__dirname + "/node/node.js")')
|
||||
:(
|
||||
factory ?
|
||||
|
||||
|
@@ -276,9 +276,11 @@ exec(executable + parameter + " --js='tmp/**.js' --js='!tmp/**/node.js'" + flag_
|
||||
|
||||
if(release === "bundle"){
|
||||
|
||||
build = build.replace("(function(self){'use strict';", "(function _factory(self){'use strict';");
|
||||
build = build.replace("(function(self){'use strict';", "(function _f(self){'use strict';try{if(module)self=module}catch(e){}self._factory=_f;");
|
||||
}
|
||||
|
||||
build = build.replace(/eval\('(.*)'\)/, "$1");
|
||||
|
||||
if(release === "bundle.module" || release === "light.module" || release === "compact.module"){
|
||||
|
||||
build = build.replace(/self\.FlexSearch(\s+)?=(\s+)?/, "export default ");
|
||||
|
Reference in New Issue
Block a user