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.
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.0.9, Mon Oct 21 2024
7
+ * Version 4.0.10, Fri Nov 15 2024
8
8
  *
9
9
  * https://dexie.org
10
10
  *
@@ -1080,7 +1080,9 @@ export interface DexieOptions {
1080
1080
  upperBound: Function;
1081
1081
  };
1082
1082
  allowEmptyDB?: boolean;
1083
- modifyChunkSize?: number;
1083
+ modifyChunkSize?: number | {
1084
+ [key: string]: number;
1085
+ };
1084
1086
  chromeTransactionDurability?: ChromeTransactionDurability;
1085
1087
  cache?: "immutable" | "cloned" | "disabled";
1086
1088
  }
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.0.9, Mon Oct 21 2024
7
+ * Version 4.0.10, Fri Nov 15 2024
8
8
  *
9
9
  * https://dexie.org
10
10
  *
@@ -1152,7 +1152,7 @@
1152
1152
  }
1153
1153
  }
1154
1154
 
1155
- var DEXIE_VERSION = '4.0.9';
1155
+ var DEXIE_VERSION = '4.0.10';
1156
1156
  var maxString = String.fromCharCode(65535);
1157
1157
  var minKey = -Infinity;
1158
1158
  var INVALID_KEY_ARGUMENT = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.";
@@ -2142,7 +2142,16 @@
2142
2142
  }
2143
2143
  var coreTable = ctx.table.core;
2144
2144
  var _a = coreTable.schema.primaryKey, outbound = _a.outbound, extractKey = _a.extractKey;
2145
- var limit = _this.db._options.modifyChunkSize || 200;
2145
+ var limit = 200;
2146
+ var modifyChunkSize = _this.db._options.modifyChunkSize;
2147
+ if (modifyChunkSize) {
2148
+ if (typeof modifyChunkSize == 'object') {
2149
+ limit = modifyChunkSize[coreTable.name] || modifyChunkSize['*'] || 200;
2150
+ }
2151
+ else {
2152
+ limit = modifyChunkSize;
2153
+ }
2154
+ }
2146
2155
  var totalFailures = [];
2147
2156
  var successCount = 0;
2148
2157
  var failedKeys = [];
@@ -4679,7 +4688,9 @@
4679
4688
  indexesWithAutoIncPK.forEach(function (idx) {
4680
4689
  var idxVals = req.values.map(function (v) { return idx.extractKey(v); });
4681
4690
  var pkPos = idx.keyPath.findIndex(function (prop) { return prop === primaryKey.keyPath; });
4682
- res.results.forEach(function (pk) { return idxVals[pkPos] = pk; });
4691
+ for (var i = 0, len = res.results.length; i < len; ++i) {
4692
+ idxVals[i][pkPos] = res.results[i];
4693
+ }
4683
4694
  getRangeSet(idx.name).addKeys(idxVals);
4684
4695
  });
4685
4696
  }