dexie 4.1.0-alpha.6 → 4.1.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dexie.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * By David Fahlander, david.fahlander@gmail.com
6
6
  *
7
- * Version 4.1.0-alpha.6, Tue Oct 15 2024
7
+ * Version 4.1.0-alpha.8, Tue Oct 15 2024
8
8
  *
9
9
  * https://dexie.org
10
10
  *
@@ -1256,6 +1256,7 @@ export interface DexieOptions {
1256
1256
  chromeTransactionDurability?: ChromeTransactionDurability;
1257
1257
  cache?: "immutable" | "cloned" | "disabled";
1258
1258
  Y?: YjsLib; // Caller supplies Y from the following: import * as Y from 'yjs';
1259
+ gc?: boolean;
1259
1260
  }
1260
1261
  export interface DexieConstructor extends DexieExceptionClasses {
1261
1262
  new (databaseName: string, options?: DexieOptions): Dexie;
package/dist/dexie.js CHANGED
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * By David Fahlander, david.fahlander@gmail.com
6
6
  *
7
- * Version 4.1.0-alpha.6, Tue Oct 15 2024
7
+ * Version 4.1.0-alpha.8, Tue Oct 15 2024
8
8
  *
9
9
  * https://dexie.org
10
10
  *
@@ -1177,7 +1177,7 @@
1177
1177
  }
1178
1178
  }
1179
1179
 
1180
- var DEXIE_VERSION = '4.1.0-alpha.6';
1180
+ var DEXIE_VERSION = '4.1.0-alpha.8';
1181
1181
  var maxString = String.fromCharCode(65535);
1182
1182
  var minKey = -Infinity;
1183
1183
  var INVALID_KEY_ARGUMENT = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.";
@@ -5948,7 +5948,7 @@
5948
5948
  }
5949
5949
  });
5950
5950
  this.vip = vipDB;
5951
- if (options === null || options === void 0 ? void 0 : options.Y)
5951
+ if ((options === null || options === void 0 ? void 0 : options.Y) && (options === null || options === void 0 ? void 0 : options.gc) !== false)
5952
5952
  periodicGC(this);
5953
5953
  addons.forEach(function (addon) { return addon(_this); });
5954
5954
  }
@@ -6603,8 +6603,8 @@
6603
6603
  if (destroyedDocs.has(doc))
6604
6604
  return;
6605
6605
  var p = wm.get(doc);
6606
- if (!p) {
6607
- if (--p.refCount === 0) {
6606
+ if (p) {
6607
+ if (--p.refCount <= 0) {
6608
6608
  if (isNaN(options === null || options === void 0 ? void 0 : options.gracePeriod)) {
6609
6609
  doc.destroy();
6610
6610
  }