Skip to content

Commit bed0044

Browse files
committed
this.db.transaction is not a function #515
1 parent a10a29a commit bed0044

23 files changed

+32
-32
lines changed

dist/db/indexeddb/index.cjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ IdxDB.prototype.transaction = function(ref, modifier, task){
316316
*/
317317
let store = this.trx[key + ":" + modifier];
318318
if(store) return task.call(this, store);
319+
319320
let transaction = this.db.transaction(key, modifier);
320321
/**
321322
* @type {IDBObjectStore}
@@ -325,7 +326,7 @@ IdxDB.prototype.transaction = function(ref, modifier, task){
325326
this.trx[key + ":" + modifier] = null;
326327

327328
return promisfy(transaction).finally(function(){
328-
transaction = store = null;
329+
329330
return promise;
330331
});
331332

dist/flexsearch.bundle.debug.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**!
2-
* FlexSearch.js v0.8.208 (Bundle/Debug)
2+
* FlexSearch.js v0.8.209 (Bundle/Debug)
33
* Author and Copyright: Thomas Wilkerling
44
* Licence: Apache-2.0
55
* Hosted by Nextapps GmbH
@@ -2766,7 +2766,6 @@ w.transaction = function(a, c, b) {
27662766
const f = b.call(this, e);
27672767
this.h[a + ":" + c] = null;
27682768
return Z(d).finally(function() {
2769-
d = e = null;
27702769
return f;
27712770
});
27722771
};

dist/flexsearch.bundle.min.js

Lines changed: 2 additions & 2 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: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**!
2-
* FlexSearch.js v0.8.208 (Bundle/Module/Debug)
2+
* FlexSearch.js v0.8.209 (Bundle/Module/Debug)
33
* Author and Copyright: Thomas Wilkerling
44
* Licence: Apache-2.0
55
* Hosted by Nextapps GmbH
@@ -2765,7 +2765,6 @@ w.transaction = function(a, c, b) {
27652765
const f = b.call(this, e);
27662766
this.h[a + ":" + c] = null;
27672767
return Z(d).finally(function() {
2768-
d = e = null;
27692768
return f;
27702769
});
27712770
};

dist/flexsearch.bundle.module.debug.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**!
2-
* FlexSearch.js v0.8.208 (Bundle/Module/Debug)
2+
* FlexSearch.js v0.8.209 (Bundle/Module/Debug)
33
* Author and Copyright: Thomas Wilkerling
44
* Licence: Apache-2.0
55
* Hosted by Nextapps GmbH
@@ -2765,7 +2765,6 @@ w.transaction = function(a, c, b) {
27652765
const f = b.call(this, e);
27662766
this.h[a + ":" + c] = null;
27672767
return Z(d).finally(function() {
2768-
d = e = null;
27692768
return f;
27702769
});
27712770
};

dist/flexsearch.bundle.module.min.js

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

dist/flexsearch.bundle.module.min.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**!
2-
* FlexSearch.js v0.8.208 (Bundle/Module)
2+
* FlexSearch.js v0.8.209 (Bundle/Module)
33
* Author and Copyright: Thomas Wilkerling
44
* Licence: Apache-2.0
55
* Hosted by Nextapps GmbH
@@ -98,7 +98,7 @@ w.close=function(){this.db&&this.db.close();this.db=null};w.destroy=function(){c
9898
w.get=function(a,c,b=0,e=0,d=!0,f=!1){a=this.db.transaction((c?"ctx":"map")+(this.field?":"+this.field:""),"readonly").objectStore((c?"ctx":"map")+(this.field?":"+this.field:"")).get(c?c+":"+a:a);const g=this;return Z(a).then(function(h){let k=[];if(!h||!h.length)return k;if(d){if(!b&&!e&&h.length===1)return h[0];for(let l=0,m;l<h.length;l++)if((m=h[l])&&m.length){if(e>=m.length){e-=m.length;continue}const p=b?e+Math.min(m.length-e,b):m.length;for(let u=e;u<p;u++)k.push(m[u]);e=0;if(k.length===b)break}return f?
9999
g.enrich(k):k}return h})};w.tag=function(a,c=0,b=0,e=!1){a=this.db.transaction("tag"+(this.field?":"+this.field:""),"readonly").objectStore("tag"+(this.field?":"+this.field:"")).get(a);const d=this;return Z(a).then(function(f){if(!f||!f.length||b>=f.length)return[];if(!c&&!b)return f;f=f.slice(b,b+c);return e?d.enrich(f):f})};
100100
w.enrich=function(a){typeof a!=="object"&&(a=[a]);const c=this.db.transaction("reg","readonly").objectStore("reg"),b=[];for(let e=0;e<a.length;e++)b[e]=Z(c.get(a[e]));return Promise.all(b).then(function(e){for(let d=0;d<e.length;d++)e[d]={id:a[d],doc:e[d]?JSON.parse(e[d]):null};return e})};w.has=function(a){a=this.db.transaction("reg","readonly").objectStore("reg").getKey(a);return Z(a).then(function(c){return!!c})};w.search=null;w.info=function(){};
101-
w.transaction=function(a,c,b){a+=a!=="reg"?this.field?":"+this.field:"":"";let e=this.h[a+":"+c];if(e)return b.call(this,e);let d=this.db.transaction(a,c);this.h[a+":"+c]=e=d.objectStore(a);const f=b.call(this,e);this.h[a+":"+c]=null;return Z(d).finally(function(){d=e=null;return f})};
101+
w.transaction=function(a,c,b){a+=a!=="reg"?this.field?":"+this.field:"":"";let e=this.h[a+":"+c];if(e)return b.call(this,e);let d=this.db.transaction(a,c);this.h[a+":"+c]=e=d.objectStore(a);const f=b.call(this,e);this.h[a+":"+c]=null;return Z(d).finally(function(){return f})};
102102
w.commit=async function(a){let c=a.commit_task,b=[];a.commit_task=[];for(let e=0,d;e<c.length;e++)d=c[e],d.del&&b.push(d.del);b.length&&await this.remove(b);a.reg.size&&(await this.transaction("map","readwrite",function(e){for(const d of a.map){const f=d[0],g=d[1];g.length&&(e.get(f).onsuccess=function(){let h=this.result;var k;if(h&&h.length){const l=Math.max(h.length,g.length);for(let m=0,p,u;m<l;m++)if((u=g[m])&&u.length){if((p=h[m])&&p.length)for(k=0;k<u.length;k++)p.push(u[k]);else h[m]=u;k=
103103
1}}else h=g,k=1;k&&e.put(h,f)})}}),await this.transaction("ctx","readwrite",function(e){for(const d of a.ctx){const f=d[0],g=d[1];for(const h of g){const k=h[0],l=h[1];l.length&&(e.get(f+":"+k).onsuccess=function(){let m=this.result;var p;if(m&&m.length){const u=Math.max(m.length,l.length);for(let r=0,t,n;r<u;r++)if((n=l[r])&&n.length){if((t=m[r])&&t.length)for(p=0;p<n.length;p++)t.push(n[p]);else m[r]=n;p=1}}else m=l,p=1;p&&e.put(m,f+":"+k)})}}}),a.store?await this.transaction("reg","readwrite",
104104
function(e){for(const d of a.store){const f=d[0],g=d[1];e.put(typeof g==="object"?JSON.stringify(g):1,f)}}):a.bypass||await this.transaction("reg","readwrite",function(e){for(const d of a.reg.keys())e.put(1,d)}),a.tag&&await this.transaction("tag","readwrite",function(e){for(const d of a.tag){const f=d[0],g=d[1];g.length&&(e.get(f).onsuccess=function(){let h=this.result;h=h&&h.length?h.concat(g):g;e.put(h,f)})}}),a.map.clear(),a.ctx.clear(),a.tag&&a.tag.clear(),a.store&&a.store.clear(),a.document||

dist/flexsearch.compact.debug.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**!
2-
* FlexSearch.js v0.8.208 (Bundle/Debug)
2+
* FlexSearch.js v0.8.209 (Bundle/Debug)
33
* Author and Copyright: Thomas Wilkerling
44
* Licence: Apache-2.0
55
* Hosted by Nextapps GmbH

dist/flexsearch.compact.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/flexsearch.compact.module.debug.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**!
2-
* FlexSearch.js v0.8.208 (Bundle/Debug)
2+
* FlexSearch.js v0.8.209 (Bundle/Debug)
33
* Author and Copyright: Thomas Wilkerling
44
* Licence: Apache-2.0
55
* Hosted by Nextapps GmbH

0 commit comments

Comments
 (0)