Skip to content

Commit 84c7a08

Browse files
committed
proper light/compact bundle
1 parent b2c79cf commit 84c7a08

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1595
-2242
lines changed

dist/flexsearch.bundle.debug.js

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**!
2-
* FlexSearch.js v0.8.108 (Bundle/Debug)
2+
* FlexSearch.js v0.8.109 (Bundle/Debug)
33
* Author and Copyright: Thomas Wilkerling
44
* Licence: Apache-2.0
55
* Hosted by Nextapps GmbH
@@ -282,8 +282,20 @@ async function ka(a) {
282282
break;
283283
default:
284284
let d;
285-
"export" === b && (e = [N.export]);
286-
"import" === b ? await N.import.call(M, M) : d = M[b].apply(M, e);
285+
if ("export" === b) {
286+
if (!N.export || "function" !== typeof N.export) {
287+
throw Error('Either no extern configuration provided for the Worker-Index or no method was defined on the config property "export".');
288+
}
289+
e = [N.export];
290+
}
291+
if ("import" === b) {
292+
if (!N.import || "function" !== typeof N.import) {
293+
throw Error('Either no extern configuration provided for the Worker-Index or no method was defined on the config property "import".');
294+
}
295+
await N.import.call(M, M);
296+
} else {
297+
d = M[b].apply(M, e);
298+
}
287299
postMessage("search" === b ? {id:c, msg:d} : {id:c});
288300
}
289301
}
@@ -1475,7 +1487,8 @@ function W(a) {
14751487
this.J = [];
14761488
this.key = (c = b.key || b.id) && Ta(c, this.J) || "id";
14771489
(e = a.keystore || 0) && (this.keystore = e);
1478-
this.reg = (this.fastupdate = !!a.fastupdate) ? e ? new T(e) : new Map() : e ? new U(e) : new Set();
1490+
this.fastupdate = !!a.fastupdate;
1491+
this.reg = !this.fastupdate || a.worker || a.db ? e ? new U(e) : new Set() : e ? new T(e) : new Map();
14791492
this.C = (c = b.store || null) && c && !0 !== c && [];
14801493
this.store = c && (e ? new T(e) : new Map());
14811494
this.cache = (c = a.cache || null) && new Y(c);
@@ -1501,6 +1514,7 @@ function W(a) {
15011514
}
15021515
}
15031516
if (this.worker) {
1517+
this.fastupdate = !1;
15041518
a = [];
15051519
for (const d of this.index.values()) {
15061520
d.then && a.push(d);
@@ -1517,11 +1531,14 @@ function W(a) {
15171531
});
15181532
}
15191533
} else {
1520-
a.db && this.mount(a.db);
1534+
a.db && (this.fastupdate = !1, this.mount(a.db));
15211535
}
15221536
}
15231537
t = V.prototype;
15241538
t.mount = function(a) {
1539+
if (this.worker) {
1540+
throw Error("You can't use Worker-Indexes on a persistent model. That would be useless, since each of the persistent model acts like Worker-Index by default (Master/Slave).");
1541+
}
15251542
let b = this.field;
15261543
if (this.tag) {
15271544
for (let d = 0, f; d < this.R.length; d++) {
@@ -2020,7 +2037,7 @@ function mb(a, b) {
20202037
const e = !0 === c ? {depth:1} : c || {}, d = E(a.encoder) ? db[a.encoder] : a.encode || a.encoder || Wa;
20212038
this.encoder = d.encode ? d : "object" === typeof d ? new J(d) : {encode:d};
20222039
this.resolution = a.resolution || 9;
2023-
this.tokenize = c = a.tokenize || "strict";
2040+
this.tokenize = (c = a.tokenize) && "default" !== c || "strict";
20242041
this.depth = "strict" === c && e.depth || 0;
20252042
this.bidirectional = !1 !== e.bidirectional;
20262043
this.fastupdate = !!a.fastupdate;

dist/flexsearch.bundle.min.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/flexsearch.bundle.module.debug.js

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**!
2-
* FlexSearch.js v0.8.108 (Bundle/Module/Debug)
2+
* FlexSearch.js v0.8.109 (Bundle/Module/Debug)
33
* Author and Copyright: Thomas Wilkerling
44
* Licence: Apache-2.0
55
* Hosted by Nextapps GmbH
@@ -281,8 +281,20 @@ async function ka(a) {
281281
break;
282282
default:
283283
let d;
284-
"export" === b && (e = [N.export]);
285-
"import" === b ? await N.import.call(M, M) : d = M[b].apply(M, e);
284+
if ("export" === b) {
285+
if (!N.export || "function" !== typeof N.export) {
286+
throw Error('Either no extern configuration provided for the Worker-Index or no method was defined on the config property "export".');
287+
}
288+
e = [N.export];
289+
}
290+
if ("import" === b) {
291+
if (!N.import || "function" !== typeof N.import) {
292+
throw Error('Either no extern configuration provided for the Worker-Index or no method was defined on the config property "import".');
293+
}
294+
await N.import.call(M, M);
295+
} else {
296+
d = M[b].apply(M, e);
297+
}
286298
postMessage("search" === b ? {id:c, msg:d} : {id:c});
287299
}
288300
}
@@ -1474,7 +1486,8 @@ function W(a) {
14741486
this.J = [];
14751487
this.key = (c = b.key || b.id) && Ta(c, this.J) || "id";
14761488
(e = a.keystore || 0) && (this.keystore = e);
1477-
this.reg = (this.fastupdate = !!a.fastupdate) ? e ? new T(e) : new Map() : e ? new U(e) : new Set();
1489+
this.fastupdate = !!a.fastupdate;
1490+
this.reg = !this.fastupdate || a.worker || a.db ? e ? new U(e) : new Set() : e ? new T(e) : new Map();
14781491
this.C = (c = b.store || null) && c && !0 !== c && [];
14791492
this.store = c && (e ? new T(e) : new Map());
14801493
this.cache = (c = a.cache || null) && new Y(c);
@@ -1500,6 +1513,7 @@ function W(a) {
15001513
}
15011514
}
15021515
if (this.worker) {
1516+
this.fastupdate = !1;
15031517
a = [];
15041518
for (const d of this.index.values()) {
15051519
d.then && a.push(d);
@@ -1516,11 +1530,14 @@ function W(a) {
15161530
});
15171531
}
15181532
} else {
1519-
a.db && this.mount(a.db);
1533+
a.db && (this.fastupdate = !1, this.mount(a.db));
15201534
}
15211535
}
15221536
t = V.prototype;
15231537
t.mount = function(a) {
1538+
if (this.worker) {
1539+
throw Error("You can't use Worker-Indexes on a persistent model. That would be useless, since each of the persistent model acts like Worker-Index by default (Master/Slave).");
1540+
}
15241541
let b = this.field;
15251542
if (this.tag) {
15261543
for (let d = 0, f; d < this.R.length; d++) {
@@ -2019,7 +2036,7 @@ function mb(a, b) {
20192036
const e = !0 === c ? {depth:1} : c || {}, d = E(a.encoder) ? db[a.encoder] : a.encode || a.encoder || Wa;
20202037
this.encoder = d.encode ? d : "object" === typeof d ? new J(d) : {encode:d};
20212038
this.resolution = a.resolution || 9;
2022-
this.tokenize = c = a.tokenize || "strict";
2039+
this.tokenize = (c = a.tokenize) && "default" !== c || "strict";
20232040
this.depth = "strict" === c && e.depth || 0;
20242041
this.bidirectional = !1 !== e.bidirectional;
20252042
this.fastupdate = !!a.fastupdate;

0 commit comments

Comments
 (0)