dexie 4.4.6 → 4.4.7

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.4.6, Thu Sep 10 2026
7
+ * Version 4.4.7, Mon Oct 19 2026
8
8
  *
9
9
  * https://dexie.org
10
10
  *
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.4.6, Thu Sep 10 2026
7
+ * Version 4.4.7, Mon Oct 19 2026
8
8
  *
9
9
  * https://dexie.org
10
10
  *
@@ -1228,7 +1228,7 @@
1228
1228
  }
1229
1229
  }
1230
1230
 
1231
- var DEXIE_VERSION = '4.4.6';
1231
+ var DEXIE_VERSION = '4.4.7';
1232
1232
  var maxString = String.fromCharCode(65535);
1233
1233
  var minKey = -Infinity;
1234
1234
  var INVALID_KEY_ARGUMENT = 'Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.';
@@ -1815,12 +1815,13 @@
1815
1815
  };
1816
1816
  Table.prototype.bulkUpdate = function (keysAndChanges) {
1817
1817
  var _this = this;
1818
- var coreTable = this.core;
1819
1818
  var keys = keysAndChanges.map(function (entry) { return entry.key; });
1820
1819
  var changeSpecs = keysAndChanges.map(function (entry) { return entry.changes; });
1821
1820
  var offsetMap = [];
1822
1821
  return this._trans('readwrite', function (trans) {
1822
+ var coreTable = _this.core;
1823
1823
  return coreTable.getMany({ trans: trans, keys: keys, cache: 'clone' }).then(function (objs) {
1824
+ var _a = coreTable.schema.primaryKey, outbound = _a.outbound, extractKey = _a.extractKey;
1824
1825
  var resultKeys = [];
1825
1826
  var resultObjs = [];
1826
1827
  keysAndChanges.forEach(function (_a, idx) {
@@ -1829,15 +1830,10 @@
1829
1830
  if (obj) {
1830
1831
  for (var _i = 0, _b = Object.keys(changes); _i < _b.length; _i++) {
1831
1832
  var keyPath = _b[_i];
1832
- var value = changes[keyPath];
1833
- if (keyPath === _this.schema.primKey.keyPath) {
1834
- if (cmp(value, key) !== 0) {
1835
- throw new exceptions.Constraint("Cannot update primary key in bulkUpdate()");
1836
- }
1837
- }
1838
- else {
1839
- setByKeyPath(obj, keyPath, value);
1840
- }
1833
+ setByKeyPath(obj, keyPath, changes[keyPath]);
1834
+ }
1835
+ if (!outbound && cmp(extractKey(obj), key) !== 0) {
1836
+ throw new exceptions.Constraint("Cannot update primary key in bulkUpdate()");
1841
1837
  }
1842
1838
  offsetMap.push(idx);
1843
1839
  resultKeys.push(key);
@@ -2572,7 +2568,11 @@
2572
2568
  return collection;
2573
2569
  }
2574
2570
  function emptyCollection(whereClause) {
2575
- return new whereClause.Collection(whereClause, function () { return rangeEqual(''); }).limit(0);
2571
+ var collection = new whereClause.Collection(whereClause, function () {
2572
+ return rangeEqual('');
2573
+ });
2574
+ collection._addAlgorithm(function () { return false; });
2575
+ return collection;
2576
2576
  }
2577
2577
  function upperFactory(dir) {
2578
2578
  return dir === 'next'
@@ -4607,11 +4607,12 @@
4607
4607
  return DexiePromise.reject(err);
4608
4608
  });
4609
4609
  };
4610
+ var useSafari14Workaround = typeof navigator !== 'undefined' &&
4611
+ !!indexedDB &&
4612
+ indexedDB === _global.indexedDB;
4610
4613
  return DexiePromise.race([
4611
4614
  openCanceller,
4612
- (typeof navigator === 'undefined'
4613
- ? DexiePromise.resolve()
4614
- : idbReady()).then(tryOpenDB),
4615
+ (useSafari14Workaround ? idbReady() : DexiePromise.resolve()).then(tryOpenDB),
4615
4616
  ])
4616
4617
  .then(function () {
4617
4618
  throwIfCancelled();
@@ -5197,7 +5198,7 @@
5197
5198
  ? [req.keys]
5198
5199
  : req.values.length < 50
5199
5200
  ? [
5200
- getEffectiveKeys(primaryKey, req).filter(function (id) { return id; }),
5201
+ getEffectiveKeys(primaryKey, req).filter(function (id) { return id != null; }),
5201
5202
  req.values,
5202
5203
  ]
5203
5204
  : [], keys = _c[0], newObjs = _c[1];
@@ -6137,7 +6138,7 @@
6137
6138
  };
6138
6139
  Dexie.prototype.hasBeenClosed = function () {
6139
6140
  var dbOpenError = this._state.dbOpenError;
6140
- return dbOpenError && dbOpenError.name === 'DatabaseClosed';
6141
+ return dbOpenError && dbOpenError.name === 'DatabaseClosedError';
6141
6142
  };
6142
6143
  Dexie.prototype.hasFailed = function () {
6143
6144
  return this._state.dbOpenError !== null;
@@ -6355,6 +6356,9 @@
6355
6356
  }
6356
6357
  }
6357
6358
  }, function (err) {
6359
+ if (closed || ctx.signal.aborted) {
6360
+ return;
6361
+ }
6358
6362
  hasValue = false;
6359
6363
  if (!['DatabaseClosedError', 'AbortError'].includes(err === null || err === void 0 ? void 0 : err.name)) {
6360
6364
  if (!closed)