h;c--)l=n.substring(h,c),m(q,f,l,a,b,k,d)}break;default:if(g=m(q,f,n,a,1,k,d),t&&1=d)for(g=f._ctx[n]||(f._ctx[n]=r()),n=this.c[n]||(this.c[n]=C(10-(d||
-0))),k=e-t,l=e+t+1,0>k&&(k=0),l>p&&(l=p);kb&&(g=g.slice(0,b)));e=g}return e};e.prototype.clear=function(){return this.destroy().init()};
-e.prototype.destroy=function(){this.g=this.c=this.a=null;return this};const w={icase:function(a){return a.toLowerCase()}};return e}(!1),this);
diff --git a/flexsearch.min.js b/flexsearch.min.js
deleted file mode 100644
index f74dc17..0000000
--- a/flexsearch.min.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- FlexSearch v0.3.5
- Copyright 2019 Nextapps GmbH
- Author: Thomas Wilkerling
- Released under the Apache 2.0 Licence
- https://github.com/nextapps-de/flexsearch
-*/
-'use strict';(function(u,B,g){let v;(v=g.define)&&v.amd?v([],function(){return B}):(v=g.modules)?v[u.toLowerCase()]=B:"object"===typeof exports?module.exports=B:g[u]=B})("FlexSearch",function O(u){function g(a){E(a)&&(a=J[a]);a||(a=w);this.id=a.id||P++;this.init(a);v(this,"index",function(){return this.a});v(this,"length",function(){return Object.keys(this.a).length})}function v(a,b,c){Object.defineProperty(a,b,{get:c})}function e(a){return new RegExp(a,"g")}function x(a,b){for(let c=0;c=h&&(a=a[9-(f+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=d);return f}function H(a,b){if(a){const c=Object.keys(a);for(let d=0,f=c.length;da?1:a?-1:0}function T(a,b){a=a.length-b.length;return 0>a?-1:a?1:0}function U(a,b,c){let d=[],f;const l=a.length;if(1b&&(d=d.slice(0,b)));return d}function E(a){return"string"===typeof a}function F(a){return"function"===typeof a}function A(a){return"undefined"===typeof a}function K(a){const b=Array(a);for(let c=0;c=f&&(c.o=c.c),c.B&&c.o===c.c&&(c.cache&&c.j.set(b,c.h),c.B(c.h),c.h=[]),c})}else a.worker=!1,this.i=null;this.b=a.tokenize||c.b||this.b||w.b;this.async="undefined"===typeof Promise||A(b=a.async)?this.async||
-w.async:b;this.c=A(b=a.worker)?this.c||w.c:b;this.threshold=A(b=a.threshold)?c.threshold||this.threshold||w.threshold:b;this.depth=A(b=a.depth)?c.depth||this.depth||w.depth:b;this.u=A(b=a.suggest)?this.u||w.u:b;this.s=(b=A(b=a.encode)?c.encode:b)&&D[b]&&D[b].bind(D)||(F(b)?b:this.s||!1);(b=a.matcher)&&this.addMatcher(b);if(b=a.filter)this.filter=Q(M[b]||b,this.s);if(b=a.stemmer)this.stemmer=R(N[b]||b,this.s);this.f=K(10-(this.threshold||0));this.g=r();this.a=r();this.v=!0;this.j=(this.cache=b=A(b=
-a.cache)?this.cache||w.cache:b)?new W(b):!1;return this};g.prototype.encode=function(a){a&&G.length&&(a=x(a,G));a&&this.m.length&&(a=x(a,this.m));a&&this.s&&(a=this.s(a));a&&this.stemmer&&(a=x(a,this.stemmer));return a};g.prototype.addMatcher=function(a){const b=this.m;for(const c in a)a.hasOwnProperty(c)&&b.push(e(c),a[c]);return this};g.prototype.add=function(a,b,c,d,f){if(b&&E(b)&&(a||0===a)){var e="@"+a;if(this.a[e]&&!d)return this.update(a,b);if(this.c)return++this.w>=this.i.length&&(this.w=
-0),this.i[this.w].postMessage({add:!0,id:a,content:b}),this.a[e]=""+this.w,c&&c(),this;if(!f){if(this.async&&"function"!==typeof importScripts){let f=this;e=new Promise(function(c){setTimeout(function(){f.add(a,b,null,d,!0);f=null;c()})});if(c)e.then(c);else return e;return this}if(c)return this.add(a,b,null,d,!0),c(),this}b=this.encode(b);if(!b.length)return this;c=this.b;f=F(c)?c(b):b.split(L);const l=r();l._ctx=r();const p=this.threshold,t=this.depth,z=this.f,C=f.length;for(let b=0;bk;c--)n=h.substring(k,c),y(z,l,n,a,b,m,p)}break;default:if(g=y(z,l,h,a,1,m,p),t&&1=p)for(g=l._ctx[h]||(l._ctx[h]=r()),h=this.g[h]||(this.g[h]=K(10-(p||0))),m=b-t,n=b+t+1,0>m&&(m=0),n>C&&(n=C);mc;d--)f=e[d-1],e[d]=f,b[f]=d;e[c]=a;b[a]=c}}}return b};return a}();return g}(function(){const u={},B="undefined"!==typeof Blob&&"undefined"!==typeof URL&&URL.createObjectURL;return function(g,v,e,x,y){e=B?URL.createObjectURL(new Blob(["("+e.toString()+")()"],{type:"text/javascript"})):g+".min.js";g+="-"+v;u[g]||(u[g]=[]);u[g][y]=new Worker(e);u[g][y].onmessage=x;return u[g][y]}}()),
-this);
diff --git a/package.json b/package.json
index 11f8519..7d80816 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "flexsearch",
- "version": "0.3.5",
+ "version": "0.3.51",
"description": "Next-Generation full text search library with zero dependencies.",
"homepage": "https://github.com/nextapps-de/flexsearch/",
"author": "Thomas Wilkerling",
@@ -17,7 +17,8 @@
"url": "https://github.com/nextapps-de/flexsearch/issues",
"email": "info@nextapps.de"
},
- "main": "flexsearch.min.js",
+ "main": "dist/flexsearch.node.js",
+ "browser": "dist/flexsearch.min.js",
"preferGlobal": false,
"bin": {},
"repository": {
@@ -30,8 +31,9 @@
"build-compact": "node compile RELEASE=compact DEBUG=false PROFILER=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CACHE=false SUPPORT_ASYNC=true SUPPORT_PRESETS=true SUPPORT_SUGGESTIONS=false SUPPORT_SERIALIZE=false SUPPORT_INFO=false SUPPORT_LANG_DE=false SUPPORT_LANG_EN=false",
"build-custom": "node compile RELEASE=custom DEBUG=false PROFILER=false SUPPORT_WORKER=false SUPPORT_ENCODER=false SUPPORT_CACHE=false SUPPORT_ASYNC=false SUPPORT_PRESETS=false SUPPORT_SUGGESTIONS=false SUPPORT_SERIALIZE=false SUPPORT_INFO=false SUPPORT_LANG_DE=false SUPPORT_LANG_EN=false",
"build-es5": "node compile RELEASE=es5 DEBUG=true PROFILER=false SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_PRESETS=true SUPPORT_SUGGESTIONS=true SUPPORT_SERIALIZE=true SUPPORT_INFO=true SUPPORT_LANG_DE=false SUPPORT_LANG_EN=false LANGUAGE_OUT=ECMASCRIPT5_STRICT",
+ "build-node": "node compile RELEASE=node DEBUG=false PROFILER=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_PRESETS=true SUPPORT_SUGGESTIONS=true SUPPORT_SERIALIZE=true SUPPORT_INFO=true SUPPORT_LANG_DE=false SUPPORT_LANG_EN=false",
"build-lang": "node compile RELEASE=lang",
- "build-all": "npm run build && npm run build-light && npm run build-compact && npm run build-es5 && npm run build-lang",
+ "build-all": "npm run build && npm run build-light && npm run build-compact && npm run build-es5 && npm run build-node && 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",
@@ -42,6 +44,7 @@
},
"files": [
"flexsearch.js",
+ "dist/",
"lang/",
"test/",
"compile.js",
diff --git a/test/benchmark-presets.html b/test/benchmark-presets.html
index e26d0c3..581d7de 100644
--- a/test/benchmark-presets.html
+++ b/test/benchmark-presets.html
@@ -22,7 +22,7 @@
-
+
+
diff --git a/test/flexsearch.es5.js b/test/flexsearch.es5.js
deleted file mode 100644
index 26a26c4..0000000
--- a/test/flexsearch.es5.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- FlexSearch v0.3.5
- Copyright 2019 Nextapps GmbH
- Author: Thomas Wilkerling
- Released under the Apache 2.0 Licence
- https://github.com/nextapps-de/flexsearch
-*/
-'use strict';function I(g){var k=0;return function(){return k=e&&(b=b[9-(d+.5>>0)],b=b[a]||(b[a]=[]),b[b.length]=f);return d}function G(b,c){if(b)for(var a=Object.keys(b),f=0,d=a.length;fb?1:b?-1:0}function U(b,c){b=b.length-c.length;return 0>b?-1:b?1:0}function V(b,c,a){var f=[],d=b.length;if(1c&&(f=f.slice(0,c)));return f}function E(b){return"string"===typeof b}function C(b){return"function"===typeof b}function w(b){return"undefined"===typeof b}function M(b){for(var c=Array(b),a=0;a=d&&(f.m=f.i),f.w&&f.m===f.i&&(f.cache&&f.j.set(c,f.f),f.w(f.f),f.f=[]),f})}else b.worker=!1,this.g=null;this.h=b.tokenize||a.h||this.h||x.h;this.async="undefined"===typeof Promise||w(c=b.async)?this.async||x.async:c;
-this.i=w(c=b.worker)?this.i||x.i:c;this.threshold=w(c=b.threshold)?a.threshold||this.threshold||x.threshold:c;this.depth=w(c=b.depth)?a.depth||this.depth||x.depth:c;this.A=w(c=b.suggest)?this.A||x.A:c;this.o=(c=w(c=b.encode)?a.encode:c)&&B[c]&&B[c].bind(B)||(C(c)?c:this.o||!1);(c=b.matcher)&&this.addMatcher(c);if(c=b.filter)this.filter=D(O[c]||c,this.o);if(c=b.stemmer)this.stemmer=T(P[c]||c,this.o);this.b=M(10-(this.threshold||0));this.c=y();this.a=y();this.u=!0;this.j=(this.cache=c=w(c=b.cache)?
-this.cache||x.cache:c)?new aa(c):!1;return this};e.prototype.encode=function(b){b&&F.length&&(b=l(b,F));b&&this.l.length&&(b=l(b,this.l));b&&this.o&&(b=this.o(b));b&&this.stemmer&&(b=l(b,this.stemmer));return b};e.prototype.addMatcher=function(b){var c=this.l,d;for(d in b)b.hasOwnProperty(d)&&c.push(a(d),b[d]);return this};e.prototype.add=function(b,c,a,f,e){if(c&&E(c)&&(b||0===b)){var g="@"+b;if(this.a[g]&&!f)return this.update(b,c);if(this.i)return++this.v>=this.g.length&&(this.v=0),this.g[this.v].postMessage({add:!0,
-id:b,content:c}),this.a[g]=""+this.v,a&&a(),this;if(!e){if(this.async&&"function"!==typeof importScripts){var z=this;g=new Promise(function(a){setTimeout(function(){z.add(b,c,null,f,!0);z=null;a()})});if(a)g.then(a);else return g;return this}if(a)return this.add(b,c,null,f,!0),a(),this}c=this.encode(c);if(!c.length)return this;a=this.h;e=C(a)?a(c):c.split(N);var h=y();h._ctx=y();for(var l=this.threshold,H=this.depth,q=this.b,t=e.length,r=0;rv;w--)p=u.substring(v,w),d(q,h,p,b,x,m,l);break;default:if(n=d(q,h,u,b,1,m,l),H&&1=l)for(n=h._ctx[u]||(h._ctx[u]=y()),u=this.c[u]||(this.c[u]=M(10-(l||0))),m=r-H,p=r+H+1,0>m&&(m=0),p>t&&(p=t);me;c--)h=g[c-1],g[c]=h,d[h]=
-c;g[e]=a;d[a]=e}}}return b};return a}();return e}(function(){var g={},k="undefined"!==typeof Blob&&"undefined"!==typeof URL&&URL.createObjectURL;return function(e,h,a,l,d){a=k?URL.createObjectURL(new Blob(["("+a.toString()+")()"],{type:"text/javascript"})):e+".es5.js";e+="-"+h;g[e]||(g[e]=[]);g[e][d]=new Worker(a);g[e][d].onmessage=l;console.log("Register Worker: "+e+"@"+d);return g[e][d]}}()),this);
diff --git a/test/index.html b/test/index.html
index 4b5288b..9c6b997 100644
--- a/test/index.html
+++ b/test/index.html
@@ -12,7 +12,7 @@
-
+
+
diff --git a/test/matching.html b/test/matching.html
index d50dccd..17b13b2 100644
--- a/test/matching.html
+++ b/test/matching.html
@@ -201,7 +201,7 @@
Most relevant results was successfully found in the first place.
Note: Open console and type e.g. data[493]
-
+
diff --git a/test/test.js b/test/test.js
index 6e6f2fa..a7d3af4 100644
--- a/test/test.js
+++ b/test/test.js
@@ -8,7 +8,7 @@ if(typeof module !== "undefined"){
var env = process.argv[3] === "test" ? "min" : process.argv[3] === "test/" ? "light" : "";
var expect = require("chai").expect;
- var FlexSearch = require("../flexsearch" + (env ? "." + env : "") + ".js");
+ var FlexSearch = require("../" + (env ? "dist/": "") + "flexsearch" + (env ? "." + env : "") + ".js");
}
var flexsearch_default;