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