indexeddbshim 15.0.1 → 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 (37) hide show
  1. package/README.md +1 -1
  2. package/dist/indexeddbshim-Key.js +15 -14
  3. package/dist/indexeddbshim-Key.js.map +1 -1
  4. package/dist/indexeddbshim-Key.min.js +1 -1
  5. package/dist/indexeddbshim-Key.min.js.map +1 -1
  6. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +117 -107
  7. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
  8. package/dist/indexeddbshim-UnicodeIdentifiers.js +139 -121
  9. package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
  10. package/dist/indexeddbshim-UnicodeIdentifiers.min.js +2 -2
  11. package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
  12. package/dist/indexeddbshim-node.cjs +115 -105
  13. package/dist/indexeddbshim-node.cjs.map +1 -1
  14. package/dist/indexeddbshim-noninvasive.js +133 -115
  15. package/dist/indexeddbshim-noninvasive.js.map +1 -1
  16. package/dist/indexeddbshim-noninvasive.min.js +2 -2
  17. package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
  18. package/dist/indexeddbshim.js +119 -109
  19. package/dist/indexeddbshim.js.map +1 -1
  20. package/dist/indexeddbshim.min.js +2 -2
  21. package/dist/indexeddbshim.min.js.map +1 -1
  22. package/package.json +13 -29
  23. package/src/DOMException.js +5 -4
  24. package/src/DOMStringList.js +4 -3
  25. package/src/IDBCursor.js +4 -4
  26. package/src/IDBDatabase.js +2 -2
  27. package/src/IDBFactory.js +15 -12
  28. package/src/IDBIndex.js +7 -6
  29. package/src/IDBKeyRange.js +3 -3
  30. package/src/IDBObjectStore.js +10 -9
  31. package/src/IDBTransaction.js +5 -5
  32. package/src/IDBVersionChangeEvent.js +1 -1
  33. package/src/Key.js +1 -1
  34. package/src/Sca.js +0 -1
  35. package/src/UnicodeIdentifiers.js +2 -2
  36. package/src/setGlobalVars.js +5 -2
  37. package/src/util.js +2 -2
package/README.md CHANGED
@@ -588,7 +588,7 @@ example:
588
588
  ```js
589
589
  (function () {
590
590
  // This works on all browsers, and only uses IndexedDBShim as a final fallback
591
- var indexedDB = window.indexedDB || window.mozIndexedDB || // eslint-disable-line no-var
591
+ var indexedDB = window.indexedDB || window.mozIndexedDB || // eslint-disable-line no-var -- Older browsers
592
592
  window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB;
593
593
 
594
594
  // This code will use the native IndexedDB, if it exists, or the shim otherwise
@@ -1,4 +1,4 @@
1
- /*! indexeddbshim - v15.0.0 - 8/3/2024 */
1
+ /*! indexeddbshim - v15.0.1 - 9/5/2024 */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -305,7 +305,7 @@
305
305
  * @returns {void}
306
306
  */
307
307
  function (val) {
308
- 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)) {
308
+ 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)) {
309
309
  throw new TypeError('`memoryDatabase` must be the empty string, ":memory:", or a ' + '"file::memory:[?queryString][#hash] URL".');
310
310
  }
311
311
  }],
@@ -456,10 +456,10 @@
456
456
  function DOMException(message, name) {
457
457
  // const err = Error.prototype.constructor.call(this, message); // Any use to this? Won't set this.message
458
458
  this[Symbol.toStringTag] = 'DOMException';
459
- this._code = name in codes ? codes[( /** @type {Code} */name)] : legacyCodes[( /** @type {LegacyCode} */name)] || 0;
459
+ this._code = name in codes ? codes[(/** @type {Code} */name)] : legacyCodes[(/** @type {LegacyCode} */name)] || 0;
460
460
  this._name = name || 'Error';
461
461
  // We avoid `String()` in this next line as it converts Symbols
462
- this._message = message === undefined ? '' : '' + message; // eslint-disable-line no-implicit-coercion
462
+ this._message = message === undefined ? '' : '' + message; // eslint-disable-line no-implicit-coercion -- Don't convert symbols
463
463
  Object.defineProperty(this, 'code', {
464
464
  configurable: true,
465
465
  enumerable: true,
@@ -487,12 +487,12 @@
487
487
  // Necessary for W3C tests which complains if `DOMException` has properties on its "own" prototype
488
488
 
489
489
  // class DummyDOMException extends Error {}; // Sometimes causing problems in Node
490
- /* eslint-disable func-name-matching */
490
+ /* eslint-disable func-name-matching -- See above */
491
491
  /**
492
492
  * @class
493
493
  */
494
494
  var DummyDOMException = function DOMException() {/* */};
495
- /* eslint-enable func-name-matching */
495
+ /* eslint-enable func-name-matching -- See above */
496
496
  DummyDOMException.prototype = Object.create(Error.prototype); // Intended for subclassing
497
497
  /** @type {const} */
498
498
  ['name', 'message'].forEach(function (prop) {
@@ -593,7 +593,7 @@
593
593
  */
594
594
  function logError(name, message, error) {
595
595
  if (CFG.DEBUG) {
596
- var msg = error && _typeof(error) === 'object' && error.message ? error.message : ( /** @type {string} */error);
596
+ var msg = error && _typeof(error) === 'object' && error.message ? error.message : (/** @type {string} */error);
597
597
  var method = typeof console.error === 'function' ? 'error' : 'log';
598
598
  console[method](name + ': ' + message + '. ' + (msg || ''));
599
599
  if (console.trace) {
@@ -625,7 +625,8 @@
625
625
  // Native DOMException works as expected
626
626
  useNativeDOMException = true;
627
627
  }
628
- } catch (e) {}
628
+ // eslint-disable-next-line no-unused-vars -- Problem with commonJS rollup
629
+ } catch (err) {}
629
630
  var createDOMException = useNativeDOMException
630
631
  // eslint-disable-next-line @stylistic/operator-linebreak -- Need JSDoc
631
632
  ?
@@ -835,7 +836,7 @@
835
836
  };
836
837
  var keyTypes = /** @type {(KeyType|"invalid")[]} */Object.keys(keyTypeToEncodedChar);
837
838
  keyTypes.forEach(function (k) {
838
- keyTypeToEncodedChar[k] = String.fromCodePoint( /** @type {number} */keyTypeToEncodedChar[k]);
839
+ keyTypeToEncodedChar[k] = String.fromCodePoint(/** @type {number} */keyTypeToEncodedChar[k]);
839
840
  });
840
841
  var encodedCharToKeyType = keyTypes.reduce(function (o, k) {
841
842
  o[keyTypeToEncodedChar[k]] = k;
@@ -1224,7 +1225,7 @@
1224
1225
  return 'binary';
1225
1226
  }
1226
1227
  var keyType = _typeof(key);
1227
- return ['string', 'number'].includes(keyType) ? ( /** @type {"string"|"number"} */keyType) : 'invalid';
1228
+ return ['string', 'number'].includes(keyType) ? (/** @type {"string"|"number"} */keyType) : 'invalid';
1228
1229
  }
1229
1230
 
1230
1231
  /**
@@ -1332,7 +1333,7 @@
1332
1333
  // May throw (if detached)
1333
1334
  // Get a copy of the bytes held by the buffer source
1334
1335
  // https://heycam.github.io/webidl/#ref-for-dfn-get-buffer-source-copy-2
1335
- var octets = getCopyBytesHeldByBufferSource( /** @type {BufferSource} */input);
1336
+ var octets = getCopyBytesHeldByBufferSource(/** @type {BufferSource} */input);
1336
1337
  return {
1337
1338
  type: 'binary',
1338
1339
  value: octets
@@ -1569,7 +1570,7 @@
1569
1570
  value = /** @type {File} */value[idntfr];
1570
1571
  break;
1571
1572
  case 'lastModifiedDate':
1572
- value = new Date( /** @type {File} */value.lastModified);
1573
+ value = new Date(/** @type {File} */value.lastModified);
1573
1574
  break;
1574
1575
  }
1575
1576
  } else if (!isObj(value) || !Object.hasOwn(value, idntfr)) {
@@ -1603,7 +1604,7 @@
1603
1604
  }
1604
1605
  value = value[identifier];
1605
1606
  });
1606
- value[( /** @type {string} */last)] = key; // key is already a `keyValue` in our processing so no need to convert
1607
+ value[(/** @type {string} */last)] = key; // key is already a `keyValue` in our processing so no need to convert
1607
1608
  }
1608
1609
 
1609
1610
  /**
@@ -1900,7 +1901,7 @@
1900
1901
  getCurrentNumber(tx, store, function (key) {
1901
1902
  if (key > MAX_ALLOWED_CURRENT_NUMBER) {
1902
1903
  // 2 ^ 53 (See <https://github.com/w3c/IndexedDB/issues/147>)
1903
- cb('failure'); // eslint-disable-line n/no-callback-literal
1904
+ cb('failure');
1904
1905
  return;
1905
1906
  }
1906
1907
  // Increment current number by 1 (we cannot leverage SQLite's