indexeddbshim 15.0.0 → 15.0.2

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.
Files changed (38) hide show
  1. package/README.md +1 -1
  2. package/badges/licenses-badge-dev.svg +1 -1
  3. package/dist/indexeddbshim-Key.js +24 -16
  4. package/dist/indexeddbshim-Key.js.map +1 -1
  5. package/dist/indexeddbshim-Key.min.js +1 -1
  6. package/dist/indexeddbshim-Key.min.js.map +1 -1
  7. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +142 -114
  8. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
  9. package/dist/indexeddbshim-UnicodeIdentifiers.js +165 -129
  10. package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
  11. package/dist/indexeddbshim-UnicodeIdentifiers.min.js +2 -2
  12. package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
  13. package/dist/indexeddbshim-node.cjs +140 -112
  14. package/dist/indexeddbshim-node.cjs.map +1 -1
  15. package/dist/indexeddbshim-noninvasive.js +159 -123
  16. package/dist/indexeddbshim-noninvasive.js.map +1 -1
  17. package/dist/indexeddbshim-noninvasive.min.js +2 -2
  18. package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
  19. package/dist/indexeddbshim.js +145 -117
  20. package/dist/indexeddbshim.js.map +1 -1
  21. package/dist/indexeddbshim.min.js +2 -2
  22. package/dist/indexeddbshim.min.js.map +1 -1
  23. package/package.json +85 -102
  24. package/src/DOMException.js +5 -4
  25. package/src/DOMStringList.js +4 -3
  26. package/src/IDBCursor.js +4 -4
  27. package/src/IDBDatabase.js +7 -2
  28. package/src/IDBFactory.js +25 -16
  29. package/src/IDBIndex.js +7 -6
  30. package/src/IDBKeyRange.js +3 -3
  31. package/src/IDBObjectStore.js +10 -9
  32. package/src/IDBTransaction.js +5 -5
  33. package/src/IDBVersionChangeEvent.js +1 -1
  34. package/src/Key.js +9 -2
  35. package/src/Sca.js +0 -1
  36. package/src/UnicodeIdentifiers.js +2 -2
  37. package/src/setGlobalVars.js +5 -2
  38. package/src/util.js +2 -2
@@ -1,4 +1,4 @@
1
- /*! indexeddbshim - v14.0.0 - 7/16/2024 */
1
+ /*! indexeddbshim - v15.0.1 - 9/5/2024 */
2
2
 
3
3
  (function (factory) {
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -65,7 +65,7 @@
65
65
  function _createForOfIteratorHelper(r, e) {
66
66
  var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
67
67
  if (!t) {
68
- if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e ) {
68
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e) {
69
69
  t && (r = t);
70
70
  var n = 0,
71
71
  F = function () {};
@@ -1046,7 +1046,7 @@
1046
1046
  * "addDefaultEventListener"|"removeDefaultEventListener"|"hasDefaultEventListener"
1047
1047
  * } ListenerName
1048
1048
  */
1049
- Object.assign(EventTarget.prototype, ['Early', '', 'Late', 'Default'].reduce(function ( /** @type {{[key: string]: Function}} */
1049
+ Object.assign(EventTarget.prototype, ['Early', '', 'Late', 'Default'].reduce(function (/** @type {{[key: string]: Function}} */
1050
1050
  obj, listenerType) {
1051
1051
  ['add', 'remove', 'has'].forEach(function (method) {
1052
1052
  var mainMethod = /** @type {ListenerName} */method + listenerType + 'EventListener';
@@ -1637,7 +1637,7 @@
1637
1637
  * @returns {void}
1638
1638
  */
1639
1639
  function (val) {
1640
- if (!/^(?::memory:|file::memory:(\?(?:[\0-"\$-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?(#(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?)?$/.test( /** @type {string} */val)) {
1640
+ if (!/^(?::memory:|file::memory:(\?(?:[\0-"\$-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?(#(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?)?$/.test(/** @type {string} */val)) {
1641
1641
  throw new TypeError('`memoryDatabase` must be the empty string, ":memory:", or a ' + '"file::memory:[?queryString][#hash] URL".');
1642
1642
  }
1643
1643
  }],
@@ -1782,7 +1782,7 @@
1782
1782
  }
1783
1783
  if (CFG.databaseCharacterEscapeList !== false) {
1784
1784
  db = db.replace(CFG.databaseCharacterEscapeList ? new RegExp(CFG.databaseCharacterEscapeList, 'gu') : /[\0-\x1F"\*\/:<>\?\\\|\x7F]/g,
1785
- // eslint-disable-line no-control-regex
1785
+ // eslint-disable-line no-control-regex -- Controls needed
1786
1786
  function (n0) {
1787
1787
  // eslint-disable-next-line unicorn/prefer-code-point -- Switch to `codePointAt`?
1788
1788
  return '^1' + n0.charCodeAt(0).toString(16).padStart(2, '0');
@@ -2104,7 +2104,7 @@
2104
2104
  function ToString(o) {
2105
2105
  // Todo: See `es-abstract/es7`
2106
2106
  // `String()` will not throw with Symbols
2107
- return '' + o; // eslint-disable-line no-implicit-coercion
2107
+ return '' + o; // eslint-disable-line no-implicit-coercion -- Need to throw with symbols
2108
2108
  }
2109
2109
 
2110
2110
  /**
@@ -2183,7 +2183,7 @@
2183
2183
  this.toString = function () {
2184
2184
  return '[object IDBVersionChangeEvent]';
2185
2185
  };
2186
- // eslint-disable-next-line prefer-rest-params
2186
+ // eslint-disable-next-line prefer-rest-params -- API
2187
2187
  this.__eventInitDict = arguments[1] || {};
2188
2188
  }
2189
2189
 
@@ -2345,10 +2345,10 @@
2345
2345
  function DOMException(message, name) {
2346
2346
  // const err = Error.prototype.constructor.call(this, message); // Any use to this? Won't set this.message
2347
2347
  this[Symbol.toStringTag] = 'DOMException';
2348
- this._code = name in codes ? codes[( /** @type {Code} */name)] : legacyCodes[( /** @type {LegacyCode} */name)] || 0;
2348
+ this._code = name in codes ? codes[(/** @type {Code} */name)] : legacyCodes[(/** @type {LegacyCode} */name)] || 0;
2349
2349
  this._name = name || 'Error';
2350
2350
  // We avoid `String()` in this next line as it converts Symbols
2351
- this._message = message === undefined ? '' : '' + message; // eslint-disable-line no-implicit-coercion
2351
+ this._message = message === undefined ? '' : '' + message; // eslint-disable-line no-implicit-coercion -- Don't convert symbols
2352
2352
  Object.defineProperty(this, 'code', {
2353
2353
  configurable: true,
2354
2354
  enumerable: true,
@@ -2376,12 +2376,12 @@
2376
2376
  // Necessary for W3C tests which complains if `DOMException` has properties on its "own" prototype
2377
2377
 
2378
2378
  // class DummyDOMException extends Error {}; // Sometimes causing problems in Node
2379
- /* eslint-disable func-name-matching */
2379
+ /* eslint-disable func-name-matching -- See above */
2380
2380
  /**
2381
2381
  * @class
2382
2382
  */
2383
2383
  var DummyDOMException = function DOMException() {/* */};
2384
- /* eslint-enable func-name-matching */
2384
+ /* eslint-enable func-name-matching -- See above */
2385
2385
  DummyDOMException.prototype = Object.create(Error.prototype); // Intended for subclassing
2386
2386
  /** @type {const} */
2387
2387
  ['name', 'message'].forEach(function (prop) {
@@ -2482,7 +2482,7 @@
2482
2482
  */
2483
2483
  function logError(name, message, error) {
2484
2484
  if (CFG.DEBUG) {
2485
- var msg = error && _typeof$2(error) === 'object' && error.message ? error.message : ( /** @type {string} */error);
2485
+ var msg = error && _typeof$2(error) === 'object' && error.message ? error.message : (/** @type {string} */error);
2486
2486
  var method = typeof console.error === 'function' ? 'error' : 'log';
2487
2487
  console[method](name + ': ' + message + '. ' + (msg || ''));
2488
2488
  if (console.trace) {
@@ -2593,7 +2593,8 @@
2593
2593
  // Native DOMException works as expected
2594
2594
  useNativeDOMException = true;
2595
2595
  }
2596
- } catch (e) {}
2596
+ // eslint-disable-next-line no-unused-vars -- Problem with commonJS rollup
2597
+ } catch (err) {}
2597
2598
  var createDOMException = useNativeDOMException
2598
2599
  // eslint-disable-next-line @stylistic/operator-linebreak -- Need JSDoc
2599
2600
  ?
@@ -2902,7 +2903,7 @@
2902
2903
  // assume that we will resolve/reject (truly) synchronously
2903
2904
  // and thus we avoid flagging checks about whether we've
2904
2905
  // already resolved/rejected.
2905
- if ( /** @type {Callbacks} */that.c[state].length) {
2906
+ if (/** @type {Callbacks} */that.c[state].length) {
2906
2907
  that.c = null;
2907
2908
  }
2908
2909
  }
@@ -2940,7 +2941,7 @@
2940
2941
  SyncPromise.prototype.then = function (cb, errBack) {
2941
2942
  /* eslint-enable unicorn/no-thenable -- Promise API */
2942
2943
  var that = this;
2943
- return new SyncPromise( /** @type {ResolveReject} */
2944
+ return new SyncPromise(/** @type {ResolveReject} */
2944
2945
  function (resolve, reject) {
2945
2946
  var rej = typeof errBack === 'function' ? errBack : reject;
2946
2947
 
@@ -2970,7 +2971,7 @@
2970
2971
  */
2971
2972
  SyncPromise.prototype["catch"] = function (cb) {
2972
2973
  var that = this;
2973
- return new SyncPromise( /** @type {ResolveReject} */
2974
+ return new SyncPromise(/** @type {ResolveReject} */
2974
2975
  function (resolve, reject) {
2975
2976
  /**
2976
2977
  * @returns {void}
@@ -2999,7 +3000,7 @@
2999
3000
  * @returns {SyncPromise}
3000
3001
  */
3001
3002
  SyncPromise.all = function (promises) {
3002
- return new SyncPromise( /** @type {ResolveReject} */
3003
+ return new SyncPromise(/** @type {ResolveReject} */
3003
3004
  function (resolve, reject) {
3004
3005
  var l = promises.length;
3005
3006
  /** @type {ArbitraryValue[]} */
@@ -3009,8 +3010,8 @@
3009
3010
  return;
3010
3011
  }
3011
3012
  promises.forEach(function (p, i) {
3012
- if (isPromise( /** @type {PromiseLike<any>} */p)) {
3013
- addReject( /** @type {PromiseLike<any>} */p.then( /** @type {OnFulfilled} */
3013
+ if (isPromise(/** @type {PromiseLike<any>} */p)) {
3014
+ addReject(/** @type {PromiseLike<any>} */p.then(/** @type {OnFulfilled} */
3014
3015
  function (res) {
3015
3016
  newPromises[i] = res;
3016
3017
  --l || resolve(newPromises);
@@ -3029,11 +3030,11 @@
3029
3030
  */
3030
3031
  SyncPromise.race = function (promises) {
3031
3032
  var resolved = false;
3032
- return new SyncPromise( /** @type {ResolveReject} */
3033
+ return new SyncPromise(/** @type {ResolveReject} */
3033
3034
  function (resolve, reject) {
3034
3035
  promises.some(function (p, i) {
3035
- if (isPromise( /** @type {PromiseLike<any>} */p)) {
3036
- addReject( /** @type {PromiseLike<any>} */p.then( /** @type {OnFulfilled} */
3036
+ if (isPromise(/** @type {PromiseLike<any>} */p)) {
3037
+ addReject(/** @type {PromiseLike<any>} */p.then(/** @type {OnFulfilled} */
3037
3038
  function (res) {
3038
3039
  if (resolved) {
3039
3040
  return;
@@ -3055,7 +3056,7 @@
3055
3056
  * @returns {SyncPromise}
3056
3057
  */
3057
3058
  SyncPromise.resolve = function (val) {
3058
- return new SyncPromise( /** @type {ResolveReject} */
3059
+ return new SyncPromise(/** @type {ResolveReject} */
3059
3060
  function (resolve, reject) {
3060
3061
  resolve(val);
3061
3062
  });
@@ -3066,7 +3067,7 @@
3066
3067
  * @returns {SyncPromise}
3067
3068
  */
3068
3069
  SyncPromise.reject = function (val) {
3069
- return new SyncPromise( /** @type {ResolveReject} */
3070
+ return new SyncPromise(/** @type {ResolveReject} */
3070
3071
  function (resolve, reject) {
3071
3072
  reject(val);
3072
3073
  });
@@ -3170,7 +3171,7 @@
3170
3171
  };
3171
3172
  var keyTypes = /** @type {(KeyType|"invalid")[]} */Object.keys(keyTypeToEncodedChar);
3172
3173
  keyTypes.forEach(function (k) {
3173
- keyTypeToEncodedChar[k] = String.fromCodePoint( /** @type {number} */keyTypeToEncodedChar[k]);
3174
+ keyTypeToEncodedChar[k] = String.fromCodePoint(/** @type {number} */keyTypeToEncodedChar[k]);
3174
3175
  });
3175
3176
  var encodedCharToKeyType = keyTypes.reduce(function (o, k) {
3176
3177
  o[keyTypeToEncodedChar[k]] = k;
@@ -3192,6 +3193,14 @@
3192
3193
  * @typedef {any} AnyValue
3193
3194
  */
3194
3195
 
3196
+ /**
3197
+ * @type {{
3198
+ * [key: string]: {
3199
+ * encode: (param: any, inArray?: boolean) => string,
3200
+ * decode: (param: string, inArray?: boolean) => any
3201
+ * }
3202
+ * }}
3203
+ */
3195
3204
  var types = {
3196
3205
  invalid: {
3197
3206
  /**
@@ -3551,7 +3560,7 @@
3551
3560
  return 'binary';
3552
3561
  }
3553
3562
  var keyType = _typeof$2(key);
3554
- return ['string', 'number'].includes(keyType) ? ( /** @type {"string"|"number"} */keyType) : 'invalid';
3563
+ return ['string', 'number'].includes(keyType) ? (/** @type {"string"|"number"} */keyType) : 'invalid';
3555
3564
  }
3556
3565
 
3557
3566
  /**
@@ -3659,7 +3668,7 @@
3659
3668
  // May throw (if detached)
3660
3669
  // Get a copy of the bytes held by the buffer source
3661
3670
  // https://heycam.github.io/webidl/#ref-for-dfn-get-buffer-source-copy-2
3662
- var octets = getCopyBytesHeldByBufferSource( /** @type {BufferSource} */input);
3671
+ var octets = getCopyBytesHeldByBufferSource(/** @type {BufferSource} */input);
3663
3672
  return {
3664
3673
  type: 'binary',
3665
3674
  value: octets
@@ -3896,7 +3905,7 @@
3896
3905
  value = /** @type {File} */value[idntfr];
3897
3906
  break;
3898
3907
  case 'lastModifiedDate':
3899
- value = new Date( /** @type {File} */value.lastModified);
3908
+ value = new Date(/** @type {File} */value.lastModified);
3900
3909
  break;
3901
3910
  }
3902
3911
  } else if (!isObj(value) || !Object.hasOwn(value, idntfr)) {
@@ -3930,7 +3939,7 @@
3930
3939
  }
3931
3940
  value = value[identifier];
3932
3941
  });
3933
- value[( /** @type {string} */last)] = key; // key is already a `keyValue` in our processing so no need to convert
3942
+ value[(/** @type {string} */last)] = key; // key is already a `keyValue` in our processing so no need to convert
3934
3943
  }
3935
3944
 
3936
3945
  /**
@@ -4102,7 +4111,6 @@
4102
4111
  return null;
4103
4112
  }
4104
4113
  // array, date, number, string, binary (should already have detected "invalid")
4105
- // @ts-expect-error Argument may be ignored
4106
4114
  return types[getKeyType(key)].encode(key, inArray);
4107
4115
  }
4108
4116
 
@@ -4228,7 +4236,7 @@
4228
4236
  getCurrentNumber(tx, store, function (key) {
4229
4237
  if (key > MAX_ALLOWED_CURRENT_NUMBER) {
4230
4238
  // 2 ^ 53 (See <https://github.com/w3c/IndexedDB/issues/147>)
4231
- cb('failure'); // eslint-disable-line n/no-callback-literal
4239
+ cb('failure');
4232
4240
  return;
4233
4241
  }
4234
4242
  // Increment current number by 1 (we cannot leverage SQLite's
@@ -4354,7 +4362,7 @@
4354
4362
  convertValueToKeyRethrowingAndIfInvalid(upper);
4355
4363
  }
4356
4364
  if (lower !== undefined && upper !== undefined && lower !== upper) {
4357
- if ( /** @type {string} */_encode(lower) > ( /** @type {string} */_encode(upper))) {
4365
+ if (/** @type {string} */_encode(lower) > (/** @type {string} */_encode(upper))) {
4358
4366
  throw createDOMException('DataError', '`lower` must not be greater than `upper` argument in `bound()` call.');
4359
4367
  }
4360
4368
  }
@@ -4405,7 +4413,7 @@
4405
4413
  if (!arguments.length) {
4406
4414
  throw new TypeError('IDBKeyRange.lowerBound requires a value argument');
4407
4415
  }
4408
- // eslint-disable-next-line prefer-rest-params
4416
+ // eslint-disable-next-line prefer-rest-params -- API
4409
4417
  return IDBKeyRange.__createInstance(value, undefined, arguments[1], true);
4410
4418
  };
4411
4419
 
@@ -4417,7 +4425,7 @@
4417
4425
  if (!arguments.length) {
4418
4426
  throw new TypeError('IDBKeyRange.upperBound requires a value argument');
4419
4427
  }
4420
- // eslint-disable-next-line prefer-rest-params
4428
+ // eslint-disable-next-line prefer-rest-params -- API
4421
4429
  return IDBKeyRange.__createInstance(undefined, value, true, arguments[1]);
4422
4430
  };
4423
4431
 
@@ -4430,7 +4438,7 @@
4430
4438
  if (arguments.length <= 1) {
4431
4439
  throw new TypeError('IDBKeyRange.bound requires lower and upper arguments');
4432
4440
  }
4433
- // eslint-disable-next-line prefer-rest-params
4441
+ // eslint-disable-next-line prefer-rest-params -- API
4434
4442
  return IDBKeyRange.__createInstance(lower, upper, arguments[2], arguments[3]);
4435
4443
  };
4436
4444
  IDBKeyRange.prototype[Symbol.toStringTag] = 'IDBKeyRangePrototype';
@@ -4492,7 +4500,7 @@
4492
4500
  encodedUpperKey = checkCached ? range.__upperCached : _encode(range.upper);
4493
4501
  }
4494
4502
  if (hasLower) {
4495
- sqlValues.push(escapeSQLiteStatement( /** @type {string} */encodedLowerKey));
4503
+ sqlValues.push(escapeSQLiteStatement(/** @type {string} */encodedLowerKey));
4496
4504
  if (hasUpper && encodedLowerKey === encodedUpperKey && !range.lowerOpen && !range.upperOpen) {
4497
4505
  sql.push(quotedKeyColumnName, '=', '?');
4498
4506
  return;
@@ -4504,7 +4512,7 @@
4504
4512
  }
4505
4513
  if (hasUpper) {
4506
4514
  sql.push(quotedKeyColumnName, range.upperOpen ? '<' : '<=', '?');
4507
- sqlValues.push(escapeSQLiteStatement( /** @type {string} */encodedUpperKey));
4515
+ sqlValues.push(escapeSQLiteStatement(/** @type {string} */encodedUpperKey));
4508
4516
  }
4509
4517
  }
4510
4518
  }
@@ -4566,7 +4574,8 @@
4566
4574
  if (testObject.test) {
4567
4575
  cleanInterface = true;
4568
4576
  }
4569
- } catch (e) {
4577
+ // eslint-disable-next-line no-unused-vars -- Problem with commonJS rollup
4578
+ } catch (err) {
4570
4579
  // Object.defineProperty does not work as intended.
4571
4580
  }
4572
4581
  }
@@ -4648,7 +4657,7 @@
4648
4657
  * @returns {void}
4649
4658
  */
4650
4659
  forEach: function forEach(cb, thisArg) {
4651
- // eslint-disable-next-line unicorn/no-array-callback-reference, unicorn/no-array-method-this-argument
4660
+ // eslint-disable-next-line unicorn/no-array-callback-reference, unicorn/no-array-method-this-argument -- Convenient
4652
4661
  this._items.forEach(cb, thisArg);
4653
4662
  },
4654
4663
  /**
@@ -4657,7 +4666,7 @@
4657
4666
  * @returns {any[]}
4658
4667
  */
4659
4668
  map: function map(cb, thisArg) {
4660
- // eslint-disable-next-line unicorn/no-array-callback-reference, unicorn/no-array-method-this-argument
4669
+ // eslint-disable-next-line unicorn/no-array-callback-reference, unicorn/no-array-method-this-argument -- Convenient
4661
4670
  return this._items.map(cb, thisArg);
4662
4671
  },
4663
4672
  /**
@@ -4924,7 +4933,6 @@
4924
4933
 
4925
4934
  // @ts-expect-error It's ok
4926
4935
  IDBTransaction.prototype = EventTargetFactory.createInstance({
4927
- // eslint-disable-next-line n/no-sync -- API
4928
4936
  defaultSync: true,
4929
4937
  // Ensure EventTarget preserves our properties
4930
4938
  extraProperties: ['complete']
@@ -5082,7 +5090,7 @@
5082
5090
  }
5083
5091
  q.op(tx, q.args, success, error, executeNextRequest);
5084
5092
  } catch (e) {
5085
- error( /** @type {Error} */e);
5093
+ error(/** @type {Error} */e);
5086
5094
  }
5087
5095
  }
5088
5096
  }
@@ -5093,7 +5101,7 @@
5093
5101
  // Not a genuine SQL error
5094
5102
  return;
5095
5103
  }
5096
- var err = webSQLErrback( /** @type {SQLError} */webSQLErr);
5104
+ var err = webSQLErrback(/** @type {SQLError} */webSQLErr);
5097
5105
  me.__abortTransaction(err);
5098
5106
  }, function () {
5099
5107
  // For Node, we don't need to try running here as we can keep
@@ -5294,7 +5302,7 @@
5294
5302
  }
5295
5303
  IDBTransaction.__assertNotFinished(me);
5296
5304
  if (me.__objectStoreNames.indexOf(objectStoreName) === -1) {
5297
- // eslint-disable-line unicorn/prefer-includes
5305
+ // eslint-disable-line unicorn/prefer-includes -- Not supported
5298
5306
  throw createDOMException('NotFoundError', objectStoreName + ' is not participating in this transaction');
5299
5307
  }
5300
5308
  var store = me.db.__objectStores[objectStoreName];
@@ -5331,7 +5339,7 @@
5331
5339
  me.__objectStoreNames = me.db.__oldObjectStoreNames;
5332
5340
  Object.values(me.db.__objectStores).concat(Object.values(me.__storeHandles)).forEach(function (store) {
5333
5341
  // Store was already created so we restore to name before the rename
5334
- if ('__pendingName' in store && me.db.__oldObjectStoreNames.indexOf(store.__pendingName) > -1 // eslint-disable-line unicorn/prefer-includes
5342
+ if ('__pendingName' in store && me.db.__oldObjectStoreNames.indexOf(store.__pendingName) > -1 // eslint-disable-line unicorn/prefer-includes -- Not supported
5335
5343
  ) {
5336
5344
  store.__name = store.__originalName;
5337
5345
  }
@@ -5339,7 +5347,7 @@
5339
5347
  delete store.__pendingDelete;
5340
5348
  Object.values(store.__indexes).concat(Object.values(store.__indexHandles)).forEach(function (index) {
5341
5349
  // Index was already created so we restore to name before the rename
5342
- if ('__pendingName' in index && store.__oldIndexNames.indexOf(index.__pendingName) > -1 // eslint-disable-line unicorn/prefer-includes
5350
+ if ('__pendingName' in index && store.__oldIndexNames.indexOf(index.__pendingName) > -1 // eslint-disable-line unicorn/prefer-includes -- Not supported
5343
5351
  ) {
5344
5352
  index.__name = index.__originalName;
5345
5353
  }
@@ -5379,7 +5387,7 @@
5379
5387
  }
5380
5388
  me.dispatchEvent(createEvent('__preabort'));
5381
5389
  me.__requests.filter(function (q, i, arr) {
5382
- // eslint-disable-line promise/no-promise-in-callback
5390
+ // eslint-disable-line promise/no-promise-in-callback -- Sync promise
5383
5391
  return q.req && !q.req.__done && [i, -1].includes(arr.map(function (q) {
5384
5392
  return q.req;
5385
5393
  }).lastIndexOf(q.req));
@@ -5400,7 +5408,7 @@
5400
5408
  bubbles: true,
5401
5409
  cancelable: true
5402
5410
  });
5403
- return new SyncPromise( /** @type {() => void} */
5411
+ return new SyncPromise(/** @type {() => void} */
5404
5412
  function (resolve) {
5405
5413
  setTimeout(function () {
5406
5414
  if (!q.req) {
@@ -5445,6 +5453,7 @@
5445
5453
  }
5446
5454
  try {
5447
5455
  me.__tx.executeSql('ROLLBACK', [], abort, /** @type {SQLStatementErrorCallback} */abort); // Not working in some circumstances, even in Node
5456
+ // eslint-disable-next-line no-unused-vars -- Problem with commonJS rollup
5448
5457
  } catch (err) {
5449
5458
  // Browser errs when transaction has ended and since it most likely already erred here,
5450
5459
  // we call to abort
@@ -5657,7 +5666,7 @@
5657
5666
  if ("object" != _typeof$2(e) || null === e) return e;
5658
5667
  var r = e[Symbol.toPrimitive];
5659
5668
  if (void 0 !== r) {
5660
- var n = r.call(e, t );
5669
+ var n = r.call(e, t);
5661
5670
  if ("object" != _typeof$2(n)) return n;
5662
5671
  throw new TypeError("@@toPrimitive must return a primitive value.");
5663
5672
  }
@@ -5713,7 +5722,7 @@
5713
5722
  var t = Object.hasOwn,
5714
5723
  r = Object.getPrototypeOf;
5715
5724
  function isThenable(e, t) {
5716
- return isObject(e) && "function" == typeof e.then && (!t );
5725
+ return isObject(e) && "function" == typeof e.then && (!t);
5717
5726
  }
5718
5727
  function toStringTag(e) {
5719
5728
  return Object.prototype.toString.call(e).slice(8, -1);
@@ -6397,8 +6406,8 @@
6397
6406
  return "CryptoKey" === toStringTag(e) && e.extractable;
6398
6407
  },
6399
6408
  replaceAsync: function replaceAsync(t) {
6400
- return new e( /*#__PURE__*/function () {
6401
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e, r) {
6409
+ return new e(/*#__PURE__*/function () {
6410
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(e, r) {
6402
6411
  var n;
6403
6412
  return _regeneratorRuntime().wrap(function _callee$(_context) {
6404
6413
  while (1) switch (_context.prev = _context.next) {
@@ -6782,8 +6791,8 @@
6782
6791
  a = document.createElement("img");
6783
6792
  return a.addEventListener("load", function () {
6784
6793
  n.drawImage(a, 0, 0);
6785
- }), a.src = t.dataURL, new e( /*#__PURE__*/function () {
6786
- var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e, t) {
6794
+ }), a.src = t.dataURL, new e(/*#__PURE__*/function () {
6795
+ var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e, t) {
6787
6796
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
6788
6797
  while (1) switch (_context2.prev = _context2.next) {
6789
6798
  case 0:
@@ -6909,7 +6918,9 @@
6909
6918
  test: function test(e) {
6910
6919
  return "Boolean" === toStringTag(e) && "object" == _typeof$2(e);
6911
6920
  },
6912
- replace: Boolean,
6921
+ replace: function replace(e) {
6922
+ return e.valueOf();
6923
+ },
6913
6924
  revive: function revive(e) {
6914
6925
  return new Boolean(e);
6915
6926
  }
@@ -7108,7 +7119,6 @@
7108
7119
  function encode(obj, func) {
7109
7120
  var ret;
7110
7121
  try {
7111
- // eslint-disable-next-line n/no-sync
7112
7122
  ret = typeson.stringifySync(obj);
7113
7123
  } catch (err) {
7114
7124
  // SCA in typeson-registry using `DOMException` which is not defined (e.g., in Node)
@@ -7242,7 +7252,7 @@
7242
7252
  * @returns {string}
7243
7253
  */
7244
7254
  get: function get() {
7245
- return '__pendingName' in me ? ( /** @type {string} */me.__pendingName) : me.name;
7255
+ return '__pendingName' in me ? (/** @type {string} */me.__pendingName) : me.name;
7246
7256
  }
7247
7257
  });
7248
7258
  Object.defineProperty(me, 'name', {
@@ -7421,7 +7431,8 @@
7421
7431
  tx.executeSql('UPDATE ' + escapeStoreNameForSQL(storeName) + ' SET ' + escapeIndexNameForSQL(indexName) + ' = ? WHERE "key" = ?', [escapeSQLiteStatement(indexKeyStr), data.rows.item(i).key], function () {
7422
7432
  addIndexEntry(i + 1);
7423
7433
  }, /** @type {SQLStatementErrorCallback} */error);
7424
- } catch (e) {
7434
+ // eslint-disable-next-line no-unused-vars -- Problem with commonJS rollup
7435
+ } catch (err) {
7425
7436
  // Not a valid value to insert into index, so just continue
7426
7437
  addIndexEntry(i + 1);
7427
7438
  }
@@ -7609,7 +7620,7 @@
7609
7620
  IDBIndex.prototype.openCursor = function /* query, direction */
7610
7621
  () {
7611
7622
  var me = this;
7612
- // eslint-disable-next-line prefer-rest-params
7623
+ // eslint-disable-next-line prefer-rest-params -- API
7613
7624
  var _arguments = Array.prototype.slice.call(arguments),
7614
7625
  query = _arguments[0],
7615
7626
  direction = _arguments[1];
@@ -7626,7 +7637,7 @@
7626
7637
  IDBIndex.prototype.openKeyCursor = function /* query, direction */
7627
7638
  () {
7628
7639
  var me = this;
7629
- // eslint-disable-next-line prefer-rest-params
7640
+ // eslint-disable-next-line prefer-rest-params -- API
7630
7641
  var _arguments2 = Array.prototype.slice.call(arguments),
7631
7642
  query = _arguments2[0],
7632
7643
  direction = _arguments2[1];
@@ -7671,7 +7682,7 @@
7671
7682
  */
7672
7683
  IDBIndex.prototype.getAll = function /* query, count */
7673
7684
  () {
7674
- // eslint-disable-next-line prefer-rest-params
7685
+ // eslint-disable-next-line prefer-rest-params -- API
7675
7686
  var _arguments3 = Array.prototype.slice.call(arguments),
7676
7687
  query = _arguments3[0],
7677
7688
  count = _arguments3[1];
@@ -7684,7 +7695,7 @@
7684
7695
  */
7685
7696
  IDBIndex.prototype.getAllKeys = function /* query, count */
7686
7697
  () {
7687
- // eslint-disable-next-line prefer-rest-params
7698
+ // eslint-disable-next-line prefer-rest-params -- API
7688
7699
  var _arguments4 = Array.prototype.slice.call(arguments),
7689
7700
  query = _arguments4[0],
7690
7701
  count = _arguments4[1];
@@ -7698,7 +7709,7 @@
7698
7709
  IDBIndex.prototype.count = function /* query */
7699
7710
  () {
7700
7711
  var me = this;
7701
- // eslint-disable-next-line prefer-rest-params
7712
+ // eslint-disable-next-line prefer-rest-params -- API
7702
7713
  var query = arguments[0];
7703
7714
  // With the exception of needing to check whether the index has been
7704
7715
  // deleted, we could, for greater spec parity (if not accuracy),
@@ -7937,7 +7948,7 @@
7937
7948
  return rowKey.includes(check);
7938
7949
  }) ||
7939
7950
  // More precise than our SQL
7940
- isMultiEntryMatch( /** @type {string} */
7951
+ isMultiEntryMatch(/** @type {string} */
7941
7952
  encodedKey, row[escapedIndexNameForKeyCol]))) {
7942
7953
  recordCount++;
7943
7954
  record = row;
@@ -8009,12 +8020,12 @@
8009
8020
  sql.push('OR');
8010
8021
  }
8011
8022
  sql.push(escapeIndexNameForSQL(index.name), "LIKE ? ESCAPE '^' ");
8012
- sqlValues.push('%' + sqlLIKEEscape( /** @type {string} */_encode(innerKey, index.multiEntry)) + '%');
8023
+ sqlValues.push('%' + sqlLIKEEscape(/** @type {string} */_encode(innerKey, index.multiEntry)) + '%');
8013
8024
  });
8014
8025
  sql.push(')');
8015
8026
  } else if (index.multiEntry) {
8016
8027
  sql.push('AND', escapeIndexNameForSQL(index.name), "LIKE ? ESCAPE '^'");
8017
- sqlValues.push('%' + sqlLIKEEscape( /** @type {string} */_encode(range, index.multiEntry)) + '%');
8028
+ sqlValues.push('%' + sqlLIKEEscape(/** @type {string} */_encode(range, index.multiEntry)) + '%');
8018
8029
  } else {
8019
8030
  var convertedRange = convertValueToKeyRange(range, nullDisallowed);
8020
8031
  setSQLForKeyRange(convertedRange, escapeIndexNameForSQL(index.name), sql, sqlValues, true, false);
@@ -8519,6 +8530,7 @@
8519
8530
  if ('invalid' in indexKey && indexKey.invalid || 'failure' in indexKey && indexKey.failure) {
8520
8531
  throw new Error('Go to catch');
8521
8532
  }
8533
+ // eslint-disable-next-line no-unused-vars -- Problem with commonJS rollup
8522
8534
  } catch (err) {
8523
8535
  resolve(undefined);
8524
8536
  return;
@@ -8560,7 +8572,7 @@
8560
8572
  // Key.convertValueToKey(primaryKey); // Already run
8561
8573
  sqlStart.push(sqlQuote('key'), ',');
8562
8574
  sqlEnd.push('?,');
8563
- insertSqlValues.push(escapeSQLiteStatement( /** @type {string} */_encode(clonedKeyOrCurrentNumber)));
8575
+ insertSqlValues.push(escapeSQLiteStatement(/** @type {string} */_encode(clonedKeyOrCurrentNumber)));
8564
8576
  }
8565
8577
  Object.entries(paramMap).forEach(function (_ref) {
8566
8578
  var _ref2 = _slicedToArray$1(_ref, 2),
@@ -8613,7 +8625,7 @@
8613
8625
  */
8614
8626
  IDBObjectStore.prototype.add = function (value /* , key */) {
8615
8627
  var me = this;
8616
- // eslint-disable-next-line prefer-rest-params
8628
+ // eslint-disable-next-line prefer-rest-params -- API
8617
8629
  var key = arguments[1];
8618
8630
  if (!(me instanceof IDBObjectStore)) {
8619
8631
  throw new TypeError('Illegal invocation');
@@ -8643,7 +8655,7 @@
8643
8655
  */
8644
8656
  IDBObjectStore.prototype.put = function (value /* , key */) {
8645
8657
  var me = this;
8646
- // eslint-disable-next-line prefer-rest-params
8658
+ // eslint-disable-next-line prefer-rest-params -- API
8647
8659
  var key = arguments[1];
8648
8660
  if (!(me instanceof IDBObjectStore)) {
8649
8661
  throw new TypeError('Illegal invocation');
@@ -8700,7 +8712,7 @@
8700
8712
  * @returns {void}
8701
8713
  */
8702
8714
  IDBObjectStore.__storingRecordObjectStore = function (request, store, invalidateCache, value, noOverwrite /* , key */) {
8703
- // eslint-disable-next-line prefer-rest-params
8715
+ // eslint-disable-next-line prefer-rest-params -- API
8704
8716
  var key = arguments[5];
8705
8717
  /** @type {import('./IDBTransaction.js').IDBTransactionFull} */
8706
8718
  store.transaction.__pushToQueue(request, function (tx, args, success, error) {
@@ -8845,7 +8857,7 @@
8845
8857
  */
8846
8858
  IDBObjectStore.prototype.getAll = function /* query, count */
8847
8859
  () {
8848
- // eslint-disable-next-line prefer-rest-params
8860
+ // eslint-disable-next-line prefer-rest-params -- API
8849
8861
  var _arguments = Array.prototype.slice.call(arguments),
8850
8862
  query = _arguments[0],
8851
8863
  count = _arguments[1];
@@ -8858,7 +8870,7 @@
8858
8870
  */
8859
8871
  IDBObjectStore.prototype.getAllKeys = function /* query, count */
8860
8872
  () {
8861
- // eslint-disable-next-line prefer-rest-params
8873
+ // eslint-disable-next-line prefer-rest-params -- API
8862
8874
  var _arguments2 = Array.prototype.slice.call(arguments),
8863
8875
  query = _arguments2[0],
8864
8876
  count = _arguments2[1];
@@ -8945,7 +8957,7 @@
8945
8957
  IDBObjectStore.prototype.count = function /* query */
8946
8958
  () {
8947
8959
  var me = this;
8948
- // eslint-disable-next-line prefer-rest-params
8960
+ // eslint-disable-next-line prefer-rest-params -- API
8949
8961
  var query = arguments[0];
8950
8962
  if (!(me instanceof IDBObjectStore)) {
8951
8963
  throw new TypeError('Illegal invocation');
@@ -8964,7 +8976,7 @@
8964
8976
  IDBObjectStore.prototype.openCursor = function /* query, direction */
8965
8977
  () {
8966
8978
  var me = this;
8967
- // eslint-disable-next-line prefer-rest-params
8979
+ // eslint-disable-next-line prefer-rest-params -- API
8968
8980
  var _arguments3 = Array.prototype.slice.call(arguments),
8969
8981
  query = _arguments3[0],
8970
8982
  direction = _arguments3[1];
@@ -8988,7 +9000,7 @@
8988
9000
  throw new TypeError('Illegal invocation');
8989
9001
  }
8990
9002
  IDBObjectStore.__invalidStateIfDeleted(me);
8991
- // eslint-disable-next-line prefer-rest-params
9003
+ // eslint-disable-next-line prefer-rest-params -- API
8992
9004
  var _arguments4 = Array.prototype.slice.call(arguments),
8993
9005
  query = _arguments4[0],
8994
9006
  direction = _arguments4[1];
@@ -9032,7 +9044,7 @@
9032
9044
  */
9033
9045
  IDBObjectStore.prototype.createIndex = function (indexName, keyPath /* , optionalParameters */) {
9034
9046
  var me = this;
9035
- // eslint-disable-next-line prefer-rest-params
9047
+ // eslint-disable-next-line prefer-rest-params -- API
9036
9048
  var optionalParameters = arguments[2];
9037
9049
  if (!(me instanceof IDBObjectStore)) {
9038
9050
  throw new TypeError('Illegal invocation');
@@ -9335,6 +9347,8 @@
9335
9347
  function IDBDatabase() {
9336
9348
  this.__versionTransaction = null;
9337
9349
  this.__objectStores = null;
9350
+ /** @type {import('./IDBTransaction.js').IDBTransactionFull[]} */
9351
+ this.__transactions = [];
9338
9352
  throw new TypeError('Illegal constructor');
9339
9353
  }
9340
9354
  var IDBDatabaseAlias = IDBDatabase;
@@ -9398,6 +9412,8 @@
9398
9412
  this.__setOptions({
9399
9413
  legacyOutputDidListenersThrowFlag: true // Event hook for IndexedB
9400
9414
  });
9415
+
9416
+ /** @type {import('./IDBTransaction.js').IDBTransactionFull[]} */
9401
9417
  this.__transactions = [];
9402
9418
 
9403
9419
  /** @type {{[key: string]: IDBObjectStore}} */
@@ -9451,7 +9467,7 @@
9451
9467
  * @returns {IDBObjectStore}
9452
9468
  */
9453
9469
  IDBDatabase.prototype.createObjectStore = function (storeName /* , createOptions */) {
9454
- // eslint-disable-next-line prefer-rest-params
9470
+ // eslint-disable-next-line prefer-rest-params -- API
9455
9471
  var createOptions = arguments[1];
9456
9472
  storeName = String(storeName); // W3C test within IDBObjectStore.js seems to accept string conversion
9457
9473
  if (!(this instanceof IDBDatabase)) {
@@ -9527,6 +9543,7 @@
9527
9543
  if (this.__unblocking) {
9528
9544
  this.__unblocking.check();
9529
9545
  }
9546
+ this.__transactions = [];
9530
9547
  };
9531
9548
 
9532
9549
  /**
@@ -9540,7 +9557,7 @@
9540
9557
  if (arguments.length === 0) {
9541
9558
  throw new TypeError('You must supply a valid `storeNames` to `IDBDatabase.transaction`');
9542
9559
  }
9543
- // eslint-disable-next-line prefer-rest-params
9560
+ // eslint-disable-next-line prefer-rest-params -- API
9544
9561
  var mode = arguments[1];
9545
9562
  storeNames = isIterable(storeNames)
9546
9563
  // Creating new array also ensures sequence is passed by value: https://heycam.github.io/webidl/#idl-sequence
@@ -9625,6 +9642,7 @@
9625
9642
  };
9626
9643
  trans.__abortTransaction(createDOMException('AbortError', 'The connection was force-closed: ' + (msg || '')));
9627
9644
  });
9645
+ me.__transactions = [];
9628
9646
  };
9629
9647
  defineOuterInterface(IDBDatabase.prototype, listeners);
9630
9648
  defineReadonlyOuterInterface(IDBDatabase.prototype, readonlyProperties);
@@ -9662,6 +9680,7 @@
9662
9680
  * @returns {string}
9663
9681
  */
9664
9682
  var getOrigin = function getOrigin() {
9683
+ // eslint-disable-next-line no-undef -- If browser/polyfilled
9665
9684
  return (typeof location === "undefined" ? "undefined" : _typeof$2(location)) !== 'object' || !location ? 'null' : location.origin;
9666
9685
  };
9667
9686
  var hasNullOrigin = function hasNullOrigin() {
@@ -9712,7 +9731,7 @@
9712
9731
  cb(req);
9713
9732
  }
9714
9733
 
9715
- /* eslint-disable default-param-last */
9734
+ /* eslint-disable default-param-last -- Keep cb at end */
9716
9735
  /**
9717
9736
  * @param {import('./IDBRequest.js').IDBOpenDBRequestFull} req
9718
9737
  * @param {string} name
@@ -9723,7 +9742,7 @@
9723
9742
  function addRequestToConnectionQueue(req, name) {
9724
9743
  var origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : getOrigin();
9725
9744
  var cb = arguments.length > 3 ? arguments[3] : undefined;
9726
- /* eslint-enable default-param-last */
9745
+ /* eslint-enable default-param-last -- Keep cb at end */
9727
9746
  if (!connectionQueue[origin][name]) {
9728
9747
  connectionQueue[origin][name] = [];
9729
9748
  }
@@ -9956,7 +9975,7 @@
9956
9975
  * @returns {void}
9957
9976
  */
9958
9977
  function sysDbCreateError(tx, err) {
9959
- var er = webSQLErrback( /** @type {SQLError} */err || tx);
9978
+ var er = webSQLErrback(/** @type {SQLError} */err || tx);
9960
9979
  if (CFG.DEBUG) {
9961
9980
  console.log('Error in sysdb transaction - when creating dbVersions', err);
9962
9981
  }
@@ -10032,7 +10051,7 @@
10032
10051
  if (!(me instanceof IDBFactory)) {
10033
10052
  throw new TypeError('Illegal invocation');
10034
10053
  }
10035
- // eslint-disable-next-line prefer-rest-params
10054
+ // eslint-disable-next-line prefer-rest-params -- API
10036
10055
  var version = arguments[1];
10037
10056
  if (arguments.length === 0) {
10038
10057
  throw new TypeError('Database name is required');
@@ -10058,10 +10077,10 @@
10058
10077
 
10059
10078
  /** @type {string} */
10060
10079
  var escapedDatabaseName;
10061
- // eslint-disable-next-line no-useless-catch
10080
+ // eslint-disable-next-line no-useless-catch -- Possible refactoring
10062
10081
  try {
10063
10082
  escapedDatabaseName = escapeDatabaseNameForSQLAndFiles(name);
10064
- // eslint-disable-next-line sonarjs/no-useless-catch
10083
+ // eslint-disable-next-line sonarjs/no-useless-catch -- Possible refactoring
10065
10084
  } catch (err) {
10066
10085
  throw err; // new TypeError('You have supplied a database name which does not match the currently supported configuration, possibly due to a length limit enforced for Node compatibility.');
10067
10086
  }
@@ -10076,7 +10095,7 @@
10076
10095
  if (calledDbCreateError) {
10077
10096
  return false;
10078
10097
  }
10079
- var er = err ? webSQLErrback(err) : ( /** @type {Error} */tx);
10098
+ var er = err ? webSQLErrback(err) : (/** @type {Error} */tx);
10080
10099
  calledDbCreateError = true;
10081
10100
  // Re: why bubbling here (and how cancelable is only really relevant for `window.onerror`) see: https://github.com/w3c/IndexedDB/issues/86
10082
10101
  var evt = createEvent('error', er, {
@@ -10126,7 +10145,8 @@
10126
10145
  if (err) {
10127
10146
  try {
10128
10147
  systx.executeSql('ROLLBACK', [], cb, cb);
10129
- } catch (er) {
10148
+ // eslint-disable-next-line no-unused-vars -- Problem with commonJS rollup
10149
+ } catch (err) {
10130
10150
  // Browser may fail with expired transaction above so
10131
10151
  // no choice but to manually revert
10132
10152
  sysdb.transaction(function (systx) {
@@ -10144,7 +10164,7 @@
10144
10164
  if (oldVersion === 0) {
10145
10165
  systx.executeSql('DELETE FROM dbVersions WHERE "name" = ?', [sqlSafeName], function () {
10146
10166
  // @ts-expect-error Force to work
10147
- cb(reportError); // eslint-disable-line promise/no-callback-in-promise
10167
+ cb(reportError); // eslint-disable-line promise/no-callback-in-promise -- Convenient
10148
10168
  },
10149
10169
  // @ts-expect-error Force to work
10150
10170
  reportError);
@@ -10158,7 +10178,7 @@
10158
10178
  return;
10159
10179
  }
10160
10180
  // In browser, should auto-commit
10161
- cb(); // eslint-disable-line promise/no-callback-in-promise
10181
+ cb(); // eslint-disable-line promise/no-callback-in-promise -- Convenient
10162
10182
  };
10163
10183
  sysdb.transaction(function (systx) {
10164
10184
  /**
@@ -10232,7 +10252,11 @@
10232
10252
 
10233
10253
  // eslint-disable-next-line camelcase -- Clear API
10234
10254
  req.transaction.on__complete = function () {
10235
- if ( /** @type {import('./IDBDatabase.js').IDBDatabaseFull} */req.__result.__closePending) {
10255
+ var pos = connection.__transactions.indexOf(req.transaction);
10256
+ if (pos > -1) {
10257
+ connection.__transactions.splice(pos, 1);
10258
+ }
10259
+ if (/** @type {import('./IDBDatabase.js').IDBDatabaseFull} */req.__result.__closePending) {
10236
10260
  req.__transaction = null;
10237
10261
  var err = createDOMException('AbortError', 'The connection has been closed.');
10238
10262
  dbCreateError(err);
@@ -10387,10 +10411,10 @@
10387
10411
 
10388
10412
  /** @type {string} */
10389
10413
  var escapedDatabaseName;
10390
- // eslint-disable-next-line no-useless-catch
10414
+ // eslint-disable-next-line no-useless-catch -- Possible refactoring
10391
10415
  try {
10392
10416
  escapedDatabaseName = escapeDatabaseNameForSQLAndFiles(name);
10393
- // eslint-disable-next-line sonarjs/no-useless-catch
10417
+ // eslint-disable-next-line sonarjs/no-useless-catch -- Possible refactoring
10394
10418
  } catch (err) {
10395
10419
  throw err; // throw new TypeError('You have supplied a database name which does not match the currently supported configuration, possibly due to a length limit enforced for Node compatibility.');
10396
10420
  }
@@ -10423,7 +10447,7 @@
10423
10447
  if (calledDBError || err === true) {
10424
10448
  return false;
10425
10449
  }
10426
- var er = webSQLErrback( /** @type {SQLError} */err || tx);
10450
+ var er = webSQLErrback(/** @type {SQLError} */err || tx);
10427
10451
  sysdbFinishedCbDelete(true, function () {
10428
10452
  req.__done = true;
10429
10453
  req.__error = er;
@@ -10477,7 +10501,7 @@
10477
10501
  version = _data$rows$item.version;
10478
10502
  var openConnections = me.__connections[name] || [];
10479
10503
  triggerAnyVersionChangeAndBlockedEvents(openConnections, req, version, null).then(function () {
10480
- // eslint-disable-line promise/catch-or-return
10504
+ // eslint-disable-line promise/catch-or-return -- Sync promise
10481
10505
  // Since we need two databases which can't be in a single transaction, we
10482
10506
  // do this deleting from `dbVersions` first since the `__sys__` deleting
10483
10507
  // only impacts file memory whereas this one is critical for avoiding it
@@ -10549,7 +10573,7 @@
10549
10573
  var me = this;
10550
10574
  var calledDbCreateError = false;
10551
10575
  return new Promise(function (resolve, reject) {
10552
- // eslint-disable-line promise/avoid-new
10576
+ // eslint-disable-line promise/avoid-new -- Own polyfill
10553
10577
  if (!(me instanceof IDBFactory)) {
10554
10578
  throw new TypeError('Illegal invocation');
10555
10579
  }
@@ -10566,7 +10590,7 @@
10566
10590
  if (calledDbCreateError) {
10567
10591
  return false;
10568
10592
  }
10569
- var er = err ? webSQLErrback( /** @type {SQLError} */err) : tx;
10593
+ var er = err ? webSQLErrback(/** @type {SQLError} */err) : tx;
10570
10594
  calledDbCreateError = true;
10571
10595
  reject(er);
10572
10596
  return false;
@@ -10614,9 +10638,10 @@
10614
10638
  conn.__forceClose(msg);
10615
10639
  }
10616
10640
  if (isNullish(dbName)) {
10617
- Object.values(me.__connections).forEach(function (conn) {
10618
- // @ts-expect-error It's ok
10619
- forceClose(conn);
10641
+ Object.values(me.__connections).forEach(function (connections) {
10642
+ connections.forEach(function (connection) {
10643
+ forceClose(connection);
10644
+ });
10620
10645
  });
10621
10646
  } else if (!me.__connections[dbName]) {
10622
10647
  console.log('No database connections with that name to force close');
@@ -10625,7 +10650,7 @@
10625
10650
  forceClose(conn);
10626
10651
  });
10627
10652
  } else if (!Number.isInteger(connIdx) || connIdx < 0 || connIdx > me.__connections[dbName].length - 1) {
10628
- throw new TypeError('If providing an argument, __forceClose must be called with a ' + 'numeric index to indicate a specific connection to lose');
10653
+ throw new TypeError('If providing an argument, __forceClose must be called with a ' + 'numeric index to indicate a specific connection to close');
10629
10654
  } else {
10630
10655
  forceClose(me.__connections[dbName][connIdx]);
10631
10656
  }
@@ -10700,7 +10725,7 @@
10700
10725
  }
10701
10726
  var IDBCursorAlias = IDBCursor;
10702
10727
 
10703
- /* eslint-disable func-name-matching */
10728
+ /* eslint-disable func-name-matching -- API */
10704
10729
  /**
10705
10730
  * The IndexedDB Cursor Object.
10706
10731
  * @see http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBCursor
@@ -10716,14 +10741,14 @@
10716
10741
  * @returns {void}
10717
10742
  */
10718
10743
  IDBCursor.__super = function IDBCursor(query, direction, store, source, keyColumnName, valueColumnName, count) {
10719
- /* eslint-enable func-name-matching */
10744
+ /* eslint-enable func-name-matching -- API */
10720
10745
  // @ts-expect-error Should be ok
10721
10746
  this[Symbol.toStringTag] = 'IDBCursor';
10722
10747
  defineReadonlyProperties(this, ['key', 'primaryKey', 'request']);
10723
10748
  IDBObjectStore.__invalidStateIfDeleted(store);
10724
10749
  this.__indexSource = instanceOf(source, IDBIndex);
10725
10750
  if (this.__indexSource) {
10726
- IDBIndex.__invalidStateIfDeleted( /** @type {import('./IDBIndex.js').IDBIndexFull} */source);
10751
+ IDBIndex.__invalidStateIfDeleted(/** @type {import('./IDBIndex.js').IDBIndexFull} */source);
10727
10752
  }
10728
10753
  IDBTransaction.__assertActive(store.transaction);
10729
10754
  var range = convertValueToKeyRange(query);
@@ -10852,16 +10877,16 @@
10852
10877
  if (primaryKey !== undefined) {
10853
10878
  sql.push('AND', quotedKey, op + '= ?');
10854
10879
  // Key.convertValueToKey(primaryKey); // Already checked by `continuePrimaryKey`
10855
- sqlValues.push( /** @type {string} */_encode(primaryKey));
10880
+ sqlValues.push(/** @type {string} */_encode(primaryKey));
10856
10881
  }
10857
10882
  if (key !== undefined) {
10858
10883
  sql.push('AND', quotedKeyColumnName, op + '= ?');
10859
10884
  // Key.convertValueToKey(key); // Already checked by `continue` or `continuePrimaryKey`
10860
- sqlValues.push( /** @type {string} */_encode(key));
10885
+ sqlValues.push(/** @type {string} */_encode(key));
10861
10886
  } else if (continueCall && me.__key !== undefined) {
10862
10887
  sql.push('AND', quotedKeyColumnName, op + ' ?');
10863
10888
  // Key.convertValueToKey(me.__key); // Already checked when stored
10864
- sqlValues.push( /** @type {string} */_encode(me.__key));
10889
+ sqlValues.push(/** @type {string} */_encode(me.__key));
10865
10890
  }
10866
10891
  if (!me.__count) {
10867
10892
  // 1. Sort by key
@@ -10942,7 +10967,7 @@
10942
10967
  if (me.__range && me.__range.lower !== undefined && Array.isArray(me.__range.upper)) {
10943
10968
  if (me.__range.upper.indexOf(me.__range.lower) === 0) {
10944
10969
  sql.push('AND', quotedKeyColumnName, "LIKE ? ESCAPE '^'");
10945
- sqlValues.push('%' + sqlLIKEEscape( /** @type {string} */me.__range.__lowerCached.slice(0, -1)) + '%');
10970
+ sqlValues.push('%' + sqlLIKEEscape(/** @type {string} */me.__range.__lowerCached.slice(0, -1)) + '%');
10946
10971
  }
10947
10972
  }
10948
10973
 
@@ -10953,16 +10978,16 @@
10953
10978
  if (primaryKey !== undefined) {
10954
10979
  sql.push('AND', quotedKey, op + '= ?');
10955
10980
  // Key.convertValueToKey(primaryKey); // Already checked by `continuePrimaryKey`
10956
- sqlValues.push( /** @type {string} */_encode(primaryKey));
10981
+ sqlValues.push(/** @type {string} */_encode(primaryKey));
10957
10982
  }
10958
10983
  if (key !== undefined) {
10959
10984
  sql.push('AND', quotedKeyColumnName, op + '= ?');
10960
10985
  // Key.convertValueToKey(key); // Already checked by `continue` or `continuePrimaryKey`
10961
- sqlValues.push( /** @type {string} */_encode(key));
10986
+ sqlValues.push(/** @type {string} */_encode(key));
10962
10987
  } else if (me.__key !== undefined) {
10963
10988
  sql.push('AND', quotedKeyColumnName, op + ' ?');
10964
10989
  // Key.convertValueToKey(me.__key); // Already checked when entered
10965
- sqlValues.push( /** @type {string} */_encode(me.__key));
10990
+ sqlValues.push(/** @type {string} */_encode(me.__key));
10966
10991
  }
10967
10992
  if (!me.__count) {
10968
10993
  // 1. Sort by key
@@ -11013,7 +11038,7 @@
11013
11038
  * @type {RowItemNonNull}
11014
11039
  */
11015
11040
  var clone = {
11016
- matchingKey: ( /** @type {string} */
11041
+ matchingKey: (/** @type {string} */
11017
11042
  _encode(matchingKey, true)),
11018
11043
  key: _rowItem.key
11019
11044
  };
@@ -11181,7 +11206,7 @@
11181
11206
  IDBCursor.prototype.__sourceOrEffectiveObjStoreDeleted = function () {
11182
11207
  IDBObjectStore.__invalidStateIfDeleted(this.__store, "The cursor's effective object store has been deleted");
11183
11208
  if (this.__indexSource) {
11184
- IDBIndex.__invalidStateIfDeleted( /** @type {import('./IDBIndex.js').IDBIndexFull} */this.source, "The cursor's index source has been deleted");
11209
+ IDBIndex.__invalidStateIfDeleted(/** @type {import('./IDBIndex.js').IDBIndexFull} */this.source, "The cursor's index source has been deleted");
11185
11210
  }
11186
11211
  };
11187
11212
 
@@ -11301,7 +11326,7 @@
11301
11326
  */
11302
11327
  IDBCursor.prototype["continue"] = function /* key */
11303
11328
  () {
11304
- // eslint-disable-next-line prefer-rest-params
11329
+ // eslint-disable-next-line prefer-rest-params -- API
11305
11330
  this.__continue(arguments[0]);
11306
11331
  };
11307
11332
 
@@ -11447,7 +11472,7 @@
11447
11472
  console.log(sql, key, primaryKey);
11448
11473
  }
11449
11474
  // Key.convertValueToKey(primaryKey); // Already checked when entered
11450
- tx.executeSql(sql, [escapeSQLiteStatement( /** @type {string} */_encode(primaryKey))], function (tx, data) {
11475
+ tx.executeSql(sql, [escapeSQLiteStatement(/** @type {string} */_encode(primaryKey))], function (tx, data) {
11451
11476
  if (data.rowsAffected === 1) {
11452
11477
  // We don't invalidate the cache (as we don't access it anymore
11453
11478
  // and it will set the index off)
@@ -11542,7 +11567,7 @@
11542
11567
  var _ref2 = _slicedToArray$1(_ref, 2),
11543
11568
  p = _ref2[0],
11544
11569
  val = _ref2[1];
11545
- setConfig( /** @type {import('./CFG.js').KeyofConfigValues} */
11570
+ setConfig(/** @type {import('./CFG.js').KeyofConfigValues} */
11546
11571
  p, val);
11547
11572
  });
11548
11573
  return;
@@ -11656,13 +11681,14 @@
11656
11681
  }
11657
11682
  } else {
11658
11683
  var o = _defineAccessor("get", {}, name, function () {
11659
- return /** @type {AnyFunction} */( /** @type {PropertyDescriptor} */propDesc.get).call(this);
11684
+ return /** @type {AnyFunction} */(/** @type {PropertyDescriptor} */propDesc.get).call(this);
11660
11685
  });
11661
11686
  desc = /** @type {PropertyDescriptor} */
11662
11687
  Object.getOwnPropertyDescriptor(o, name);
11663
11688
  }
11664
11689
  Object.defineProperty(IDB, name, desc);
11665
- } catch (e) {
11690
+ // eslint-disable-next-line no-unused-vars -- Problem with commonJS rollup
11691
+ } catch (err) {
11666
11692
  // With `indexedDB`, PhantomJS fails here and below but
11667
11693
  // not above, while Chrome is reverse (and Firefox doesn't
11668
11694
  // get here since no WebSQL to use for shimming)
@@ -11831,7 +11857,9 @@
11831
11857
  // Exclude genuine Safari: http://stackoverflow.com/a/7768006/271577
11832
11858
  // Detect iOS: http://stackoverflow.com/questions/9038625/detect-if-device-is-ios/9039885#9039885
11833
11859
  // and detect version 9: http://stackoverflow.com/a/26363560/271577
11834
- /(iPad|iPhone|iPod)(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])* o[s\u017F] 9_/i.test(navigator.userAgent) && !('MSStream' in window) // But avoid IE11
11860
+ /(iPad|iPhone|iPod)(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])* o[s\u017F] 9_/i.test(navigator.userAgent) && typeof window !== 'undefined' &&
11861
+ // eslint-disable-next-line no-undef -- Extra check
11862
+ !('MSStream' in window) // But avoid IE11
11835
11863
  )) {
11836
11864
  poorIndexedDbSupport = true;
11837
11865
  }