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.mjs 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
  *
@@ -1222,7 +1222,7 @@ function tempTransaction(db, mode, storeNames, fn) {
1222
1222
  }
1223
1223
  }
1224
1224
 
1225
- var DEXIE_VERSION = '4.4.6';
1225
+ var DEXIE_VERSION = '4.4.7';
1226
1226
  var maxString = String.fromCharCode(65535);
1227
1227
  var minKey = -Infinity;
1228
1228
  var INVALID_KEY_ARGUMENT = 'Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.';
@@ -1809,12 +1809,13 @@ var Table = (function () {
1809
1809
  };
1810
1810
  Table.prototype.bulkUpdate = function (keysAndChanges) {
1811
1811
  var _this = this;
1812
- var coreTable = this.core;
1813
1812
  var keys = keysAndChanges.map(function (entry) { return entry.key; });
1814
1813
  var changeSpecs = keysAndChanges.map(function (entry) { return entry.changes; });
1815
1814
  var offsetMap = [];
1816
1815
  return this._trans('readwrite', function (trans) {
1816
+ var coreTable = _this.core;
1817
1817
  return coreTable.getMany({ trans: trans, keys: keys, cache: 'clone' }).then(function (objs) {
1818
+ var _a = coreTable.schema.primaryKey, outbound = _a.outbound, extractKey = _a.extractKey;
1818
1819
  var resultKeys = [];
1819
1820
  var resultObjs = [];
1820
1821
  keysAndChanges.forEach(function (_a, idx) {
@@ -1823,15 +1824,10 @@ var Table = (function () {
1823
1824
  if (obj) {
1824
1825
  for (var _i = 0, _b = Object.keys(changes); _i < _b.length; _i++) {
1825
1826
  var keyPath = _b[_i];
1826
- var value = changes[keyPath];
1827
- if (keyPath === _this.schema.primKey.keyPath) {
1828
- if (cmp(value, key) !== 0) {
1829
- throw new exceptions.Constraint("Cannot update primary key in bulkUpdate()");
1830
- }
1831
- }
1832
- else {
1833
- setByKeyPath(obj, keyPath, value);
1834
- }
1827
+ setByKeyPath(obj, keyPath, changes[keyPath]);
1828
+ }
1829
+ if (!outbound && cmp(extractKey(obj), key) !== 0) {
1830
+ throw new exceptions.Constraint("Cannot update primary key in bulkUpdate()");
1835
1831
  }
1836
1832
  offsetMap.push(idx);
1837
1833
  resultKeys.push(key);
@@ -2566,7 +2562,11 @@ function fail(collectionOrWhereClause, err, T) {
2566
2562
  return collection;
2567
2563
  }
2568
2564
  function emptyCollection(whereClause) {
2569
- return new whereClause.Collection(whereClause, function () { return rangeEqual(''); }).limit(0);
2565
+ var collection = new whereClause.Collection(whereClause, function () {
2566
+ return rangeEqual('');
2567
+ });
2568
+ collection._addAlgorithm(function () { return false; });
2569
+ return collection;
2570
2570
  }
2571
2571
  function upperFactory(dir) {
2572
2572
  return dir === 'next'
@@ -4601,11 +4601,12 @@ function dexieOpen(db) {
4601
4601
  return DexiePromise.reject(err);
4602
4602
  });
4603
4603
  };
4604
+ var useSafari14Workaround = typeof navigator !== 'undefined' &&
4605
+ !!indexedDB &&
4606
+ indexedDB === _global.indexedDB;
4604
4607
  return DexiePromise.race([
4605
4608
  openCanceller,
4606
- (typeof navigator === 'undefined'
4607
- ? DexiePromise.resolve()
4608
- : idbReady()).then(tryOpenDB),
4609
+ (useSafari14Workaround ? idbReady() : DexiePromise.resolve()).then(tryOpenDB),
4609
4610
  ])
4610
4611
  .then(function () {
4611
4612
  throwIfCancelled();
@@ -5191,7 +5192,7 @@ var observabilityMiddleware = {
5191
5192
  ? [req.keys]
5192
5193
  : req.values.length < 50
5193
5194
  ? [
5194
- getEffectiveKeys(primaryKey, req).filter(function (id) { return id; }),
5195
+ getEffectiveKeys(primaryKey, req).filter(function (id) { return id != null; }),
5195
5196
  req.values,
5196
5197
  ]
5197
5198
  : [], keys = _c[0], newObjs = _c[1];
@@ -6131,7 +6132,7 @@ var Dexie$1 = (function () {
6131
6132
  };
6132
6133
  Dexie.prototype.hasBeenClosed = function () {
6133
6134
  var dbOpenError = this._state.dbOpenError;
6134
- return dbOpenError && dbOpenError.name === 'DatabaseClosed';
6135
+ return dbOpenError && dbOpenError.name === 'DatabaseClosedError';
6135
6136
  };
6136
6137
  Dexie.prototype.hasFailed = function () {
6137
6138
  return this._state.dbOpenError !== null;
@@ -6349,6 +6350,9 @@ function liveQuery(querier) {
6349
6350
  }
6350
6351
  }
6351
6352
  }, function (err) {
6353
+ if (closed || ctx.signal.aborted) {
6354
+ return;
6355
+ }
6352
6356
  hasValue = false;
6353
6357
  if (!['DatabaseClosedError', 'AbortError'].includes(err === null || err === void 0 ? void 0 : err.name)) {
6354
6358
  if (!closed)