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 +1 -1
- package/dist/dexie.js +24 -19
- package/dist/dexie.js.map +1 -1
- package/dist/dexie.min.js +1 -1
- package/dist/dexie.min.js.map +1 -1
- package/dist/dexie.mjs +24 -19
- package/dist/dexie.mjs.map +1 -1
- package/dist/modern/dexie.min.mjs +1 -1
- package/dist/modern/dexie.min.mjs.map +1 -1
- package/dist/modern/dexie.mjs +22 -19
- package/dist/modern/dexie.mjs.map +1 -1
- package/package.json +5 -5
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.
|
|
7
|
+
* Version 4.4.7, Mon Oct 19 2026
|
|
8
8
|
*
|
|
9
9
|
* https://dexie.org
|
|
10
10
|
*
|
|
@@ -522,8 +522,9 @@ function hookDeletingChain(f1, f2) {
|
|
|
522
522
|
function hookUpdatingChain(f1, f2) {
|
|
523
523
|
if (f1 === nop)
|
|
524
524
|
return f2;
|
|
525
|
-
return function (
|
|
525
|
+
return function () {
|
|
526
526
|
var res = f1.apply(this, arguments);
|
|
527
|
+
var modifications = arguments[0];
|
|
527
528
|
extend(modifications, res);
|
|
528
529
|
var onsuccess = this.onsuccess,
|
|
529
530
|
onerror = this.onerror;
|
|
@@ -1221,7 +1222,7 @@ function tempTransaction(db, mode, storeNames, fn) {
|
|
|
1221
1222
|
}
|
|
1222
1223
|
}
|
|
1223
1224
|
|
|
1224
|
-
var DEXIE_VERSION = '4.4.
|
|
1225
|
+
var DEXIE_VERSION = '4.4.7';
|
|
1225
1226
|
var maxString = String.fromCharCode(65535);
|
|
1226
1227
|
var minKey = -Infinity;
|
|
1227
1228
|
var INVALID_KEY_ARGUMENT = 'Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.';
|
|
@@ -1808,12 +1809,13 @@ var Table = (function () {
|
|
|
1808
1809
|
};
|
|
1809
1810
|
Table.prototype.bulkUpdate = function (keysAndChanges) {
|
|
1810
1811
|
var _this = this;
|
|
1811
|
-
var coreTable = this.core;
|
|
1812
1812
|
var keys = keysAndChanges.map(function (entry) { return entry.key; });
|
|
1813
1813
|
var changeSpecs = keysAndChanges.map(function (entry) { return entry.changes; });
|
|
1814
1814
|
var offsetMap = [];
|
|
1815
1815
|
return this._trans('readwrite', function (trans) {
|
|
1816
|
+
var coreTable = _this.core;
|
|
1816
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;
|
|
1817
1819
|
var resultKeys = [];
|
|
1818
1820
|
var resultObjs = [];
|
|
1819
1821
|
keysAndChanges.forEach(function (_a, idx) {
|
|
@@ -1822,15 +1824,10 @@ var Table = (function () {
|
|
|
1822
1824
|
if (obj) {
|
|
1823
1825
|
for (var _i = 0, _b = Object.keys(changes); _i < _b.length; _i++) {
|
|
1824
1826
|
var keyPath = _b[_i];
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
}
|
|
1830
|
-
}
|
|
1831
|
-
else {
|
|
1832
|
-
setByKeyPath(obj, keyPath, value);
|
|
1833
|
-
}
|
|
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()");
|
|
1834
1831
|
}
|
|
1835
1832
|
offsetMap.push(idx);
|
|
1836
1833
|
resultKeys.push(key);
|
|
@@ -2565,7 +2562,11 @@ function fail(collectionOrWhereClause, err, T) {
|
|
|
2565
2562
|
return collection;
|
|
2566
2563
|
}
|
|
2567
2564
|
function emptyCollection(whereClause) {
|
|
2568
|
-
|
|
2565
|
+
var collection = new whereClause.Collection(whereClause, function () {
|
|
2566
|
+
return rangeEqual('');
|
|
2567
|
+
});
|
|
2568
|
+
collection._addAlgorithm(function () { return false; });
|
|
2569
|
+
return collection;
|
|
2569
2570
|
}
|
|
2570
2571
|
function upperFactory(dir) {
|
|
2571
2572
|
return dir === 'next'
|
|
@@ -4600,11 +4601,12 @@ function dexieOpen(db) {
|
|
|
4600
4601
|
return DexiePromise.reject(err);
|
|
4601
4602
|
});
|
|
4602
4603
|
};
|
|
4604
|
+
var useSafari14Workaround = typeof navigator !== 'undefined' &&
|
|
4605
|
+
!!indexedDB &&
|
|
4606
|
+
indexedDB === _global.indexedDB;
|
|
4603
4607
|
return DexiePromise.race([
|
|
4604
4608
|
openCanceller,
|
|
4605
|
-
(
|
|
4606
|
-
? DexiePromise.resolve()
|
|
4607
|
-
: idbReady()).then(tryOpenDB),
|
|
4609
|
+
(useSafari14Workaround ? idbReady() : DexiePromise.resolve()).then(tryOpenDB),
|
|
4608
4610
|
])
|
|
4609
4611
|
.then(function () {
|
|
4610
4612
|
throwIfCancelled();
|
|
@@ -5190,7 +5192,7 @@ var observabilityMiddleware = {
|
|
|
5190
5192
|
? [req.keys]
|
|
5191
5193
|
: req.values.length < 50
|
|
5192
5194
|
? [
|
|
5193
|
-
getEffectiveKeys(primaryKey, req).filter(function (id) { return id; }),
|
|
5195
|
+
getEffectiveKeys(primaryKey, req).filter(function (id) { return id != null; }),
|
|
5194
5196
|
req.values,
|
|
5195
5197
|
]
|
|
5196
5198
|
: [], keys = _c[0], newObjs = _c[1];
|
|
@@ -6130,7 +6132,7 @@ var Dexie$1 = (function () {
|
|
|
6130
6132
|
};
|
|
6131
6133
|
Dexie.prototype.hasBeenClosed = function () {
|
|
6132
6134
|
var dbOpenError = this._state.dbOpenError;
|
|
6133
|
-
return dbOpenError && dbOpenError.name === '
|
|
6135
|
+
return dbOpenError && dbOpenError.name === 'DatabaseClosedError';
|
|
6134
6136
|
};
|
|
6135
6137
|
Dexie.prototype.hasFailed = function () {
|
|
6136
6138
|
return this._state.dbOpenError !== null;
|
|
@@ -6348,6 +6350,9 @@ function liveQuery(querier) {
|
|
|
6348
6350
|
}
|
|
6349
6351
|
}
|
|
6350
6352
|
}, function (err) {
|
|
6353
|
+
if (closed || ctx.signal.aborted) {
|
|
6354
|
+
return;
|
|
6355
|
+
}
|
|
6351
6356
|
hasValue = false;
|
|
6352
6357
|
if (!['DatabaseClosedError', 'AbortError'].includes(err === null || err === void 0 ? void 0 : err.name)) {
|
|
6353
6358
|
if (!closed)
|