dexie 4.0.9 → 4.0.10

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.
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * By David Fahlander, david.fahlander@gmail.com
6
6
  *
7
- * Version 4.0.9, Mon Oct 21 2024
7
+ * Version 4.0.10, Fri Nov 15 2024
8
8
  *
9
9
  * https://dexie.org
10
10
  *
@@ -1096,7 +1096,7 @@ function tempTransaction(db, mode, storeNames, fn) {
1096
1096
  }
1097
1097
  }
1098
1098
 
1099
- const DEXIE_VERSION = '4.0.9';
1099
+ const DEXIE_VERSION = '4.0.10';
1100
1100
  const maxString = String.fromCharCode(65535);
1101
1101
  const minKey = -Infinity;
1102
1102
  const INVALID_KEY_ARGUMENT = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.";
@@ -2043,7 +2043,16 @@ class Collection {
2043
2043
  }
2044
2044
  const coreTable = ctx.table.core;
2045
2045
  const { outbound, extractKey } = coreTable.schema.primaryKey;
2046
- const limit = this.db._options.modifyChunkSize || 200;
2046
+ let limit = 200;
2047
+ const modifyChunkSize = this.db._options.modifyChunkSize;
2048
+ if (modifyChunkSize) {
2049
+ if (typeof modifyChunkSize == 'object') {
2050
+ limit = modifyChunkSize[coreTable.name] || modifyChunkSize['*'] || 200;
2051
+ }
2052
+ else {
2053
+ limit = modifyChunkSize;
2054
+ }
2055
+ }
2047
2056
  const totalFailures = [];
2048
2057
  let successCount = 0;
2049
2058
  const failedKeys = [];
@@ -4562,7 +4571,9 @@ const observabilityMiddleware = {
4562
4571
  indexesWithAutoIncPK.forEach(idx => {
4563
4572
  const idxVals = req.values.map(v => idx.extractKey(v));
4564
4573
  const pkPos = idx.keyPath.findIndex(prop => prop === primaryKey.keyPath);
4565
- res.results.forEach(pk => idxVals[pkPos] = pk);
4574
+ for (let i = 0, len = res.results.length; i < len; ++i) {
4575
+ idxVals[i][pkPos] = res.results[i];
4576
+ }
4566
4577
  getRangeSet(idx.name).addKeys(idxVals);
4567
4578
  });
4568
4579
  }