indexeddbshim 13.0.0-pre.1 → 13.0.0

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/badges/licenses-badge-dev.svg +1 -1
  3. package/dist/indexeddbshim-Key.js +90 -82
  4. package/dist/indexeddbshim-Key.js.map +1 -1
  5. package/dist/indexeddbshim-Key.min.js +2 -2
  6. package/dist/indexeddbshim-Key.min.js.map +1 -1
  7. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +824 -487
  8. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
  9. package/dist/indexeddbshim-UnicodeIdentifiers.js +947 -774
  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 +824 -487
  14. package/dist/indexeddbshim-node.cjs.map +1 -1
  15. package/dist/indexeddbshim-noninvasive.js +947 -774
  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 +947 -774
  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/index.html +1 -1
  24. package/package.json +35 -34
  25. package/src/DOMException.js +3 -4
  26. package/src/DOMStringList.js +1 -1
  27. package/src/IDBCursor.js +19 -17
  28. package/src/IDBDatabase.js +1 -0
  29. package/src/IDBFactory.js +23 -16
  30. package/src/IDBIndex.js +17 -23
  31. package/src/IDBKeyRange.js +4 -4
  32. package/src/IDBObjectStore.js +29 -26
  33. package/src/IDBTransaction.js +7 -8
  34. package/src/Key.d.ts +1 -0
  35. package/src/Key.js +11 -12
  36. package/src/setGlobalVars.js +3 -1
  37. package/src/util.js +1 -0
@@ -1,4 +1,4 @@
1
- /*! indexeddbshim - v12.0.0-pre.0 - 6/7/2023 */
1
+ /*! indexeddbshim - v13.0.0 - 12/7/2023 */
2
2
 
3
3
  'use strict';
4
4
 
@@ -161,10 +161,9 @@ var ShimEvent = /** @type {unknown} */function Event(type) {
161
161
  pr;
162
162
  Object.defineProperty(_this, prop, {
163
163
  get: function get() {
164
- return (/* prop in _evCfg && */_evCfg[prop] !== undefined ? _evCfg[prop] : prop in _ev ? _ev[prop] :
165
- // Defaults
166
- prop === 'eventPhase' ? 0 : prop === 'defaultPrevented' ? false : null
167
- );
164
+ return /* prop in _evCfg && */_evCfg[prop] !== undefined ? _evCfg[prop] : prop in _ev ? _ev[prop] :
165
+ // Defaults
166
+ prop === 'eventPhase' ? 0 : prop === 'defaultPrevented' ? false : null;
168
167
  }
169
168
  });
170
169
  });
@@ -659,7 +658,6 @@ Object.assign(EventTarget.prototype, {
659
658
  }
660
659
  });
661
660
  }
662
-
663
661
  var _eventCopy = eventCopy,
664
662
  type = _eventCopy.type;
665
663
 
@@ -1174,6 +1172,8 @@ function getDefaultExportFromCjs$1(x) {
1174
1172
  var regex = /[\xC0-\xC5\xC7-\xCF\xD1-\xD6\xD9-\xDD\xE0-\xE5\xE7-\xEF\xF1-\xF6\xF9-\xFD\xFF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0\u01A1\u01AF\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01F0\u01F4\u01F5\u01F8-\u021B\u021E\u021F\u0226-\u0233\u0344\u0385\u0386\u0388-\u038A\u038C\u038E-\u0390\u03AA-\u03B0\u03CA-\u03CE\u03D3\u03D4\u0400\u0401\u0403\u0407\u040C-\u040E\u0419\u0439\u0450\u0451\u0453\u0457\u045C-\u045E\u0476\u0477\u04C1\u04C2\u04D0-\u04D3\u04D6\u04D7\u04DA-\u04DF\u04E2-\u04E7\u04EA-\u04F5\u04F8\u04F9\u0622-\u0626\u06C0\u06C2\u06D3\u0929\u0931\u0934\u0958-\u095F\u09CB\u09CC\u09DC\u09DD\u09DF\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B48\u0B4B\u0B4C\u0B5C\u0B5D\u0B94\u0BCA-\u0BCC\u0C48\u0CC0\u0CC7\u0CC8\u0CCA\u0CCB\u0D4A-\u0D4C\u0DDA\u0DDC-\u0DDE\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u0F73\u0F75\u0F76\u0F78\u0F81\u0F93\u0F9D\u0FA2\u0FA7\u0FAC\u0FB9\u1026\u1B06\u1B08\u1B0A\u1B0C\u1B0E\u1B12\u1B3B\u1B3D\u1B40\u1B41\u1B43\u1E00-\u1E99\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FC1-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEE\u1FF2-\u1FF4\u1FF6-\u1FFC\u212B\u219A\u219B\u21AE\u21CD-\u21CF\u2204\u2209\u220C\u2224\u2226\u2241\u2244\u2247\u2249\u2260\u2262\u226D-\u2271\u2274\u2275\u2278\u2279\u2280\u2281\u2284\u2285\u2288\u2289\u22AC-\u22AF\u22E0-\u22E3\u22EA-\u22ED\u2ADC\u304C\u304E\u3050\u3052\u3054\u3056\u3058\u305A\u305C\u305E\u3060\u3062\u3065\u3067\u3069\u3070\u3071\u3073\u3074\u3076\u3077\u3079\u307A\u307C\u307D\u3094\u309E\u30AC\u30AE\u30B0\u30B2\u30B4\u30B6\u30B8\u30BA\u30BC\u30BE\u30C0\u30C2\u30C5\u30C7\u30C9\u30D0\u30D1\u30D3\u30D4\u30D6\u30D7\u30D9\u30DA\u30DC\u30DD\u30F4\u30F7-\u30FA\u30FE\uAC00-\uD7A3\uFB1D\uFB1F\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4E]|\uD804[\uDC9A\uDC9C\uDCAB\uDD2E\uDD2F\uDF4B\uDF4C]|\uD805[\uDCBB\uDCBC\uDCBE\uDDBA\uDDBB]|\uD806\uDD38|\uD834[\uDD5E-\uDD64\uDDBB-\uDDC0]/;
1175
1173
  var regex$1 = /*@__PURE__*/getDefaultExportFromCjs$1(regex);
1176
1174
 
1175
+ /* eslint-disable new-cap -- ToString is how it is defined */
1176
+
1177
1177
  /**
1178
1178
  * @typedef {number} Integer
1179
1179
  */
@@ -1738,8 +1738,6 @@ Object.defineProperty(IDBVersionChangeEvent, 'prototype', {
1738
1738
  writable: false
1739
1739
  });
1740
1740
 
1741
- /* globals DOMException */
1742
-
1743
1741
  /**
1744
1742
  * Creates a native DOMException, for browsers that support it.
1745
1743
  * @param {string} name
@@ -1853,7 +1851,7 @@ function createNonNativeDOMExceptionClass() {
1853
1851
  function DOMException(message, name) {
1854
1852
  // const err = Error.prototype.constructor.call(this, message); // Any use to this? Won't set this.message
1855
1853
  this[Symbol.toStringTag] = 'DOMException';
1856
- this._code = name in codes ? codes[/** @type {Code} */name] : legacyCodes[/** @type {LegacyCode} */name] || 0;
1854
+ this._code = name in codes ? codes[( /** @type {Code} */name)] : legacyCodes[( /** @type {LegacyCode} */name)] || 0;
1857
1855
  this._name = name || 'Error';
1858
1856
  // We avoid `String()` in this next line as it converts Symbols
1859
1857
  this._message = message === undefined ? '' : '' + message; // eslint-disable-line no-implicit-coercion
@@ -1990,10 +1988,12 @@ function createNonNativeDOMException(name, message) {
1990
1988
  */
1991
1989
  function logError(name, message, error) {
1992
1990
  if (CFG.DEBUG) {
1993
- const msg = error && typeof error === 'object' && error.message ? error.message : /** @type {string} */error;
1991
+ const msg = error && typeof error === 'object' && error.message ? error.message : ( /** @type {string} */error);
1994
1992
  const method = typeof console.error === 'function' ? 'error' : 'log';
1995
1993
  console[method](name + ': ' + message + '. ' + (msg || ''));
1996
- console.trace && console.trace();
1994
+ if (console.trace) {
1995
+ console.trace();
1996
+ }
1997
1997
  }
1998
1998
  }
1999
1999
 
@@ -2092,7 +2092,7 @@ try {
2092
2092
  }
2093
2093
  } catch (e) {}
2094
2094
  const createDOMException = useNativeDOMException
2095
- // eslint-disable-next-line operator-linebreak -- Need JSDoc
2095
+ // eslint-disable-next-line @stylistic/operator-linebreak -- Need JSDoc
2096
2096
  ?
2097
2097
  /**
2098
2098
  * @param {string} name
@@ -2104,7 +2104,7 @@ function (name, message, error) {
2104
2104
  logError(name, message, error);
2105
2105
  return createNativeDOMException(name, message);
2106
2106
  }
2107
- // eslint-disable-next-line operator-linebreak -- Need JSDoc
2107
+ // eslint-disable-next-line @stylistic/operator-linebreak -- Need JSDoc
2108
2108
  :
2109
2109
  /**
2110
2110
  * @param {string} name
@@ -2163,7 +2163,6 @@ IDBRequest.__super = function IDBRequest() {
2163
2163
  this.__setOptions({
2164
2164
  legacyOutputDidListenersThrowFlag: true // Event hook for IndexedB
2165
2165
  });
2166
-
2167
2166
  doneFlagGetters.forEach(prop => {
2168
2167
  Object.defineProperty(this, '__' + prop, {
2169
2168
  enumerable: false,
@@ -2692,17 +2691,15 @@ const signValues = ['negativeInfinity', 'bigNegative', 'smallNegative', 'smallPo
2692
2691
  const types$2 = {
2693
2692
  invalid: {
2694
2693
  /**
2695
- * @param {AnyValue} _key
2696
2694
  * @returns {string}
2697
2695
  */
2698
- encode(_key) {
2696
+ encode() {
2699
2697
  return keyTypeToEncodedChar.invalid + '-';
2700
2698
  },
2701
2699
  /**
2702
- * @param {string} _key
2703
2700
  * @returns {undefined}
2704
2701
  */
2705
- decode(_key) {
2702
+ decode() {
2706
2703
  return undefined;
2707
2704
  }
2708
2705
  },
@@ -3015,11 +3012,17 @@ function negate(s) {
3015
3012
  * @returns {KeyType|"invalid"}
3016
3013
  */
3017
3014
  function getKeyType(key) {
3018
- if (Array.isArray(key)) return 'array';
3019
- if (isDate(key)) return 'date';
3020
- if (isBinary(key)) return 'binary';
3015
+ if (Array.isArray(key)) {
3016
+ return 'array';
3017
+ }
3018
+ if (isDate(key)) {
3019
+ return 'date';
3020
+ }
3021
+ if (isBinary(key)) {
3022
+ return 'binary';
3023
+ }
3021
3024
  const keyType = typeof key;
3022
- return ['string', 'number'].includes(keyType) ? /** @type {"string"|"number"} */keyType : 'invalid';
3025
+ return ['string', 'number'].includes(keyType) ? ( /** @type {"string"|"number"} */keyType) : 'invalid';
3023
3026
  }
3024
3027
 
3025
3028
  /**
@@ -3116,13 +3119,11 @@ function convertValueToKeyValueDecoded(input, seen, multiEntry, fullKeys) {
3116
3119
  value: 0
3117
3120
  };
3118
3121
  }
3119
- return (/** @type {{type: KeyType; value: Value}} */ret
3120
- );
3122
+ return /** @type {{type: KeyType; value: Value}} */ret;
3121
3123
  }
3122
3124
  case 'string':
3123
3125
  {
3124
- return (/** @type {{type: KeyType; value: Value}} */ret
3125
- );
3126
+ return /** @type {{type: KeyType; value: Value}} */ret;
3126
3127
  }
3127
3128
  case 'binary':
3128
3129
  {
@@ -3335,7 +3336,7 @@ function evaluateKeyPathOnValueToDecodedValue(value, keyPath, multiEntry, fullKe
3335
3336
  };
3336
3337
  }
3337
3338
  const identifiers = keyPath.split('.');
3338
- return identifiers.some((idntfr, i) => {
3339
+ return identifiers.some(idntfr => {
3339
3340
  if (idntfr === 'length' && (typeof value === 'string' || Array.isArray(value))) {
3340
3341
  value = value.length;
3341
3342
  } else if (isBlob(value)) {
@@ -3386,7 +3387,7 @@ function injectKeyIntoValueUsingKeyPath(value, key, keyPath) {
3386
3387
  }
3387
3388
  value = value[identifier];
3388
3389
  });
3389
- value[/** @type {string} */last] = key; // key is already a `keyValue` in our processing so no need to convert
3390
+ value[( /** @type {string} */last)] = key; // key is already a `keyValue` in our processing so no need to convert
3390
3391
  }
3391
3392
 
3392
3393
  /**
@@ -3542,6 +3543,7 @@ function encode$1(key, inArray) {
3542
3543
  return null;
3543
3544
  }
3544
3545
  // array, date, number, string, binary (should already have detected "invalid")
3546
+ // @ts-expect-error Argument may be ignored
3545
3547
  return types$2[getKeyType(key)].encode(key, inArray);
3546
3548
  }
3547
3549
 
@@ -3603,7 +3605,7 @@ function getCurrentNumber(tx, store, func, sqlFailCb) {
3603
3605
  }
3604
3606
  }, function (tx, error) {
3605
3607
  sqlFailCb(createDOMException('DataError', 'Could not get the auto increment value for key', error));
3606
- return true;
3608
+ return false;
3607
3609
  });
3608
3610
  }
3609
3611
 
@@ -3619,12 +3621,14 @@ function getCurrentNumber(tx, store, func, sqlFailCb) {
3619
3621
  function assignCurrentNumber(tx, store, num, successCb, failCb) {
3620
3622
  const sql = 'UPDATE __sys__ SET "currNum" = ? WHERE "name" = ?';
3621
3623
  const sqlValues = [num, escapeSQLiteStatement(store.__currentName)];
3622
- CFG.DEBUG && console.log(sql, sqlValues);
3623
- tx.executeSql(sql, sqlValues, function (tx, data) {
3624
+ if (CFG.DEBUG) {
3625
+ console.log(sql, sqlValues);
3626
+ }
3627
+ tx.executeSql(sql, sqlValues, function () {
3624
3628
  successCb(num);
3625
3629
  }, function (tx, err) {
3626
3630
  failCb(createDOMException('UnknownError', 'Could not set the auto increment value for key', err));
3627
- return true;
3631
+ return false;
3628
3632
  });
3629
3633
  }
3630
3634
 
@@ -3791,7 +3795,7 @@ IDBKeyRange.__createInstance = function (lower, upper, lowerOpen, upperOpen) {
3791
3795
  convertValueToKeyRethrowingAndIfInvalid(upper);
3792
3796
  }
3793
3797
  if (lower !== undefined && upper !== undefined && lower !== upper) {
3794
- if ( /** @type {string} */encode$1(lower) > /** @type {string} */encode$1(upper)) {
3798
+ if ( /** @type {string} */encode$1(lower) > ( /** @type {string} */encode$1(upper))) {
3795
3799
  throw createDOMException('DataError', '`lower` must not be greater than `upper` argument in `bound()` call.');
3796
3800
  }
3797
3801
  }
@@ -3838,7 +3842,7 @@ IDBKeyRange.only = function (value) {
3838
3842
  * @param {import('./Key.js').Value} value
3839
3843
  * @returns {globalThis.IDBKeyRange}
3840
3844
  */
3841
- IDBKeyRange.lowerBound = function (value /*, open */) {
3845
+ IDBKeyRange.lowerBound = function (value /* , open */) {
3842
3846
  if (!arguments.length) {
3843
3847
  throw new TypeError('IDBKeyRange.lowerBound requires a value argument');
3844
3848
  }
@@ -3850,7 +3854,7 @@ IDBKeyRange.lowerBound = function (value /*, open */) {
3850
3854
  * @param {import('./Key.js').Value} value
3851
3855
  * @returns {globalThis.IDBKeyRange}
3852
3856
  */
3853
- IDBKeyRange.upperBound = function (value /*, open */) {
3857
+ IDBKeyRange.upperBound = function (value /* , open */) {
3854
3858
  if (!arguments.length) {
3855
3859
  throw new TypeError('IDBKeyRange.upperBound requires a value argument');
3856
3860
  }
@@ -3919,7 +3923,9 @@ Object.defineProperty(IDBKeyRange, 'prototype', {
3919
3923
  */
3920
3924
  function setSQLForKeyRange(range, quotedKeyColumnName, sql, sqlValues, addAnd, checkCached) {
3921
3925
  if (range && (range.lower !== undefined || range.upper !== undefined)) {
3922
- if (addAnd) sql.push('AND');
3926
+ if (addAnd) {
3927
+ sql.push('AND');
3928
+ }
3923
3929
  let encodedLowerKey, encodedUpperKey;
3924
3930
  const hasLower = range.lower !== undefined;
3925
3931
  const hasUpper = range.upper !== undefined;
@@ -3937,7 +3943,9 @@ function setSQLForKeyRange(range, quotedKeyColumnName, sql, sqlValues, addAnd, c
3937
3943
  }
3938
3944
  sql.push(quotedKeyColumnName, range.lowerOpen ? '>' : '>=', '?');
3939
3945
  }
3940
- hasLower && hasUpper && sql.push('AND');
3946
+ if (hasLower && hasUpper) {
3947
+ sql.push('AND');
3948
+ }
3941
3949
  if (hasUpper) {
3942
3950
  sql.push(quotedKeyColumnName, range.upperOpen ? '<' : '<=', '?');
3943
3951
  sqlValues.push(escapeSQLiteStatement( /** @type {string} */encodedUpperKey));
@@ -3965,7 +3973,6 @@ function convertValueToKeyRange(value, nullDisallowed) {
3965
3973
  }
3966
3974
  return undefined; // Represents unbounded
3967
3975
  }
3968
-
3969
3976
  convertValueToKeyRethrowingAndIfInvalid(value);
3970
3977
  return IDBKeyRange.only(value);
3971
3978
  }
@@ -4184,8 +4191,7 @@ Object.defineProperty(DOMStringList, '__createInstance', {
4184
4191
  this._length = 0;
4185
4192
  };
4186
4193
  DOMStringList.prototype = DOMStringListAlias.prototype;
4187
- return (/** @type {DOMStringListFull} */new DOMStringList()
4188
- );
4194
+ return /** @type {DOMStringListFull} */new DOMStringList();
4189
4195
  }
4190
4196
  });
4191
4197
  if (cleanInterface) {
@@ -4331,7 +4337,6 @@ IDBTransaction.__createInstance = function (db, storeNames, mode) {
4331
4337
  me.__setOptions({
4332
4338
  legacyOutputDidListenersThrowFlag: true // Event hook for IndexedB
4333
4339
  });
4334
-
4335
4340
  readonlyProperties$3.forEach(readonlyProp => {
4336
4341
  Object.defineProperty(this, readonlyProp, {
4337
4342
  configurable: true
@@ -4353,6 +4358,7 @@ IDBTransaction.__createInstance = function (db, storeNames, mode) {
4353
4358
 
4354
4359
  // @ts-expect-error It's ok
4355
4360
  IDBTransaction.prototype = EventTargetFactory.createInstance({
4361
+ // eslint-disable-next-line n/no-sync -- API
4356
4362
  defaultSync: true,
4357
4363
  // Ensure EventTarget preserves our properties
4358
4364
  extraProperties: ['complete']
@@ -4374,7 +4380,9 @@ IDBTransaction.prototype.__transFinishedCb = function (err, cb) {
4374
4380
  IDBTransaction.prototype.__executeRequests = function () {
4375
4381
  const me = this;
4376
4382
  if (me.__running) {
4377
- CFG.DEBUG && console.log('Looks like the request set is already running', me.mode);
4383
+ if (CFG.DEBUG) {
4384
+ console.log('Looks like the request set is already running', me.mode);
4385
+ }
4378
4386
  return;
4379
4387
  }
4380
4388
  me.__running = true;
@@ -4403,7 +4411,6 @@ IDBTransaction.prototype.__executeRequests = function () {
4403
4411
  if (req) {
4404
4412
  q.req = req; // Need to do this in case of cursors
4405
4413
  }
4406
-
4407
4414
  if (!q.req) {
4408
4415
  // TS guard
4409
4416
  return;
@@ -4564,7 +4571,9 @@ IDBTransaction.prototype.__executeRequests = function () {
4564
4571
  */
4565
4572
  function complete() {
4566
4573
  me.__completed = true;
4567
- CFG.DEBUG && console.log('Transaction completed');
4574
+ if (CFG.DEBUG) {
4575
+ console.log('Transaction completed');
4576
+ }
4568
4577
  const evt = createEvent('complete');
4569
4578
  try {
4570
4579
  me.__internal = true;
@@ -4789,11 +4798,15 @@ IDBTransaction.prototype.__abortTransaction = function (err) {
4789
4798
  */
4790
4799
  function abort(tx, errOrResult) {
4791
4800
  if (!tx) {
4792
- CFG.DEBUG && console.log('Rollback not possible due to missing transaction', me);
4801
+ if (CFG.DEBUG) {
4802
+ console.log('Rollback not possible due to missing transaction', me);
4803
+ }
4793
4804
  } else if (errOrResult && 'code' in errOrResult && typeof errOrResult.code === 'number') {
4794
- CFG.DEBUG && console.log('Rollback erred; feature is probably not supported as per WebSQL', me);
4795
- } else {
4796
- CFG.DEBUG && console.log('Rollback succeeded', me);
4805
+ if (CFG.DEBUG) {
4806
+ console.log('Rollback erred; feature is probably not supported as per WebSQL', me);
4807
+ }
4808
+ } else if (CFG.DEBUG) {
4809
+ console.log('Rollback succeeded', me);
4797
4810
  }
4798
4811
  me.dispatchEvent(createEvent('__preabort'));
4799
4812
  me.__requests.filter(function (q, i, arr) {
@@ -4883,7 +4896,9 @@ IDBTransaction.prototype.abort = function () {
4883
4896
  if (!(me instanceof IDBTransaction)) {
4884
4897
  throw new TypeError('Illegal invocation');
4885
4898
  }
4886
- CFG.DEBUG && console.log('The transaction was aborted', me);
4899
+ if (CFG.DEBUG) {
4900
+ console.log('The transaction was aborted', me);
4901
+ }
4887
4902
  IDBTransaction.__assertNotFinished(me);
4888
4903
  me.__abortTransaction(null);
4889
4904
  };
@@ -5029,24 +5044,24 @@ function _slicedToArray(e, t) {
5029
5044
  var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
5030
5045
  if (null != r) {
5031
5046
  var n,
5032
- o,
5033
5047
  a,
5048
+ o,
5034
5049
  i,
5035
5050
  c = [],
5036
5051
  s = !0,
5037
5052
  u = !1;
5038
5053
  try {
5039
- if (a = (r = r.call(e)).next, 0 === t) {
5054
+ if (o = (r = r.call(e)).next, 0 === t) {
5040
5055
  if (Object(r) !== r) return;
5041
5056
  s = !1;
5042
- } else for (; !(s = (n = a.call(r)).done) && (c.push(n.value), c.length !== t); s = !0);
5057
+ } else for (; !(s = (n = o.call(r)).done) && (c.push(n.value), c.length !== t); s = !0);
5043
5058
  } catch (e) {
5044
- u = !0, o = e;
5059
+ u = !0, a = e;
5045
5060
  } finally {
5046
5061
  try {
5047
5062
  if (!s && null != r.return && (i = r.return(), Object(i) !== i)) return;
5048
5063
  } finally {
5049
- if (u) throw o;
5064
+ if (u) throw a;
5050
5065
  }
5051
5066
  }
5052
5067
  return c;
@@ -5089,12 +5104,12 @@ e.__typeson__type__ = "TypesonPromise", "undefined" != typeof Symbol && Object.d
5089
5104
  }
5090
5105
  }), e.prototype.then = function (t, r) {
5091
5106
  var n = this;
5092
- return new e(function (e, o) {
5107
+ return new e(function (e, a) {
5093
5108
  n.p.then(function (r) {
5094
5109
  e(t ? t(r) : r);
5095
5110
  }).catch(function (e) {
5096
5111
  return r ? r(e) : Promise.reject(e);
5097
- }).then(e, o);
5112
+ }).then(e, a);
5098
5113
  });
5099
5114
  }, e.prototype.catch = function (e) {
5100
5115
  return this.then(function () {}, e);
@@ -5135,10 +5150,10 @@ function toStringTag(e) {
5135
5150
  }
5136
5151
  function hasConstructorOf(e, n) {
5137
5152
  if (!e || "object" !== _typeof(e)) return !1;
5138
- var o = r(e);
5139
- if (!o) return null === n;
5140
- var a = t(o, "constructor") && o.constructor;
5141
- return "function" != typeof a ? null === n : n === a || null !== n && Function.prototype.toString.call(a) === Function.prototype.toString.call(n) || "function" == typeof n && "string" == typeof a.__typeson__type__ && a.__typeson__type__ === n.__typeson__type__;
5153
+ var a = r(e);
5154
+ if (!a) return null === n;
5155
+ var o = t(a, "constructor") && a.constructor;
5156
+ return "function" != typeof o ? null === n : n === o || null !== n && Function.prototype.toString.call(o) === Function.prototype.toString.call(n) || "function" == typeof n && "string" == typeof o.__typeson__type__ && o.__typeson__type__ === n.__typeson__type__;
5142
5157
  }
5143
5158
  function isPlainObject(e) {
5144
5159
  return !(!e || "Object" !== toStringTag(e)) && (!r(e) || hasConstructorOf(e, Object));
@@ -5152,10 +5167,10 @@ function isObject(e) {
5152
5167
  return null !== e && "object" === _typeof(e);
5153
5168
  }
5154
5169
  function escapeKeyPathComponent(e) {
5155
- return e.replace(/''/g, "''''").replace(/^$/, "''").replace(/~/g, "~0").replace(/\./g, "~1");
5170
+ return e.replaceAll("''", "''''").replace(/^$/, "''").replaceAll("~", "~0").replaceAll(".", "~1");
5156
5171
  }
5157
5172
  function unescapeKeyPathComponent(e) {
5158
- return e.replace(/~1/g, ".").replace(/~0/g, "~").replace(/^''$/, "").replace(/''''/g, "''");
5173
+ return e.replaceAll("~1", ".").replaceAll("~0", "~").replace(/^''$/, "").replaceAll("''''", "''");
5159
5174
  }
5160
5175
  function getByKeyPath(e, t) {
5161
5176
  if ("" === t) return e;
@@ -5180,8 +5195,8 @@ function _await(e, t, r) {
5180
5195
  return r ? t ? t(e) : e : (e && e.then || (e = Promise.resolve(e)), t ? e.then(t) : e);
5181
5196
  }
5182
5197
  var n = Object.keys,
5183
- o = Object.hasOwn,
5184
- a = Array.isArray,
5198
+ a = Object.hasOwn,
5199
+ o = Array.isArray,
5185
5200
  i$1 = ["type", "replaced", "iterateIn", "iterateUnsetNumeric", "addLength"];
5186
5201
  function _async(e) {
5187
5202
  return function () {
@@ -5196,9 +5211,9 @@ function _async(e) {
5196
5211
  function nestedPathsFirst(e, t) {
5197
5212
  var r, n;
5198
5213
  if ("" === e.keypath) return -1;
5199
- var o = null !== (r = e.keypath.match(/\./g)) && void 0 !== r ? r : 0,
5200
- a = null !== (n = t.keypath.match(/\./g)) && void 0 !== n ? n : 0;
5201
- return o && (o = o.length), a && (a = a.length), o > a ? -1 : o < a ? 1 : e.keypath < t.keypath ? -1 : e.keypath > t.keypath ? 1 : 0;
5214
+ var a = null !== (r = e.keypath.match(/\./g)) && void 0 !== r ? r : 0,
5215
+ o = null !== (n = t.keypath.match(/\./g)) && void 0 !== n ? n : 0;
5216
+ return a && (a = a.length), o && (o = o.length), a > o ? -1 : a < o ? 1 : e.keypath < t.keypath ? -1 : e.keypath > t.keypath ? 1 : 0;
5202
5217
  }
5203
5218
  var c = function () {
5204
5219
  function Typeson(e) {
@@ -5210,8 +5225,8 @@ var c = function () {
5210
5225
  n = _objectSpread2(_objectSpread2(_objectSpread2({}, this.options), n), {}, {
5211
5226
  stringification: !0
5212
5227
  });
5213
- var o = this.encapsulate(e, null, n);
5214
- return a(o) ? JSON.stringify(o[0], t, r) : o.then(function (e) {
5228
+ var a = this.encapsulate(e, null, n);
5229
+ return o(a) ? JSON.stringify(a[0], t, r) : a.then(function (e) {
5215
5230
  return JSON.stringify(e, t, r);
5216
5231
  });
5217
5232
  }
@@ -5284,7 +5299,7 @@ var c = function () {
5284
5299
  d = [],
5285
5300
  v = !("cyclic" in u) || u.cyclic,
5286
5301
  b = u.encapsulateObserver,
5287
- h = function finish(e) {
5302
+ m = function finish(e) {
5288
5303
  var t = Object.values(f);
5289
5304
  if (u.iterateNone) return t.length ? t[0] : getJSONType(e);
5290
5305
  if (t.length) {
@@ -5297,25 +5312,25 @@ var c = function () {
5297
5312
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5298
5313
  }();
5299
5314
  }(new Set(t));
5300
- e && isPlainObject(e) && !o(e, "$types") ? e.$types = f : e = {
5315
+ e && isPlainObject(e) && !a(e, "$types") ? e.$types = f : e = {
5301
5316
  $: e,
5302
5317
  $types: {
5303
5318
  $: f
5304
5319
  }
5305
5320
  };
5306
- } else isObject(e) && o(e, "$types") && (e = {
5321
+ } else isObject(e) && a(e, "$types") && (e = {
5307
5322
  $: e,
5308
5323
  $types: !0
5309
5324
  });
5310
5325
  return !u.returnTypeNames && e;
5311
5326
  },
5312
- g = _async(function (t, r) {
5327
+ h = _async(function (t, r) {
5313
5328
  return _await(Promise.all(r.map(function (e) {
5314
5329
  return e[1].p;
5315
5330
  })), function (n) {
5316
5331
  return _await(Promise.all(n.map(_async(function (n) {
5317
- var o = !1,
5318
- a = [],
5332
+ var a = !1,
5333
+ o = [],
5319
5334
  i = _slicedToArray(r.splice(0, 1), 1),
5320
5335
  c = _slicedToArray(i[0], 7),
5321
5336
  s = c[0],
@@ -5324,7 +5339,7 @@ var c = function () {
5324
5339
  f = c[4],
5325
5340
  y = c[5],
5326
5341
  p = c[6],
5327
- d = _(s, n, u, l, a, !0, p),
5342
+ d = O(s, n, u, l, o, !0, p),
5328
5343
  v = hasConstructorOf(d, e);
5329
5344
  return function _invoke(e, t) {
5330
5345
  var r = e();
@@ -5332,18 +5347,18 @@ var c = function () {
5332
5347
  }(function () {
5333
5348
  if (s && v) return _await(d.p, function (e) {
5334
5349
  f[y] = e;
5335
- var r = g(t, a);
5336
- return o = !0, r;
5350
+ var r = h(t, o);
5351
+ return a = !0, r;
5337
5352
  });
5338
5353
  }, function (e) {
5339
- return o ? e : (s ? f[y] = d : t = v ? d.p : d, g(t, a));
5354
+ return a ? e : (s ? f[y] = d : t = v ? d.p : d, h(t, o));
5340
5355
  });
5341
5356
  }))), function () {
5342
5357
  return t;
5343
5358
  });
5344
5359
  });
5345
5360
  }),
5346
- m = function _adaptBuiltinStateObjectProperties(e, t, r) {
5361
+ g = function _adaptBuiltinStateObjectProperties(e, t, r) {
5347
5362
  Object.assign(e, t);
5348
5363
  var n = i$1.map(function (t) {
5349
5364
  var r = e[t];
@@ -5353,14 +5368,14 @@ var c = function () {
5353
5368
  e[t] = n[r];
5354
5369
  });
5355
5370
  },
5356
- _ = function _encapsulate(t, r, i, c, l, d, v) {
5357
- var h,
5358
- g = {},
5359
- _ = _typeof(r),
5371
+ O = function _encapsulate(t, r, i, c, l, d, v) {
5372
+ var m,
5373
+ h = {},
5374
+ O = _typeof(r),
5360
5375
  w = b ? function (n) {
5361
- var o,
5362
- a = null !== (o = null != v ? v : c.type) && void 0 !== o ? o : getJSONType(r);
5363
- b(Object.assign(null != n ? n : g, {
5376
+ var a,
5377
+ o = null !== (a = null != v ? v : c.type) && void 0 !== a ? a : getJSONType(r);
5378
+ b(Object.assign(null != n ? n : h, {
5364
5379
  keypath: t,
5365
5380
  value: r,
5366
5381
  cyclic: i,
@@ -5369,12 +5384,12 @@ var c = function () {
5369
5384
  resolvingTypesonPromise: d,
5370
5385
  awaitingTypesonPromise: hasConstructorOf(r, e)
5371
5386
  }, {
5372
- type: a
5387
+ type: o
5373
5388
  }));
5374
5389
  } : null;
5375
- if (["string", "boolean", "number", "undefined"].includes(_)) return void 0 === r || Number.isNaN(r) || r === Number.NEGATIVE_INFINITY || r === Number.POSITIVE_INFINITY || 0 === r ? (h = c.replaced ? r : O(t, r, c, l, !1, d, w)) !== r && (g = {
5376
- replaced: h
5377
- }) : h = r, w && w(), h;
5390
+ if (["string", "boolean", "number", "undefined"].includes(O)) return void 0 === r || Number.isNaN(r) || r === Number.NEGATIVE_INFINITY || r === Number.POSITIVE_INFINITY || 0 === r ? (m = c.replaced ? r : _(t, r, c, l, !1, d, w)) !== r && (h = {
5391
+ replaced: m
5392
+ }) : m = r, w && w(), m;
5378
5393
  if (null === r) return w && w(), r;
5379
5394
  if (i && !c.iterateIn && !c.iterateUnsetNumeric && r && "object" === _typeof(r)) {
5380
5395
  var A = y.indexOf(r);
@@ -5386,25 +5401,25 @@ var c = function () {
5386
5401
  var S,
5387
5402
  j,
5388
5403
  T = isPlainObject(r),
5389
- I = a(r),
5390
- N = (T || I) && (!s.plainObjectReplacers.length || c.replaced) || c.iterateIn ? r : O(t, r, c, l, T || I, null, w);
5391
- if (N !== r ? (h = N, g = {
5392
- replaced: N
5393
- }) : "" === t && hasConstructorOf(r, e) ? (l.push([t, r, i, c, void 0, void 0, c.type]), h = r) : I && "object" !== c.iterateIn || "array" === c.iterateIn ? (S = new Array(r.length), g = {
5404
+ N = o(r),
5405
+ I = (T || N) && (!s.plainObjectReplacers.length || c.replaced) || c.iterateIn ? r : _(t, r, c, l, T || N, null, w);
5406
+ if (I !== r ? (m = I, h = {
5407
+ replaced: I
5408
+ }) : "" === t && hasConstructorOf(r, e) ? (l.push([t, r, i, c, void 0, void 0, c.type]), m = r) : N && "object" !== c.iterateIn || "array" === c.iterateIn ? (S = new Array(r.length), h = {
5394
5409
  clone: S
5395
- }) : (["function", "symbol"].includes(_typeof(r)) || "toJSON" in r || hasConstructorOf(r, e) || hasConstructorOf(r, Promise) || hasConstructorOf(r, ArrayBuffer)) && !T && "object" !== c.iterateIn ? h = r : (S = {}, c.addLength && (S.length = r.length), g = {
5410
+ }) : (["function", "symbol"].includes(_typeof(r)) || "toJSON" in r || hasConstructorOf(r, e) || hasConstructorOf(r, Promise) || hasConstructorOf(r, ArrayBuffer)) && !T && "object" !== c.iterateIn ? m = r : (S = {}, c.addLength && (S.length = r.length), h = {
5396
5411
  clone: S
5397
- }), w && w(), u.iterateNone) return null !== (j = S) && void 0 !== j ? j : h;
5398
- if (!S) return h;
5412
+ }), w && w(), u.iterateNone) return null !== (j = S) && void 0 !== j ? j : m;
5413
+ if (!S) return m;
5399
5414
  if (c.iterateIn) {
5400
5415
  var P = function _loop(n) {
5401
- var a = {
5402
- ownKeys: o(r, n)
5416
+ var o = {
5417
+ ownKeys: a(r, n)
5403
5418
  };
5404
- m(c, a, function () {
5405
- var o = t + (t ? "." : "") + escapeKeyPathComponent(n),
5406
- a = _encapsulate(o, r[n], Boolean(i), c, l, d);
5407
- hasConstructorOf(a, e) ? l.push([o, a, Boolean(i), c, S, n, c.type]) : void 0 !== a && (S[n] = a);
5419
+ g(c, o, function () {
5420
+ var a = t + (t ? "." : "") + escapeKeyPathComponent(n),
5421
+ o = _encapsulate(a, r[n], Boolean(i), c, l, d);
5422
+ hasConstructorOf(o, e) ? l.push([a, o, Boolean(i), c, S, n, c.type]) : void 0 !== o && (S[n] = o);
5408
5423
  });
5409
5424
  };
5410
5425
  for (var E in r) P(E);
@@ -5413,29 +5428,29 @@ var c = function () {
5413
5428
  end: !0
5414
5429
  });
5415
5430
  } else n(r).forEach(function (n) {
5416
- var o = t + (t ? "." : "") + escapeKeyPathComponent(n);
5417
- m(c, {
5431
+ var a = t + (t ? "." : "") + escapeKeyPathComponent(n);
5432
+ g(c, {
5418
5433
  ownKeys: !0
5419
5434
  }, function () {
5420
- var t = _encapsulate(o, r[n], Boolean(i), c, l, d);
5421
- hasConstructorOf(t, e) ? l.push([o, t, Boolean(i), c, S, n, c.type]) : void 0 !== t && (S[n] = t);
5435
+ var t = _encapsulate(a, r[n], Boolean(i), c, l, d);
5436
+ hasConstructorOf(t, e) ? l.push([a, t, Boolean(i), c, S, n, c.type]) : void 0 !== t && (S[n] = t);
5422
5437
  });
5423
5438
  }), w && w({
5424
5439
  endIterateOwn: !0,
5425
5440
  end: !0
5426
5441
  });
5427
5442
  if (c.iterateUnsetNumeric) {
5428
- for (var C = r.length, x = function _loop2(n) {
5443
+ for (var x = r.length, C = function _loop2(n) {
5429
5444
  if (!(n in r)) {
5430
- var o = "".concat(t).concat(t ? "." : "").concat(n);
5431
- m(c, {
5445
+ var a = "".concat(t).concat(t ? "." : "").concat(n);
5446
+ g(c, {
5432
5447
  ownKeys: !1
5433
5448
  }, function () {
5434
- var t = _encapsulate(o, void 0, Boolean(i), c, l, d);
5435
- hasConstructorOf(t, e) ? l.push([o, t, Boolean(i), c, S, n, c.type]) : void 0 !== t && (S[n] = t);
5449
+ var t = _encapsulate(a, void 0, Boolean(i), c, l, d);
5450
+ hasConstructorOf(t, e) ? l.push([a, t, Boolean(i), c, S, n, c.type]) : void 0 !== t && (S[n] = t);
5436
5451
  });
5437
5452
  }
5438
- }, k = 0; k < C; k++) x(k);
5453
+ }, k = 0; k < x; k++) C(k);
5439
5454
  w && w({
5440
5455
  endIterateUnsetNumeric: !0,
5441
5456
  end: !0
@@ -5443,8 +5458,8 @@ var c = function () {
5443
5458
  }
5444
5459
  return S;
5445
5460
  },
5446
- O = function replace(e, t, r, n, o, a, i) {
5447
- for (var c = o ? s.plainObjectReplacers : s.nonplainObjectReplacers, u = c.length; u--;) {
5461
+ _ = function replace(e, t, r, n, a, o, i) {
5462
+ for (var c = a ? s.plainObjectReplacers : s.nonplainObjectReplacers, u = c.length; u--;) {
5448
5463
  var y = c[u];
5449
5464
  if (y.test(t, r)) {
5450
5465
  var p = y.type;
@@ -5457,7 +5472,7 @@ var c = function () {
5457
5472
  replaced: !0
5458
5473
  }), (l || !y.replaceAsync) && !y.replace) return i && i({
5459
5474
  typeDetected: !0
5460
- }), _(e, t, v && "readonly", r, n, a, p);
5475
+ }), O(e, t, v && "readonly", r, n, o, p);
5461
5476
  i && i({
5462
5477
  replacing: !0
5463
5478
  });
@@ -5466,17 +5481,17 @@ var c = function () {
5466
5481
  if (void 0 === y.replace) throw new TypeError("Missing replacer");
5467
5482
  b = y.replace(t, r);
5468
5483
  } else b = y.replaceAsync(t, r);
5469
- return _(e, b, v && "readonly", r, n, a, p);
5484
+ return O(e, b, v && "readonly", r, n, o, p);
5470
5485
  }
5471
5486
  }
5472
5487
  return t;
5473
5488
  },
5474
- w = _("", t, v, null != r ? r : {}, d);
5489
+ w = O("", t, v, null != r ? r : {}, d);
5475
5490
  if (d.length) return l && u.throwOnBadSyncType ? function () {
5476
5491
  throw new TypeError("Sync method requested but async result obtained");
5477
- }() : Promise.resolve(g(w, d)).then(h);
5492
+ }() : Promise.resolve(h(w, d)).then(m);
5478
5493
  if (!l && u.throwOnBadSyncType) throw new TypeError("Async method requested but sync result obtained");
5479
- return u.stringification && l ? [h(w)] : l ? h(w) : Promise.resolve(h(w));
5494
+ return u.stringification && l ? [m(w)] : l ? m(w) : Promise.resolve(m(w));
5480
5495
  }
5481
5496
  }, {
5482
5497
  key: "encapsulateSync",
@@ -5499,7 +5514,7 @@ var c = function () {
5499
5514
  }, {
5500
5515
  key: "revive",
5501
5516
  value: function revive(t, r) {
5502
- var o = this,
5517
+ var a = this,
5503
5518
  i = _objectSpread2(_objectSpread2({
5504
5519
  sync: !0
5505
5520
  }, this.options), r),
@@ -5519,7 +5534,7 @@ var c = function () {
5519
5534
  u.$ && isPlainObject(u.$) && (t = t.$, u = u.$, y = !1);
5520
5535
  var p = function executeReviver(e, t) {
5521
5536
  var r,
5522
- n = _slicedToArray(null !== (r = o.revivers[e]) && void 0 !== r ? r : [], 1)[0];
5537
+ n = _slicedToArray(null !== (r = a.revivers[e]) && void 0 !== r ? r : [], 1)[0];
5523
5538
  if (!n) throw new Error("Unregistered type: " + e);
5524
5539
  if (c && !("revive" in n)) return t;
5525
5540
  if (!c && n.reviveAsync) return n.reviveAsync(t, f);
@@ -5537,63 +5552,63 @@ var c = function () {
5537
5552
  if (Object.entries(u).forEach(function (e) {
5538
5553
  var t = _slicedToArray(e, 2),
5539
5554
  n = t[0],
5540
- a = t[1];
5541
- "#" !== a && [].concat(a).forEach(function (e) {
5555
+ o = t[1];
5556
+ "#" !== o && [].concat(o).forEach(function (e) {
5542
5557
  var t;
5543
- _slicedToArray(null !== (t = o.revivers[e]) && void 0 !== t ? t : [null, {}], 2)[1].plain && (r.push({
5558
+ _slicedToArray(null !== (t = a.revivers[e]) && void 0 !== t ? t : [null, {}], 2)[1].plain && (r.push({
5544
5559
  keypath: n,
5545
5560
  type: e
5546
5561
  }), delete u[n]);
5547
5562
  });
5548
5563
  }), r.length) return r.sort(nestedPathsFirst).reduce(function reducer(r, n) {
5549
- var o = n.keypath,
5550
- a = n.type;
5564
+ var a = n.keypath,
5565
+ o = n.type;
5551
5566
  if (isThenable(r)) return r.then(function (e) {
5552
5567
  return reducer(e, {
5553
- keypath: o,
5554
- type: a
5568
+ keypath: a,
5569
+ type: o
5555
5570
  });
5556
5571
  });
5557
- var i = getByKeyPath(t, o);
5558
- if (hasConstructorOf(i = p(a, i), e)) return i.then(function (e) {
5559
- var r = setAtKeyPath(t, o, e);
5572
+ var i = getByKeyPath(t, a);
5573
+ if (hasConstructorOf(i = p(o, i), e)) return i.then(function (e) {
5574
+ var r = setAtKeyPath(t, a, e);
5560
5575
  r === e && (t = r);
5561
5576
  });
5562
- var c = setAtKeyPath(t, o, i);
5577
+ var c = setAtKeyPath(t, a, i);
5563
5578
  c === i && (t = c);
5564
5579
  }, void 0);
5565
5580
  }();
5566
5581
  return hasConstructorOf(b, e) ? v = b.then(function () {
5567
5582
  return t;
5568
- }) : (v = function _revive(t, r, o, i, c) {
5583
+ }) : (v = function _revive(t, r, a, i, c) {
5569
5584
  if (!y || "$types" !== t) {
5570
5585
  var f = u[t],
5571
- v = a(r);
5586
+ v = o(r);
5572
5587
  if (v || isPlainObject(r)) {
5573
5588
  var b = v ? new Array(r.length) : {};
5574
5589
  for (n(r).forEach(function (n) {
5575
- var a = _revive(t + (t ? "." : "") + escapeKeyPathComponent(n), r[n], null != o ? o : b, b, n),
5590
+ var o = _revive(t + (t ? "." : "") + escapeKeyPathComponent(n), r[n], null != a ? a : b, b, n),
5576
5591
  i = function set(e) {
5577
5592
  return hasConstructorOf(e, s) ? b[n] = void 0 : void 0 !== e && (b[n] = e), e;
5578
5593
  };
5579
- hasConstructorOf(a, e) ? d.push(a.then(function (e) {
5594
+ hasConstructorOf(o, e) ? d.push(o.then(function (e) {
5580
5595
  return i(e);
5581
- })) : i(a);
5596
+ })) : i(o);
5582
5597
  }), r = b; l.length;) {
5583
- var h = _slicedToArray(l[0], 4),
5584
- g = h[0],
5585
- m = h[1],
5586
- _ = h[2],
5587
- O = h[3],
5588
- w = getByKeyPath(g, m);
5598
+ var m = _slicedToArray(l[0], 4),
5599
+ h = m[0],
5600
+ g = m[1],
5601
+ O = m[2],
5602
+ _ = m[3],
5603
+ w = getByKeyPath(h, g);
5589
5604
  if (void 0 === w) break;
5590
- _[O] = w, l.splice(0, 1);
5605
+ O[_] = w, l.splice(0, 1);
5591
5606
  }
5592
5607
  }
5593
5608
  if (!f) return r;
5594
5609
  if ("#" === f) {
5595
- var A = getByKeyPath(o, r.slice(1));
5596
- return void 0 === A && l.push([o, r.slice(1), i, c]), A;
5610
+ var A = getByKeyPath(a, r.slice(1));
5611
+ return void 0 === A && l.push([a, r.slice(1), i, c]), A;
5597
5612
  }
5598
5613
  return [].concat(f).reduce(function reducer(t, r) {
5599
5614
  if (hasConstructorOf(t, e)) return t.then(function (e) {
@@ -5635,9 +5650,9 @@ var c = function () {
5635
5650
  key: "register",
5636
5651
  value: function register(e, t) {
5637
5652
  var r = this,
5638
- o = null != t ? t : {},
5653
+ a = null != t ? t : {},
5639
5654
  i = function R(e) {
5640
- a(e) ? e.forEach(function (e) {
5655
+ o(e) ? e.forEach(function (e) {
5641
5656
  return R(e);
5642
5657
  }) : n(e).forEach(function (t) {
5643
5658
  var n;
@@ -5661,7 +5676,7 @@ var c = function () {
5661
5676
  return Object.assign(Object.create(l.prototype), e);
5662
5677
  }
5663
5678
  };
5664
- } else if (a(i)) {
5679
+ } else if (o(i)) {
5665
5680
  var f = _slicedToArray(i, 3);
5666
5681
  i = {
5667
5682
  test: f[0],
@@ -5675,7 +5690,7 @@ var c = function () {
5675
5690
  test: i.test.bind(i)
5676
5691
  };
5677
5692
  i.replace && (y.replace = i.replace.bind(i)), i.replaceAsync && (y.replaceAsync = i.replaceAsync.bind(i));
5678
- var p = "number" == typeof o.fallback ? o.fallback : o.fallback ? 0 : Number.POSITIVE_INFINITY;
5693
+ var p = "number" == typeof a.fallback ? a.fallback : a.fallback ? 0 : Number.POSITIVE_INFINITY;
5679
5694
  if (i.testPlainObjects ? r.plainObjectReplacers.splice(p, 0, y) : r.nonplainObjectReplacers.splice(p, 0, y), i.revive || i.reviveAsync) {
5680
5695
  var d = {};
5681
5696
  i.revive && (d.revive = i.revive.bind(i)), i.reviveAsync && (d.reviveAsync = i.reviveAsync.bind(i)), r.revivers[t] = [d, {
@@ -5699,20 +5714,20 @@ s.__typeson__type__ = "TypesonUndefined";
5699
5714
  for (var u = ["null", "boolean", "number", "string", "array", "object"], l = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", f = new Uint8Array(256), y = 0; y < 64; y++) f[l.codePointAt(y)] = y;
5700
5715
  var p = function encode(e, t, r) {
5701
5716
  null == r && (r = e.byteLength);
5702
- for (var n = new Uint8Array(e, t || 0, r), o = n.length, a = "", i = 0; i < o; i += 3) a += l[n[i] >> 2], a += l[(3 & n[i]) << 4 | n[i + 1] >> 4], a += l[(15 & n[i + 1]) << 2 | n[i + 2] >> 6], a += l[63 & n[i + 2]];
5703
- return o % 3 == 2 ? a = a.slice(0, -1) + "=" : o % 3 == 1 && (a = a.slice(0, -2) + "=="), a;
5717
+ for (var n = new Uint8Array(e, t || 0, r), a = n.length, o = "", i = 0; i < a; i += 3) o += l[n[i] >> 2], o += l[(3 & n[i]) << 4 | n[i + 1] >> 4], o += l[(15 & n[i + 1]) << 2 | n[i + 2] >> 6], o += l[63 & n[i + 2]];
5718
+ return a % 3 == 2 ? o = o.slice(0, -1) + "=" : a % 3 == 1 && (o = o.slice(0, -2) + "=="), o;
5704
5719
  },
5705
5720
  d = function decode(e) {
5706
5721
  var t = e.length;
5707
5722
  if (t % 4) throw new Error("Bad base64 length: not divisible by four");
5708
5723
  var r,
5709
5724
  n,
5710
- o,
5711
5725
  a,
5726
+ o,
5712
5727
  i = .75 * e.length,
5713
5728
  c = 0;
5714
5729
  "=" === e[e.length - 1] && (i--, "=" === e[e.length - 2] && i--);
5715
- for (var s = new ArrayBuffer(i), u = new Uint8Array(s), l = 0; l < t; l += 4) r = f[e.codePointAt(l)], n = f[e.codePointAt(l + 1)], o = f[e.codePointAt(l + 2)], a = f[e.codePointAt(l + 3)], u[c++] = r << 2 | n >> 4, u[c++] = (15 & n) << 4 | o >> 2, u[c++] = (3 & o) << 6 | 63 & a;
5730
+ for (var s = new ArrayBuffer(i), u = new Uint8Array(s), l = 0; l < t; l += 4) r = f[e.codePointAt(l)], n = f[e.codePointAt(l + 1)], a = f[e.codePointAt(l + 2)], o = f[e.codePointAt(l + 3)], u[c++] = r << 2 | n >> 4, u[c++] = (15 & n) << 4 | a >> 2, u[c++] = (3 & a) << 6 | 63 & o;
5716
5731
  return s;
5717
5732
  };
5718
5733
  const v = {
@@ -5739,7 +5754,7 @@ const v = {
5739
5754
  revive: e => new Object(BigInt(e))
5740
5755
  }
5741
5756
  },
5742
- h = {
5757
+ m = {
5743
5758
  bigint: {
5744
5759
  test: e => "bigint" == typeof e,
5745
5760
  replace: String,
@@ -5751,7 +5766,7 @@ function string2arraybuffer(e) {
5751
5766
  for (let r = 0; r < e.length; r++) t[r] = e.charCodeAt(r);
5752
5767
  return t.buffer;
5753
5768
  }
5754
- const g = {
5769
+ const h = {
5755
5770
  blob: {
5756
5771
  test: e => "Blob" === toStringTag(e),
5757
5772
  replace(e) {
@@ -5784,7 +5799,7 @@ const g = {
5784
5799
  })
5785
5800
  }
5786
5801
  };
5787
- const O = {
5802
+ const _ = {
5788
5803
  cryptokey: {
5789
5804
  test: e => "CryptoKey" === toStringTag(e) && e.extractable,
5790
5805
  replaceAsync: t => new e(async (e, r) => {
@@ -5819,9 +5834,9 @@ const O = {
5819
5834
  byteLength: r
5820
5835
  }, n) {
5821
5836
  n.buffers || (n.buffers = []);
5822
- const o = n.buffers.indexOf(e);
5823
- return o > -1 ? {
5824
- index: o,
5837
+ const a = n.buffers.indexOf(e);
5838
+ return a > -1 ? {
5839
+ index: a,
5825
5840
  byteOffset: t,
5826
5841
  byteLength: r
5827
5842
  } : (n.buffers.push(e), {
@@ -5835,11 +5850,11 @@ const O = {
5835
5850
  const {
5836
5851
  byteOffset: r,
5837
5852
  byteLength: n,
5838
- encoded: o,
5839
- index: a
5853
+ encoded: a,
5854
+ index: o
5840
5855
  } = e;
5841
5856
  let i;
5842
- return "index" in e ? i = t.buffers[a] : (i = d(o), t.buffers.push(i)), new DataView(i, r, n);
5857
+ return "index" in e ? i = t.buffers[o] : (i = d(a), t.buffers.push(i)), new DataView(i, r, n);
5843
5858
  }
5844
5859
  }
5845
5860
  },
@@ -5854,6 +5869,107 @@ const O = {
5854
5869
  }
5855
5870
  },
5856
5871
  S = {
5872
+ domexception: {
5873
+ test: e => "DOMException" === toStringTag(e),
5874
+ replace: e => ({
5875
+ name: e.name,
5876
+ message: e.message
5877
+ }),
5878
+ revive: ({
5879
+ message: e,
5880
+ name: t
5881
+ }) => new DOMException(e, t)
5882
+ }
5883
+ },
5884
+ j = {};
5885
+ function create$5(e) {
5886
+ j[e.name.toLowerCase()] = {
5887
+ test: t => toStringTag(t) === e.name,
5888
+ replace: e => e.is2D ? {
5889
+ a: e.a,
5890
+ b: e.b,
5891
+ c: e.c,
5892
+ d: e.d,
5893
+ e: e.e,
5894
+ f: e.f
5895
+ } : {
5896
+ m11: e.m11,
5897
+ m12: e.m12,
5898
+ m13: e.m13,
5899
+ m14: e.m14,
5900
+ m21: e.m21,
5901
+ m22: e.m22,
5902
+ m23: e.m23,
5903
+ m24: e.m24,
5904
+ m31: e.m31,
5905
+ m32: e.m32,
5906
+ m33: e.m33,
5907
+ m34: e.m34,
5908
+ m41: e.m41,
5909
+ m42: e.m42,
5910
+ m43: e.m43,
5911
+ m44: e.m44
5912
+ },
5913
+ revive: t => Object.hasOwn(t, "a") ? new e([t.a, t.b, t.c, t.d, t.e, t.f]) : new e([t.m11, t.m12, t.m13, t.m14, t.m21, t.m22, t.m23, t.m24, t.m31, t.m32, t.m33, t.m34, t.m41, t.m42, t.m43, t.m44])
5914
+ };
5915
+ }
5916
+ "undefined" != typeof DOMMatrix && create$5(DOMMatrix), "undefined" != typeof DOMMatrixReadOnly && create$5(DOMMatrixReadOnly);
5917
+ const T = {};
5918
+ function create$4(e) {
5919
+ T[e.name.toLowerCase()] = {
5920
+ test: t => toStringTag(t) === e.name,
5921
+ replace: e => ({
5922
+ x: e.x,
5923
+ y: e.y,
5924
+ z: e.z,
5925
+ w: e.w
5926
+ }),
5927
+ revive: ({
5928
+ x: t,
5929
+ y: r,
5930
+ z: n,
5931
+ w: a
5932
+ }) => new e(t, r, n, a)
5933
+ };
5934
+ }
5935
+ "undefined" != typeof DOMPoint && create$4(DOMPoint), "undefined" != typeof DOMPointReadOnly && create$4(DOMPointReadOnly);
5936
+ const N = {
5937
+ domquad: {
5938
+ test: e => "DOMQuad" === toStringTag(e),
5939
+ replace: e => ({
5940
+ p1: e.p1,
5941
+ p2: e.p2,
5942
+ p3: e.p3,
5943
+ p4: e.p4
5944
+ }),
5945
+ revive: ({
5946
+ p1: e,
5947
+ p2: t,
5948
+ p3: r,
5949
+ p4: n
5950
+ }) => new DOMQuad(e, t, r, n)
5951
+ }
5952
+ },
5953
+ I = {};
5954
+ function create$3(e) {
5955
+ I[e.name.toLowerCase()] = {
5956
+ test: t => toStringTag(t) === e.name,
5957
+ replace: e => ({
5958
+ x: e.x,
5959
+ y: e.y,
5960
+ width: e.width,
5961
+ height: e.height
5962
+ }),
5963
+ revive: ({
5964
+ x: t,
5965
+ y: r,
5966
+ width: n,
5967
+ height: a
5968
+ }) => new e(t, r, n, a)
5969
+ };
5970
+ }
5971
+ "undefined" != typeof DOMRect && create$3(DOMRect), "undefined" != typeof DOMRectReadOnly && create$3(DOMRectReadOnly);
5972
+ const P = {
5857
5973
  error: {
5858
5974
  test: e => "Error" === toStringTag(e),
5859
5975
  replace: ({
@@ -5861,16 +5977,16 @@ const O = {
5861
5977
  message: t,
5862
5978
  cause: r,
5863
5979
  stack: n,
5864
- fileName: o,
5865
- lineNumber: a,
5980
+ fileName: a,
5981
+ lineNumber: o,
5866
5982
  columnNumber: i
5867
5983
  }) => ({
5868
5984
  name: e,
5869
5985
  message: t,
5870
5986
  cause: r,
5871
5987
  stack: n,
5872
- fileName: o,
5873
- lineNumber: a,
5988
+ fileName: a,
5989
+ lineNumber: o,
5874
5990
  columnNumber: i
5875
5991
  }),
5876
5992
  revive(e) {
@@ -5879,17 +5995,17 @@ const O = {
5879
5995
  }
5880
5996
  }
5881
5997
  },
5882
- j = {};
5998
+ E = {};
5883
5999
  function create$2(e) {
5884
- j[e.name.toLowerCase()] = {
6000
+ E[e.name.toLowerCase()] = {
5885
6001
  test: t => hasConstructorOf(t, e),
5886
6002
  replace: ({
5887
6003
  name: e,
5888
6004
  message: t,
5889
6005
  cause: r,
5890
6006
  stack: n,
5891
- fileName: o,
5892
- lineNumber: a,
6007
+ fileName: a,
6008
+ lineNumber: o,
5893
6009
  columnNumber: i,
5894
6010
  errors: c
5895
6011
  }) => ({
@@ -5897,20 +6013,19 @@ function create$2(e) {
5897
6013
  message: t,
5898
6014
  cause: r,
5899
6015
  stack: n,
5900
- fileName: o,
5901
- lineNumber: a,
6016
+ fileName: a,
6017
+ lineNumber: o,
5902
6018
  columnNumber: i,
5903
6019
  errors: c
5904
6020
  }),
5905
6021
  revive(t) {
5906
- const r = "undefined" != typeof AggregateError && e === AggregateError,
5907
- n = r ? new e(t.errors, t.message) : new e(t.message);
5908
- return n.name = t.name, n.cause = t.cause, n.stack = t.stack, n.fileName = t.fileName, n.lineNumber = t.lineNumber, n.columnNumber = t.columnNumber, r && (n.errors = t.errors), n;
6022
+ const r = "undefined" != typeof AggregateError && e === AggregateError ? new e(t.errors, t.message) : new e(t.message);
6023
+ return r.name = t.name, r.cause = t.cause, r.stack = t.stack, r.fileName = t.fileName, r.lineNumber = t.lineNumber, r.columnNumber = t.columnNumber, r;
5909
6024
  }
5910
6025
  };
5911
6026
  }
5912
6027
  [TypeError, RangeError, SyntaxError, ReferenceError, EvalError, URIError].forEach(e => create$2(e)), "undefined" != typeof AggregateError && create$2(AggregateError), "function" == typeof InternalError && create$2(InternalError);
5913
- const T = {
6028
+ const x = {
5914
6029
  file: {
5915
6030
  test: e => "File" === toStringTag(e),
5916
6031
  replace(e) {
@@ -5947,8 +6062,8 @@ const T = {
5947
6062
  })
5948
6063
  }
5949
6064
  },
5950
- I = {
5951
- file: T.file,
6065
+ C = {
6066
+ file: x.file,
5952
6067
  filelist: {
5953
6068
  test: e => "FileList" === toStringTag(e),
5954
6069
  replace(e) {
@@ -5972,7 +6087,7 @@ const T = {
5972
6087
  }
5973
6088
  }
5974
6089
  },
5975
- N = {
6090
+ k = {
5976
6091
  imagebitmap: {
5977
6092
  test: e => "ImageBitmap" === toStringTag(e) || e && e.dataset && "ImageBitmap" === e.dataset.toStringTag,
5978
6093
  replace(e) {
@@ -5990,10 +6105,10 @@ const T = {
5990
6105
  reviveAsync(t) {
5991
6106
  const r = document.createElement("canvas"),
5992
6107
  n = r.getContext("2d"),
5993
- o = document.createElement("img");
5994
- return o.addEventListener("load", function () {
5995
- n.drawImage(o, 0, 0);
5996
- }), o.src = t, new e(async (e, t) => {
6108
+ a = document.createElement("img");
6109
+ return a.addEventListener("load", function () {
6110
+ n.drawImage(a, 0, 0);
6111
+ }), a.src = t, new e(async (e, t) => {
5997
6112
  try {
5998
6113
  e(await createImageBitmap(r));
5999
6114
  } catch (e) {
@@ -6003,7 +6118,7 @@ const T = {
6003
6118
  }
6004
6119
  }
6005
6120
  },
6006
- P = {
6121
+ B = {
6007
6122
  imagedata: {
6008
6123
  test: e => "ImageData" === toStringTag(e),
6009
6124
  replace: e => ({
@@ -6014,60 +6129,42 @@ const T = {
6014
6129
  revive: e => new ImageData(new Uint8ClampedArray(e.array), e.width, e.height)
6015
6130
  }
6016
6131
  },
6017
- E = {
6132
+ U = {
6018
6133
  infinity: {
6019
6134
  test: e => e === Number.POSITIVE_INFINITY,
6020
- replace: e => "Infinity",
6021
- revive: e => Number.POSITIVE_INFINITY
6135
+ replace: () => "Infinity",
6136
+ revive: () => Number.POSITIVE_INFINITY
6022
6137
  }
6023
6138
  },
6024
- C = {
6025
- test: e => hasConstructorOf(e, Intl.Collator),
6026
- replace: e => e.resolvedOptions(),
6027
- revive: e => new Intl.Collator(e.locale, e)
6028
- },
6029
- x = {
6030
- IntlCollator: C,
6031
- IntlDateTimeFormat: {
6032
- test: e => hasConstructorOf(e, Intl.DateTimeFormat),
6033
- replace: e => e.resolvedOptions(),
6034
- revive: e => new Intl.DateTimeFormat(e.locale, e)
6035
- },
6036
- IntlNumberFormat: {
6037
- test: e => hasConstructorOf(e, Intl.NumberFormat),
6038
- replace: e => e.resolvedOptions(),
6039
- revive: e => new Intl.NumberFormat(e.locale, e)
6040
- }
6041
- },
6042
- k = {
6139
+ K = {
6043
6140
  map: {
6044
6141
  test: e => "Map" === toStringTag(e),
6045
6142
  replace: e => [...e.entries()],
6046
6143
  revive: e => new Map(e)
6047
6144
  }
6048
6145
  },
6049
- B = {
6146
+ L = {
6050
6147
  nan: {
6051
6148
  test: e => Number.isNaN(e),
6052
- replace: e => "NaN",
6053
- revive: e => Number.NaN
6149
+ replace: () => "NaN",
6150
+ revive: () => Number.NaN
6054
6151
  }
6055
6152
  },
6056
- U = {
6153
+ F = {
6057
6154
  negativeInfinity: {
6058
6155
  test: e => e === Number.NEGATIVE_INFINITY,
6059
- replace: e => "-Infinity",
6060
- revive: e => Number.NEGATIVE_INFINITY
6156
+ replace: () => "-Infinity",
6157
+ revive: () => Number.NEGATIVE_INFINITY
6061
6158
  }
6062
6159
  },
6063
- K = {
6160
+ $ = {
6064
6161
  negativeZero: {
6065
6162
  test: e => Object.is(e, -0),
6066
- replace: e => 0,
6067
- revive: e => -0
6163
+ replace: () => 0,
6164
+ revive: () => -0
6068
6165
  }
6069
6166
  },
6070
- F = {
6167
+ V = {
6071
6168
  StringObject: {
6072
6169
  test: e => "String" === toStringTag(e) && "object" == typeof e,
6073
6170
  replace: String,
@@ -6084,7 +6181,7 @@ const T = {
6084
6181
  revive: e => new Number(e)
6085
6182
  }
6086
6183
  },
6087
- M = {
6184
+ q = {
6088
6185
  regexp: {
6089
6186
  test: e => "RegExp" === toStringTag(e),
6090
6187
  replace: e => ({
@@ -6097,26 +6194,26 @@ const T = {
6097
6194
  }) => new RegExp(e, t)
6098
6195
  }
6099
6196
  },
6100
- J = {
6197
+ G = {
6101
6198
  set: {
6102
6199
  test: e => "Set" === toStringTag(e),
6103
6200
  replace: e => [...e.values()],
6104
6201
  revive: e => new Set(e)
6105
6202
  }
6106
6203
  },
6107
- V = {};
6204
+ H = {};
6108
6205
  "function" == typeof Int8Array && [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, ...("function" == typeof BigInt64Array ? [BigInt64Array, BigUint64Array] : [])].forEach(e => function create$1(e) {
6109
6206
  const t = e.name;
6110
- V[t.toLowerCase()] = {
6207
+ H[t.toLowerCase()] = {
6111
6208
  test: e => toStringTag(e) === t,
6112
6209
  replace: e => (0 === e.byteOffset && e.byteLength === e.buffer.byteLength ? e : e.slice(0)).buffer,
6113
6210
  revive: t => "ArrayBuffer" === toStringTag(t) ? new e(t) : t
6114
6211
  };
6115
6212
  }(e));
6116
- const Y = {};
6213
+ const z = {};
6117
6214
  "function" == typeof Int8Array && [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, ...("function" == typeof BigInt64Array ? [BigInt64Array, BigUint64Array] : [])].forEach(e => function create(e) {
6118
6215
  const t = e.name;
6119
- Y[t.toLowerCase()] = {
6216
+ z[t.toLowerCase()] = {
6120
6217
  test: e => toStringTag(e) === t,
6121
6218
  replace({
6122
6219
  buffer: e,
@@ -6124,9 +6221,9 @@ const Y = {};
6124
6221
  length: r
6125
6222
  }, n) {
6126
6223
  n.buffers || (n.buffers = []);
6127
- const o = n.buffers.indexOf(e);
6128
- return o > -1 ? {
6129
- index: o,
6224
+ const a = n.buffers.indexOf(e);
6225
+ return a > -1 ? {
6226
+ index: a,
6130
6227
  byteOffset: t,
6131
6228
  length: r
6132
6229
  } : (n.buffers.push(e), {
@@ -6139,32 +6236,32 @@ const Y = {};
6139
6236
  r.buffers || (r.buffers = []);
6140
6237
  const {
6141
6238
  byteOffset: n,
6142
- length: o,
6143
- encoded: a,
6239
+ length: a,
6240
+ encoded: o,
6144
6241
  index: i
6145
6242
  } = t;
6146
6243
  let c;
6147
- return "index" in t ? c = r.buffers[i] : (c = d(a), r.buffers.push(c)), new e(c, n, o);
6244
+ return "index" in t ? c = r.buffers[i] : (c = d(o), r.buffers.push(c)), new e(c, n, a);
6148
6245
  }
6149
6246
  };
6150
6247
  }(e));
6151
- const q = {
6248
+ const Q = {
6152
6249
  undef: {
6153
6250
  test: (e, t) => void 0 === e && (t.ownKeys || !("ownKeys" in t)),
6154
- replace: e => 0,
6155
- revive: e => new s()
6251
+ replace: () => 0,
6252
+ revive: () => new s()
6156
6253
  }
6157
6254
  },
6158
- W = {
6255
+ X = {
6159
6256
  userObject: {
6160
- test: (e, t) => isUserObject(e),
6257
+ test: e => isUserObject(e),
6161
6258
  replace: e => ({
6162
6259
  ...e
6163
6260
  }),
6164
6261
  revive: e => e
6165
6262
  }
6166
6263
  },
6167
- G = [{
6264
+ Z = [{
6168
6265
  arrayNonindexKeys: {
6169
6266
  testPlainObjects: !0,
6170
6267
  test: (e, t) => !!Array.isArray(e) && (Object.keys(e).some(e => String(Number.parseInt(e)) !== e) && (t.iterateIn = "object", t.addLength = !0), !0),
@@ -6180,17 +6277,17 @@ const q = {
6180
6277
  }, {
6181
6278
  sparseUndefined: {
6182
6279
  test: (e, t) => void 0 === e && !1 === t.ownKeys,
6183
- replace: e => 0,
6184
- revive(e) {}
6280
+ replace: () => 0,
6281
+ revive() {}
6185
6282
  }
6186
6283
  }],
6187
- H = [B, E, U, K],
6188
- ee = [W, q, G, F, H, A, M, P, N, T, I, g, S, j].concat("function" == typeof Map ? k : [], "function" == typeof Set ? J : [], "function" == typeof ArrayBuffer ? v : [], "function" == typeof Uint8Array ? Y : [], "function" == typeof DataView ? w : [], "undefined" != typeof Intl ? x : [], "undefined" != typeof crypto ? O : [], "undefined" != typeof BigInt ? [h, b] : []),
6189
- te = ee.concat({
6284
+ ee = [L, U, F, $],
6285
+ oe = [X, Q, Z, V, ee, A, q, B, k, x, C, h, P, E].concat("function" == typeof Map ? K : [], "function" == typeof Set ? G : [], "function" == typeof ArrayBuffer ? v : [], "function" == typeof Uint8Array ? z : [], "function" == typeof DataView ? w : [], "undefined" != typeof crypto ? _ : [], "undefined" != typeof BigInt ? [m, b] : [], "undefined" != typeof DOMException ? S : [], "undefined" != typeof DOMRect ? I : [], "undefined" != typeof DOMPoint ? T : [], "undefined" != typeof DOMQuad ? N : [], "undefined" != typeof DOMMatrix ? j : []),
6286
+ ie = oe.concat({
6190
6287
  checkDataCloneException: {
6191
6288
  test(e) {
6192
6289
  const t = {}.toString.call(e).slice(8, -1);
6193
- if (["symbol", "function"].includes(typeof e) || ["Arguments", "Module", "Error", "Promise", "WeakMap", "WeakSet", "Event", "MessageChannel"].includes(t) || e && "object" == typeof e && "number" == typeof e.nodeType && "function" == typeof e.insertBefore) throw new DOMException("The object cannot be cloned.", "DataCloneError");
6290
+ if (["symbol", "function"].includes(typeof e) || ["Arguments", "Module", "Promise", "WeakMap", "WeakSet", "Event", "MessageChannel"].includes(t) || e && "object" == typeof e && "number" == typeof e.nodeType && "function" == typeof e.insertBefore) throw new DOMException("The object cannot be cloned.", "DataCloneError");
6194
6291
  return !1;
6195
6292
  }
6196
6293
  }
@@ -6198,7 +6295,7 @@ const q = {
6198
6295
 
6199
6296
  // See: http://stackoverflow.com/questions/42170826/categories-for-rejection-by-the-structured-cloning-algorithm
6200
6297
 
6201
- let typeson = new c().register(te);
6298
+ let typeson = new c().register(ie);
6202
6299
 
6203
6300
  /**
6204
6301
  * @param {(preset: import('typeson-registry').Preset) =>
@@ -6206,7 +6303,7 @@ let typeson = new c().register(te);
6206
6303
  * @returns {void}
6207
6304
  */
6208
6305
  function register(func) {
6209
- typeson = new c().register(func(te));
6306
+ typeson = new c().register(func(ie));
6210
6307
  }
6211
6308
 
6212
6309
  /**
@@ -6357,7 +6454,7 @@ IDBIndex.__createInstance = function (store, indexProperties) {
6357
6454
  * @returns {string}
6358
6455
  */
6359
6456
  get() {
6360
- return '__pendingName' in me ? /** @type {string} */me.__pendingName : me.name;
6457
+ return '__pendingName' in me ? ( /** @type {string} */me.__pendingName) : me.name;
6361
6458
  }
6362
6459
  });
6363
6460
  Object.defineProperty(me, 'name', {
@@ -6505,7 +6602,9 @@ IDBIndex.__createIndex = function (store, index) {
6505
6602
  IDBIndex.__updateIndexList(store, tx, function () {
6506
6603
  // Add index entries for all existing records
6507
6604
  tx.executeSql('SELECT "key", "value" FROM ' + escapeStoreNameForSQL(storeName), [], function (tx, data) {
6508
- CFG.DEBUG && console.log('Adding existing ' + storeName + ' records to the ' + indexName + ' index');
6605
+ if (CFG.DEBUG) {
6606
+ console.log('Adding existing ' + storeName + ' records to the ' + indexName + ' index');
6607
+ }
6509
6608
  addIndexEntry(0);
6510
6609
 
6511
6610
  /**
@@ -6531,7 +6630,7 @@ IDBIndex.__createIndex = function (store, index) {
6531
6630
  }
6532
6631
  indexValues[indexKeyStr] = true;
6533
6632
  }
6534
- tx.executeSql('UPDATE ' + escapeStoreNameForSQL(storeName) + ' SET ' + escapeIndexNameForSQL(indexName) + ' = ? WHERE "key" = ?', [escapeSQLiteStatement(indexKeyStr), data.rows.item(i).key], function (tx, data) {
6633
+ tx.executeSql('UPDATE ' + escapeStoreNameForSQL(storeName) + ' SET ' + escapeIndexNameForSQL(indexName) + ' = ? WHERE "key" = ?', [escapeSQLiteStatement(indexKeyStr), data.rows.item(i).key], function () {
6535
6634
  addIndexEntry(i + 1);
6536
6635
  }, /** @type {SQLStatementErrorCallback} */error);
6537
6636
  } catch (e) {
@@ -6580,7 +6679,9 @@ IDBIndex.__createIndex = function (store, index) {
6580
6679
  } else {
6581
6680
  // For a new index, add a new column to the object store, then apply the index
6582
6681
  const sql = ['ALTER TABLE', escapedStoreNameSQL, 'ADD', escapedIndexNameSQL, 'BLOB'].join(' ');
6583
- CFG.DEBUG && console.log(sql);
6682
+ if (CFG.DEBUG) {
6683
+ console.log(sql);
6684
+ }
6584
6685
  tx.executeSql(sql, [], addIndexSQL, /** @type {SQLStatementErrorCallback} */error);
6585
6686
  }
6586
6687
  });
@@ -6670,7 +6771,9 @@ IDBIndex.__updateIndexList = function (store, tx, success, failure) {
6670
6771
  deleted: Boolean(idx.__deleted)
6671
6772
  };
6672
6773
  }
6673
- CFG.DEBUG && console.log('Updating the index list for ' + store.__currentName, indexList);
6774
+ if (CFG.DEBUG) {
6775
+ console.log('Updating the index list for ' + store.__currentName, indexList);
6776
+ }
6674
6777
  tx.executeSql('UPDATE __sys__ SET "indexList" = ? WHERE "name" = ?', [JSON.stringify(indexList), escapeSQLiteStatement(store.__currentName)], function () {
6675
6778
  success(store);
6676
6779
  }, /** @type {SQLStatementErrorCallback} */failure);
@@ -6704,12 +6807,11 @@ IDBIndex.prototype.__fetchIndexData = function (range, opType, nullDisallowed, c
6704
6807
  throw createDOMException('DataError', 'No key or range was specified');
6705
6808
  }
6706
6809
  const fetchArgs = buildFetchIndexDataSQL(nullDisallowed, me, range, opType, false);
6707
- return (/** @type {import('./IDBTransaction.js').IDBTransactionFull} */me.objectStore.transaction.__addToTransactionQueue(function (...args) {
6708
- executeFetchIndexData(count, ...fetchArgs,
6709
- // @ts-expect-error It's ok
6710
- ...args);
6711
- }, undefined, me)
6712
- );
6810
+ return /** @type {import('./IDBTransaction.js').IDBTransactionFull} */me.objectStore.transaction.__addToTransactionQueue(function (...args) {
6811
+ executeFetchIndexData(count, ...fetchArgs,
6812
+ // @ts-expect-error It's ok
6813
+ ...args);
6814
+ }, undefined, me);
6713
6815
  };
6714
6816
 
6715
6817
  /**
@@ -6866,17 +6968,25 @@ IDBIndex.prototype.__renameIndex = function (store, oldName, newName, colInfoToP
6866
6968
  // We don't query for indexes as we already have the info
6867
6969
  // This approach has the advantage of auto-deleting indexes via the DROP TABLE
6868
6970
  const sql = 'CREATE TABLE ' + escapedTmpStoreNameSQL + '(' + listColInfoToPreserve + escapedNewIndexNameSQL + ' ' + newNameType + ')';
6869
- CFG.DEBUG && console.log(sql);
6971
+ if (CFG.DEBUG) {
6972
+ console.log(sql);
6973
+ }
6870
6974
  tx.executeSql(sql, [], function () {
6871
6975
  const sql = 'INSERT INTO ' + escapedTmpStoreNameSQL + '(' + listColsToPreserve + escapedNewIndexNameSQL + ') SELECT ' + listColsToPreserve + escapeIndexNameForSQL(oldName) + ' FROM ' + escapedStoreNameSQL;
6872
- CFG.DEBUG && console.log(sql);
6976
+ if (CFG.DEBUG) {
6977
+ console.log(sql);
6978
+ }
6873
6979
  tx.executeSql(sql, [], function () {
6874
6980
  const sql = 'DROP TABLE ' + escapedStoreNameSQL;
6875
- CFG.DEBUG && console.log(sql);
6981
+ if (CFG.DEBUG) {
6982
+ console.log(sql);
6983
+ }
6876
6984
  tx.executeSql(sql, [], function () {
6877
6985
  const sql = 'ALTER TABLE ' + escapedTmpStoreNameSQL + ' RENAME TO ' + escapedStoreNameSQL;
6878
- CFG.DEBUG && console.log(sql);
6879
- tx.executeSql(sql, [], function (tx, data) {
6986
+ if (CFG.DEBUG) {
6987
+ console.log(sql);
6988
+ }
6989
+ tx.executeSql(sql, [], function (tx) {
6880
6990
  if (!CFG.useSQLiteIndexes) {
6881
6991
  finish();
6882
6992
  return;
@@ -6885,39 +6995,38 @@ IDBIndex.prototype.__renameIndex = function (store, oldName, newName, colInfoToP
6885
6995
  .map(escapedIndexNameSQL => new SyncPromise(function (resolve, reject) {
6886
6996
  const escapedIndexToRecreate = sqlQuote(escapedStoreNameSQL.slice(1, -1) + '^5' + escapedIndexNameSQL.slice(1, -1));
6887
6997
  // const sql = 'DROP INDEX IF EXISTS ' + escapedIndexToRecreate;
6888
- // CFG.DEBUG && console.log(sql);
6998
+ // if (CFG.DEBUG) { console.log(sql); }
6889
6999
  // tx.executeSql(sql, [], function () {
6890
7000
  const sql = 'CREATE INDEX ' + escapedIndexToRecreate + ' ON ' + escapedStoreNameSQL + '(' + escapedIndexNameSQL + ')';
6891
- CFG.DEBUG && console.log(sql);
6892
- tx.executeSql(sql, [], resolve, /* eslint-disable no-extra-parens -- TS */
6893
- /** @type {SQLStatementErrorCallback} */
7001
+ if (CFG.DEBUG) {
7002
+ console.log(sql);
7003
+ }
7004
+ tx.executeSql(sql, [], resolve, /** @type {SQLStatementErrorCallback} */
6894
7005
  function (tx, err) {
6895
7006
  reject(err);
6896
- }
6897
- /* eslint-enable no-extra-parens -- TS */);
7007
+ });
6898
7008
  // }, function (tx, err) {
6899
7009
  // reject(err);
6900
7010
  // });
6901
7011
  }));
6902
-
6903
7012
  indexCreations.push(new SyncPromise(function (resolve, reject) {
6904
7013
  const escapedIndexToRecreate = sqlQuote('sk_' + escapedStoreNameSQL.slice(1, -1));
6905
7014
  // Chrome erring here if not dropped first; Node does not
6906
7015
  const sql = 'DROP INDEX IF EXISTS ' + escapedIndexToRecreate;
6907
- CFG.DEBUG && console.log(sql);
7016
+ if (CFG.DEBUG) {
7017
+ console.log(sql);
7018
+ }
6908
7019
  tx.executeSql(sql, [], function () {
6909
7020
  const sql = 'CREATE INDEX ' + escapedIndexToRecreate + ' ON ' + escapedStoreNameSQL + '("key")';
6910
- CFG.DEBUG && console.log(sql);
6911
- tx.executeSql(sql, [], resolve, /* eslint-disable no-extra-parens -- TS */
6912
- /** @type {SQLStatementErrorCallback} */
7021
+ if (CFG.DEBUG) {
7022
+ console.log(sql);
7023
+ }
7024
+ tx.executeSql(sql, [], resolve, /** @type {SQLStatementErrorCallback} */
6913
7025
  function (tx, err) {
6914
- /* eslint-enable no-extra-parens -- TS */
6915
7026
  reject(err);
6916
7027
  });
6917
- }, /* eslint-disable no-extra-parens -- TS */
6918
- /** @type {SQLStatementErrorCallback} */
7028
+ }, /** @type {SQLStatementErrorCallback} */
6919
7029
  function (tx, err) {
6920
- /* eslint-enable no-extra-parens -- TS */
6921
7030
  reject(err);
6922
7031
  });
6923
7032
  }));
@@ -6975,12 +7084,14 @@ function executeFetchIndexData(count, unboundedDisallowed, index, hasKey, range,
6975
7084
  sql.push('LIMIT', String(count));
6976
7085
  }
6977
7086
  const isCount = opType === 'count';
6978
- CFG.DEBUG && console.log('Trying to fetch data for Index', sql.join(' '), sqlValues);
7087
+ if (CFG.DEBUG) {
7088
+ console.log('Trying to fetch data for Index', sql.join(' '), sqlValues);
7089
+ }
6979
7090
  tx.executeSql(sql.join(' '), sqlValues, function (tx, data) {
6980
7091
  const records = [];
6981
7092
  let recordCount = 0;
6982
7093
  const decode$2 = isCount ? () => {/* */} : opType === 'key'
6983
- // eslint-disable-next-line operator-linebreak -- JSDoc
7094
+ // eslint-disable-next-line @stylistic/operator-linebreak -- JSDoc
6984
7095
  ?
6985
7096
  /**
6986
7097
  * @param {{
@@ -6992,7 +7103,7 @@ function executeFetchIndexData(count, unboundedDisallowed, index, hasKey, range,
6992
7103
  // Key.convertValueToKey(record.key); // Already validated before storage
6993
7104
  return decode$1(unescapeSQLiteResponse(record.key));
6994
7105
  }
6995
- // eslint-disable-next-line operator-linebreak -- JSDoc
7106
+ // eslint-disable-next-line @stylistic/operator-linebreak -- JSDoc
6996
7107
  :
6997
7108
  /**
6998
7109
  * @param {{
@@ -7084,7 +7195,9 @@ function buildFetchIndexDataSQL(nullDisallowed, index, range, opType, multiCheck
7084
7195
  sql.push('AND (');
7085
7196
  /** @type {import('./Key.js').KeyPathArray} */
7086
7197
  range.forEach((innerKey, i) => {
7087
- if (i > 0) sql.push('OR');
7198
+ if (i > 0) {
7199
+ sql.push('OR');
7200
+ }
7088
7201
  sql.push(escapeIndexNameForSQL(index.name), "LIKE ? ESCAPE '^' ");
7089
7202
  sqlValues.push('%' + sqlLIKEEscape( /** @type {string} */encode$1(innerKey, index.multiEntry)) + '%');
7090
7203
  });
@@ -7234,20 +7347,24 @@ IDBObjectStore.__createInstance = function (storeProperties, transaction) {
7234
7347
  me.__pendingName = oldName;
7235
7348
  const sql = 'UPDATE __sys__ SET "name" = ? WHERE "name" = ?';
7236
7349
  const sqlValues = [escapeSQLiteStatement(name), escapeSQLiteStatement(oldName)];
7237
- CFG.DEBUG && console.log(sql, sqlValues);
7350
+ if (CFG.DEBUG) {
7351
+ console.log(sql, sqlValues);
7352
+ }
7238
7353
  /** @type {import('./IDBTransaction.js').IDBTransactionFull} */
7239
7354
  me.transaction.__addNonRequestToTransactionQueue(function objectStoreClear(tx, args, success, error) {
7240
- tx.executeSql(sql, sqlValues, function (tx, data) {
7355
+ tx.executeSql(sql, sqlValues, function (tx) {
7241
7356
  // This SQL preserves indexes per https://www.sqlite.org/lang_altertable.html
7242
7357
  const sql = 'ALTER TABLE ' + escapeStoreNameForSQL(oldName) + ' RENAME TO ' + escapeStoreNameForSQL(name);
7243
- CFG.DEBUG && console.log(sql);
7244
- tx.executeSql(sql, [], function (tx, data) {
7358
+ if (CFG.DEBUG) {
7359
+ console.log(sql);
7360
+ }
7361
+ tx.executeSql(sql, [], function () {
7245
7362
  delete me.__pendingName;
7246
7363
  success();
7247
7364
  });
7248
7365
  }, function (tx, err) {
7249
7366
  error(err);
7250
- return true;
7367
+ return false;
7251
7368
  });
7252
7369
  });
7253
7370
  }
@@ -7326,15 +7443,19 @@ IDBObjectStore.__createObjectStore = function (db, store) {
7326
7443
  * @returns {boolean}
7327
7444
  */
7328
7445
  function error(tx, err) {
7329
- CFG.DEBUG && console.log(err);
7446
+ if (CFG.DEBUG) {
7447
+ console.log(err);
7448
+ }
7330
7449
  failure(createDOMException('UnknownError', 'Could not create object store "' + storeName + '"', err));
7331
- return true;
7450
+ return false;
7332
7451
  }
7333
7452
  const escapedStoreNameSQL = escapeStoreNameForSQL(storeName);
7334
7453
  // key INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE
7335
7454
  const sql = ['CREATE TABLE', escapedStoreNameSQL, '(key BLOB', store.autoIncrement ? 'UNIQUE, inc INTEGER PRIMARY KEY AUTOINCREMENT' : 'PRIMARY KEY', ', value BLOB)'].join(' ');
7336
- CFG.DEBUG && console.log(sql);
7337
- tx.executeSql(sql, [], function (tx, data) {
7455
+ if (CFG.DEBUG) {
7456
+ console.log(sql);
7457
+ }
7458
+ tx.executeSql(sql, [], function (tx) {
7338
7459
  /**
7339
7460
  * @returns {void}
7340
7461
  */
@@ -7388,9 +7509,11 @@ IDBObjectStore.__deleteObjectStore = function (db, store) {
7388
7509
  * @returns {boolean}
7389
7510
  */
7390
7511
  function error(tx, err) {
7391
- CFG.DEBUG && console.log(err);
7512
+ if (CFG.DEBUG) {
7513
+ console.log(err);
7514
+ }
7392
7515
  failure(createDOMException('UnknownError', 'Could not delete ObjectStore', err));
7393
- return true;
7516
+ return false;
7394
7517
  }
7395
7518
  tx.executeSql('SELECT "name" FROM __sys__ WHERE "name" = ?', [escapeSQLiteStatement(store.__currentName)], function (tx, data) {
7396
7519
  if (data.rows.length > 0) {
@@ -7507,6 +7630,7 @@ IDBObjectStore.prototype.__deriveKey = function (tx, value, key, success, failCb
7507
7630
  if (me.autoIncrement) {
7508
7631
  // If auto-increment and no valid primaryKey found on the keyPath, get and set the new value, and use
7509
7632
  if (key === undefined) {
7633
+ // @ts-expect-error Due to re-exporting `Key.d.ts` file (needed for `node_modules` imports)
7510
7634
  generateKeyForStore(tx, me, function (failure, key, oldCn) {
7511
7635
  if (failure) {
7512
7636
  failCb(createDOMException('ConstraintError', 'The key generator\'s current number has reached the maximum safe integer limit'));
@@ -7520,6 +7644,7 @@ IDBObjectStore.prototype.__deriveKey = function (tx, value, key, success, failCb
7520
7644
  success(key, oldCn);
7521
7645
  }, failCb);
7522
7646
  } else {
7647
+ // @ts-expect-error Due to re-exporting `Key.d.ts` file (needed for `node_modules` imports)
7523
7648
  possiblyUpdateKeyGenerator(tx, me, key, keyCloneThenSuccess, failCb);
7524
7649
  }
7525
7650
  // Not auto-increment
@@ -7639,13 +7764,15 @@ IDBObjectStore.prototype.__insertData = function (tx, encoded, value, clonedKeyO
7639
7764
  sqlEnd.push('?)');
7640
7765
  insertSqlValues.push(escapeSQLiteStatement(encoded));
7641
7766
  const insertSql = sqlStart.join(' ') + sqlEnd.join(' ');
7642
- CFG.DEBUG && console.log('SQL for adding', insertSql, insertSqlValues);
7643
- tx.executeSql(insertSql, insertSqlValues, function (tx, data) {
7767
+ if (CFG.DEBUG) {
7768
+ console.log('SQL for adding', insertSql, insertSqlValues);
7769
+ }
7770
+ tx.executeSql(insertSql, insertSqlValues, function () {
7644
7771
  success(clonedKeyOrCurrentNumber);
7645
7772
  }, function (tx, err) {
7646
7773
  // Should occur for `add` operation
7647
7774
  error(createDOMException('ConstraintError', /** @type {string} */err.message, err));
7648
- return true;
7775
+ return false;
7649
7776
  });
7650
7777
  return undefined;
7651
7778
  }).catch(function (err) {
@@ -7658,6 +7785,7 @@ IDBObjectStore.prototype.__insertData = function (tx, encoded, value, clonedKeyO
7658
7785
  error(err);
7659
7786
  }
7660
7787
  if (typeof oldCn === 'number') {
7788
+ // @ts-expect-error Due to re-exporting `Key.d.ts` file (needed for `node_modules` imports)
7661
7789
  assignCurrentNumber(tx, me, oldCn, fail, fail);
7662
7790
  return null;
7663
7791
  }
@@ -7699,7 +7827,7 @@ IDBObjectStore.prototype.add = function (value /* , key */) {
7699
7827
  * @this {IDBObjectStoreFull}
7700
7828
  * @returns {import('./IDBRequest.js').IDBRequestFull}
7701
7829
  */
7702
- IDBObjectStore.prototype.put = function (value /*, key */) {
7830
+ IDBObjectStore.prototype.put = function (value /* , key */) {
7703
7831
  const me = this;
7704
7832
  // eslint-disable-next-line prefer-rest-params
7705
7833
  const key = arguments[1];
@@ -7735,11 +7863,13 @@ IDBObjectStore.prototype.__overwrite = function (tx, key, cb, error) {
7735
7863
  const sql = 'DELETE FROM ' + escapeStoreNameForSQL(me.__currentName) + ' WHERE "key" = ?';
7736
7864
  const encodedKey = /** @type {string} */encode$1(key);
7737
7865
  tx.executeSql(sql, [escapeSQLiteStatement(encodedKey)], function (tx, data) {
7738
- CFG.DEBUG && console.log('Did the row with the', key, 'exist?', data.rowsAffected);
7866
+ if (CFG.DEBUG) {
7867
+ console.log('Did the row with the', key, 'exist?', data.rowsAffected);
7868
+ }
7739
7869
  cb(tx);
7740
7870
  }, function (tx, err) {
7741
7871
  error(err);
7742
- return true;
7872
+ return false;
7743
7873
  });
7744
7874
  };
7745
7875
 
@@ -7818,46 +7948,51 @@ IDBObjectStore.prototype.__get = function (query, getKey, getAll, count) {
7818
7948
  sql.push('LIMIT', String(count));
7819
7949
  }
7820
7950
  const sqlStr = sql.join(' ');
7821
- return (/** @type {import('./IDBTransaction.js').IDBTransactionFull} */me.transaction.__addToTransactionQueue(function objectStoreGet(tx, args, success, error) {
7822
- CFG.DEBUG && console.log('Fetching', me.__currentName, sqlValues);
7823
- tx.executeSql(sqlStr, sqlValues, function (tx, data) {
7824
- CFG.DEBUG && console.log('Fetched data', data);
7825
- let ret;
7826
- try {
7827
- // Opera can't deal with the try-catch here.
7828
- if (data.rows.length === 0) {
7829
- if (getAll) {
7830
- success([]);
7831
- } else {
7832
- success();
7833
- }
7834
- return;
7835
- }
7836
- ret = [];
7837
- if (getKey) {
7838
- for (let i = 0; i < data.rows.length; i++) {
7839
- // Key.convertValueToKey(data.rows.item(i).key); // Already validated before storage
7840
- ret.push(decode$1(unescapeSQLiteResponse(data.rows.item(i).key), false));
7841
- }
7951
+ return /** @type {import('./IDBTransaction.js').IDBTransactionFull} */me.transaction.__addToTransactionQueue(function objectStoreGet(tx, args, success, error) {
7952
+ if (CFG.DEBUG) {
7953
+ console.log('Fetching', me.__currentName, sqlValues);
7954
+ }
7955
+ tx.executeSql(sqlStr, sqlValues, function (tx, data) {
7956
+ if (CFG.DEBUG) {
7957
+ console.log('Fetched data', data);
7958
+ }
7959
+ let ret;
7960
+ try {
7961
+ // Opera can't deal with the try-catch here.
7962
+ if (data.rows.length === 0) {
7963
+ if (getAll) {
7964
+ success([]);
7842
7965
  } else {
7843
- for (let i = 0; i < data.rows.length; i++) {
7844
- ret.push(decode(unescapeSQLiteResponse(data.rows.item(i).value)));
7845
- }
7966
+ success();
7846
7967
  }
7847
- if (!getAll) {
7848
- ret = ret[0];
7968
+ return;
7969
+ }
7970
+ ret = [];
7971
+ if (getKey) {
7972
+ for (let i = 0; i < data.rows.length; i++) {
7973
+ // Key.convertValueToKey(data.rows.item(i).key); // Already validated before storage
7974
+ ret.push(decode$1(unescapeSQLiteResponse(data.rows.item(i).key), false));
7975
+ }
7976
+ } else {
7977
+ for (let i = 0; i < data.rows.length; i++) {
7978
+ ret.push(decode(unescapeSQLiteResponse(data.rows.item(i).value)));
7849
7979
  }
7850
- } catch (e) {
7851
- // If no result is returned, or error occurs when parsing JSON
7852
- CFG.DEBUG && console.log(e);
7853
7980
  }
7854
- success(ret);
7855
- }, function (tx, err) {
7856
- error(err);
7857
- return true;
7858
- });
7859
- }, undefined, me)
7860
- );
7981
+ if (!getAll) {
7982
+ ret = ret[0];
7983
+ }
7984
+ } catch (e) {
7985
+ // If no result is returned, or error occurs when parsing JSON
7986
+ if (CFG.DEBUG) {
7987
+ console.log(e);
7988
+ }
7989
+ }
7990
+ success(ret);
7991
+ }, function (tx, err) {
7992
+ error(err);
7993
+ return false;
7994
+ });
7995
+ }, undefined, me);
7861
7996
  };
7862
7997
 
7863
7998
  /**
@@ -7934,21 +8069,23 @@ IDBObjectStore.prototype.delete = function (query) {
7934
8069
  const sqlValues = [];
7935
8070
  setSQLForKeyRange(range, sqlQuote('key'), sqlArr, sqlValues);
7936
8071
  const sql = sqlArr.join(' ');
7937
- return (/** @type {import('./IDBTransaction.js').IDBTransactionFull} */me.transaction.__addToTransactionQueue(function objectStoreDelete(tx, args, success, error) {
7938
- CFG.DEBUG && console.log('Deleting', me.__currentName, sqlValues);
7939
- tx.executeSql(sql, sqlValues, function (tx, data) {
7940
- CFG.DEBUG && console.log('Deleted from database', data.rowsAffected);
7941
- me.__cursors.forEach(cursor => {
7942
- cursor.__invalidateCache(); // Delete
7943
- });
7944
-
7945
- success();
7946
- }, function (tx, err) {
7947
- error(err);
7948
- return true;
8072
+ return /** @type {import('./IDBTransaction.js').IDBTransactionFull} */me.transaction.__addToTransactionQueue(function objectStoreDelete(tx, args, success, error) {
8073
+ if (CFG.DEBUG) {
8074
+ console.log('Deleting', me.__currentName, sqlValues);
8075
+ }
8076
+ tx.executeSql(sql, sqlValues, function (tx, data) {
8077
+ if (CFG.DEBUG) {
8078
+ console.log('Deleted from database', data.rowsAffected);
8079
+ }
8080
+ me.__cursors.forEach(cursor => {
8081
+ cursor.__invalidateCache(); // Delete
7949
8082
  });
7950
- }, undefined, me)
7951
- );
8083
+ success();
8084
+ }, function (tx, err) {
8085
+ error(err);
8086
+ return false;
8087
+ });
8088
+ }, undefined, me);
7952
8089
  };
7953
8090
 
7954
8091
  /**
@@ -7964,20 +8101,20 @@ IDBObjectStore.prototype.clear = function () {
7964
8101
  IDBTransaction.__assertActive(me.transaction);
7965
8102
  /** @type {import('./IDBTransaction.js').IDBTransactionFull} */
7966
8103
  me.transaction.__assertWritable();
7967
- return (/** @type {import('./IDBTransaction.js').IDBTransactionFull} */me.transaction.__addToTransactionQueue(function objectStoreClear(tx, args, success, error) {
7968
- tx.executeSql('DELETE FROM ' + escapeStoreNameForSQL(me.__currentName), [], function (tx, data) {
7969
- CFG.DEBUG && console.log('Cleared all records from database', data.rowsAffected);
7970
- me.__cursors.forEach(cursor => {
7971
- cursor.__invalidateCache(); // Clear
7972
- });
7973
-
7974
- success();
7975
- }, function (tx, err) {
7976
- error(err);
7977
- return true;
8104
+ return /** @type {import('./IDBTransaction.js').IDBTransactionFull} */me.transaction.__addToTransactionQueue(function objectStoreClear(tx, args, success, error) {
8105
+ tx.executeSql('DELETE FROM ' + escapeStoreNameForSQL(me.__currentName), [], function (tx, data) {
8106
+ if (CFG.DEBUG) {
8107
+ console.log('Cleared all records from database', data.rowsAffected);
8108
+ }
8109
+ me.__cursors.forEach(cursor => {
8110
+ cursor.__invalidateCache(); // Clear
7978
8111
  });
7979
- }, undefined, me)
7980
- );
8112
+ success();
8113
+ }, function (tx, err) {
8114
+ error(err);
8115
+ return false;
8116
+ });
8117
+ }, undefined, me);
7981
8118
  };
7982
8119
 
7983
8120
  /**
@@ -8225,7 +8362,6 @@ IDBDatabase.__createInstance = function (db, name, oldVersion, version, storePro
8225
8362
  this.__setOptions({
8226
8363
  legacyOutputDidListenersThrowFlag: true // Event hook for IndexedB
8227
8364
  });
8228
-
8229
8365
  this.__transactions = [];
8230
8366
 
8231
8367
  /** @type {{[key: string]: IDBObjectStore}} */
@@ -8439,6 +8575,7 @@ IDBDatabase.prototype.__forceClose = function (msg) {
8439
8575
  me.close();
8440
8576
  let ct = 0;
8441
8577
  me.__transactions.forEach(function (trans) {
8578
+ // eslint-disable-next-line camelcase -- Clear API
8442
8579
  trans.on__abort = function () {
8443
8580
  ct++;
8444
8581
  if (ct === me.__transactions.length) {
@@ -8464,8 +8601,6 @@ Object.defineProperty(IDBDatabase, 'prototype', {
8464
8601
  writable: false
8465
8602
  });
8466
8603
 
8467
- /* globals location */
8468
-
8469
8604
  /**
8470
8605
  * @typedef {number} Integer
8471
8606
  */
@@ -8744,14 +8879,14 @@ function cleanupDatabaseResources(__openDatabase, name, escapedDatabaseName, dat
8744
8879
  deleteTables(i + 1);
8745
8880
  }, function () {
8746
8881
  deleteTables(i + 1);
8747
- return true;
8882
+ return false;
8748
8883
  });
8749
8884
  }
8750
8885
  })(0);
8751
- }, function (e) {
8886
+ }, function () {
8752
8887
  // __sys__ table does not exist, but that does not mean delete did not happen
8753
8888
  databaseDeleted();
8754
- return true;
8889
+ return false;
8755
8890
  });
8756
8891
  });
8757
8892
  }
@@ -8777,7 +8912,9 @@ function createSysDB(__openDatabase, success, failure) {
8777
8912
  */
8778
8913
  function sysDbCreateError(tx, err) {
8779
8914
  const er = webSQLErrback( /** @type {SQLError} */err || tx);
8780
- CFG.DEBUG && console.log('Error in sysdb transaction - when creating dbVersions', err);
8915
+ if (CFG.DEBUG) {
8916
+ console.log('Error in sysdb transaction - when creating dbVersions', err);
8917
+ }
8781
8918
  failure(er);
8782
8919
  }
8783
8920
  if (sysdb) {
@@ -8892,9 +9029,9 @@ IDBFactory.prototype.open = function (name /* , version */) {
8892
9029
  */
8893
9030
  function dbCreateError(tx, err) {
8894
9031
  if (calledDbCreateError) {
8895
- return true;
9032
+ return false;
8896
9033
  }
8897
- const er = err ? webSQLErrback(err) : /** @type {Error} */tx;
9034
+ const er = err ? webSQLErrback(err) : ( /** @type {Error} */tx);
8898
9035
  calledDbCreateError = true;
8899
9036
  // Re: why bubbling here (and how cancelable is only really relevant for `window.onerror`) see: https://github.com/w3c/IndexedDB/issues/86
8900
9037
  const evt = createEvent('error', er, {
@@ -8905,7 +9042,7 @@ IDBFactory.prototype.open = function (name /* , version */) {
8905
9042
  req.__error = er;
8906
9043
  req.__result = undefined; // Must be undefined if an error per `result` getter
8907
9044
  req.dispatchEvent(evt);
8908
- return true;
9045
+ return false;
8909
9046
  }
8910
9047
 
8911
9048
  /**
@@ -8978,7 +9115,6 @@ IDBFactory.prototype.open = function (name /* , version */) {
8978
9115
  // In browser, should auto-commit
8979
9116
  cb(); // eslint-disable-line promise/no-callback-in-promise
8980
9117
  };
8981
-
8982
9118
  sysdb.transaction(function (systx) {
8983
9119
  /**
8984
9120
  * @returns {void}
@@ -8992,7 +9128,7 @@ IDBFactory.prototype.open = function (name /* , version */) {
8992
9128
  req.__result = connection;
8993
9129
  connection.__upgradeTransaction = req.__transaction = req.__result.__versionTransaction = IDBTransaction.__createInstance(req.__result, req.__result.objectStoreNames, 'versionchange');
8994
9130
  req.__done = true;
8995
- req.transaction.__addNonRequestToTransactionQueue(function onupgradeneeded(tx, args, finished, error) {
9131
+ req.transaction.__addNonRequestToTransactionQueue(function onupgradeneeded(tx, args, finished /* , error */) {
8996
9132
  req.dispatchEvent(e);
8997
9133
  if (e.__legacyOutputDidListenersThrowError) {
8998
9134
  logError('Error', 'An error occurred in an upgradeneeded handler attached to request chain', /** @type {Error} */e.__legacyOutputDidListenersThrowError); // We do nothing else with this error as per spec
@@ -9001,6 +9137,8 @@ IDBFactory.prototype.open = function (name /* , version */) {
9001
9137
  }
9002
9138
  finished();
9003
9139
  });
9140
+
9141
+ // eslint-disable-next-line camelcase -- Clear API
9004
9142
  req.transaction.on__beforecomplete = function (ev) {
9005
9143
  connection.__upgradeTransaction = null;
9006
9144
  /** @type {import('./IDBDatabase.js').IDBDatabaseFull} */
@@ -9010,9 +9148,11 @@ IDBFactory.prototype.open = function (name /* , version */) {
9010
9148
  ev.complete();
9011
9149
  req.__transaction = null;
9012
9150
  });
9013
- return true;
9151
+ return false;
9014
9152
  });
9015
9153
  };
9154
+
9155
+ // eslint-disable-next-line camelcase -- Clear API
9016
9156
  req.transaction.on__preabort = function () {
9017
9157
  connection.__upgradeTransaction = null;
9018
9158
  // We ensure any cache is deleted before any request error events fire and try to reopen
@@ -9022,6 +9162,8 @@ IDBFactory.prototype.open = function (name /* , version */) {
9022
9162
  }
9023
9163
  }
9024
9164
  };
9165
+
9166
+ // eslint-disable-next-line camelcase -- Clear API
9025
9167
  req.transaction.on__abort = function () {
9026
9168
  req.__transaction = null;
9027
9169
  // `readyState` and `result` will be reset anyways by `dbCreateError` but we follow spec.
@@ -9035,13 +9177,15 @@ IDBFactory.prototype.open = function (name /* , version */) {
9035
9177
  cleanupDatabaseResources(me.__openDatabase, name, escapedDatabaseName, dbCreateError.bind(null, err),
9036
9178
  // @ts-expect-error It's ok
9037
9179
  reportError || dbCreateError);
9038
- return true;
9180
+ return false;
9039
9181
  }
9040
9182
  dbCreateError(err);
9041
- return true;
9183
+ return false;
9042
9184
  });
9043
9185
  });
9044
9186
  };
9187
+
9188
+ // eslint-disable-next-line camelcase -- Clear API
9045
9189
  req.transaction.on__complete = function () {
9046
9190
  if ( /** @type {import('./IDBDatabase.js').IDBDatabaseFull} */req.__result.__closePending) {
9047
9191
  req.__transaction = null;
@@ -9068,7 +9212,6 @@ IDBFactory.prototype.open = function (name /* , version */) {
9068
9212
  // });
9069
9213
  };
9070
9214
  }
9071
-
9072
9215
  if (oldVersion === 0) {
9073
9216
  systx.executeSql('INSERT INTO dbVersions VALUES (?,?)', [sqlSafeName, version], versionSet, dbCreateError);
9074
9217
  } else {
@@ -9149,7 +9292,7 @@ IDBFactory.prototype.open = function (name /* , version */) {
9149
9292
  }, /** @type {SQLStatementErrorCallback} */dbCreateError);
9150
9293
  }, dbCreateError);
9151
9294
  }
9152
- addRequestToConnectionQueue(req, name, /* origin */undefined, function (req) {
9295
+ addRequestToConnectionQueue(req, name, /* origin */undefined, function () {
9153
9296
  let latestCachedVersion;
9154
9297
  if (useDatabaseCache) {
9155
9298
  if (!(name in websqlDBCache)) {
@@ -9206,7 +9349,6 @@ IDBFactory.prototype.deleteDatabase = function (name) {
9206
9349
  } catch (err) {
9207
9350
  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.');
9208
9351
  }
9209
-
9210
9352
  const useMemoryDatabase = typeof CFG.memoryDatabase === 'string';
9211
9353
  const useDatabaseCache = CFG.cacheDatabaseInstances !== false || useMemoryDatabase;
9212
9354
  const req = IDBOpenDBRequest.__createInstance();
@@ -9234,7 +9376,7 @@ IDBFactory.prototype.deleteDatabase = function (name) {
9234
9376
  */
9235
9377
  function dbError(tx, err) {
9236
9378
  if (calledDBError || err === true) {
9237
- return true;
9379
+ return false;
9238
9380
  }
9239
9381
  const er = webSQLErrback( /** @type {SQLError} */err || tx);
9240
9382
  sysdbFinishedCbDelete(true, function () {
@@ -9249,7 +9391,7 @@ IDBFactory.prototype.deleteDatabase = function (name) {
9249
9391
  req.dispatchEvent(e);
9250
9392
  calledDBError = true;
9251
9393
  });
9252
- return true;
9394
+ return false;
9253
9395
  }
9254
9396
  addRequestToConnectionQueue(req, name, /* origin */undefined, function (req) {
9255
9397
  createSysDB(me.__openDatabase, function () {
@@ -9276,7 +9418,6 @@ IDBFactory.prototype.deleteDatabase = function (name) {
9276
9418
  if (useDatabaseCache && name in websqlDBCache) {
9277
9419
  delete websqlDBCache[name]; // New calls will treat as though never existed
9278
9420
  }
9279
-
9280
9421
  delete me.__connections[name];
9281
9422
  completeDatabaseDelete();
9282
9423
  });
@@ -9379,12 +9520,12 @@ IDBFactory.prototype.databases = function () {
9379
9520
  */
9380
9521
  function dbGetDatabaseNamesError(tx, err) {
9381
9522
  if (calledDbCreateError) {
9382
- return true;
9523
+ return false;
9383
9524
  }
9384
9525
  const er = err ? webSQLErrback( /** @type {SQLError} */err) : tx;
9385
9526
  calledDbCreateError = true;
9386
9527
  reject(er);
9387
- return true;
9528
+ return false;
9388
9529
  }
9389
9530
  createSysDB(me.__openDatabase, function () {
9390
9531
  sysdb.readTransaction(function (sysReadTx) {
@@ -9684,25 +9825,33 @@ IDBCursor.prototype.__findBasic = function (key, primaryKey, tx, success, error,
9684
9825
  sql.push('LIMIT', String(recordsToLoad));
9685
9826
  }
9686
9827
  const sqlStr = sql.join(' ');
9687
- CFG.DEBUG && console.log(sqlStr, sqlValues);
9828
+ if (CFG.DEBUG) {
9829
+ console.log(sqlStr, sqlValues);
9830
+ }
9688
9831
  tx.executeSql(sqlStr, sqlValues, function (tx, data) {
9689
9832
  if (me.__count) {
9690
9833
  success(undefined, data.rows.length, undefined);
9691
9834
  } else if (data.rows.length > 1) {
9692
9835
  me.__prefetchedIndex = 0;
9693
9836
  me.__prefetchedData = data.rows;
9694
- CFG.DEBUG && console.log('Preloaded ' + me.__prefetchedData.length + ' records for cursor');
9837
+ if (CFG.DEBUG) {
9838
+ console.log('Preloaded ' + me.__prefetchedData.length + ' records for cursor');
9839
+ }
9695
9840
  me.__decode(data.rows.item(0), success);
9696
9841
  } else if (data.rows.length === 1) {
9697
9842
  me.__decode(data.rows.item(0), success);
9698
9843
  } else {
9699
- CFG.DEBUG && console.log('Reached end of cursors');
9844
+ if (CFG.DEBUG) {
9845
+ console.log('Reached end of cursors');
9846
+ }
9700
9847
  success(undefined, undefined, undefined);
9701
9848
  }
9702
9849
  }, function (tx, err) {
9703
- CFG.DEBUG && console.log('Could not execute Cursor.continue', sqlStr, sqlValues);
9850
+ if (CFG.DEBUG) {
9851
+ console.log('Could not execute Cursor.continue', sqlStr, sqlValues);
9852
+ }
9704
9853
  error(err);
9705
- return true;
9854
+ return false;
9706
9855
  });
9707
9856
  };
9708
9857
  const leftBracketRegex = /\[/gu;
@@ -9720,7 +9869,9 @@ const leftBracketRegex = /\[/gu;
9720
9869
  IDBCursor.prototype.__findMultiEntry = function (key, primaryKey, tx, success, error) {
9721
9870
  const me = this;
9722
9871
  if (me.__prefetchedData && me.__prefetchedData.length === me.__prefetchedIndex) {
9723
- CFG.DEBUG && console.log('Reached end of multiEntry cursor');
9872
+ if (CFG.DEBUG) {
9873
+ console.log('Reached end of multiEntry cursor');
9874
+ }
9724
9875
  success(undefined, undefined, undefined);
9725
9876
  return;
9726
9877
  }
@@ -9772,7 +9923,9 @@ IDBCursor.prototype.__findMultiEntry = function (key, primaryKey, tx, success, e
9772
9923
  }
9773
9924
  }
9774
9925
  const sqlStr = sql.join(' ');
9775
- CFG.DEBUG && console.log(sqlStr, sqlValues);
9926
+ if (CFG.DEBUG) {
9927
+ console.log(sqlStr, sqlValues);
9928
+ }
9776
9929
  tx.executeSql(sqlStr, sqlValues, function (tx, data) {
9777
9930
  if (data.rows.length > 0) {
9778
9931
  if (me.__count) {
@@ -9797,8 +9950,8 @@ IDBCursor.prototype.__findMultiEntry = function (key, primaryKey, tx, success, e
9797
9950
  * @type {RowItemNonNull}
9798
9951
  */
9799
9952
  const clone = {
9800
- matchingKey: /** @type {string} */
9801
- encode$1(matchingKey, true),
9953
+ matchingKey: ( /** @type {string} */
9954
+ encode$1(matchingKey, true)),
9802
9955
  key: rowItem.key
9803
9956
  };
9804
9957
  clone[me.__keyColumnName] = rowItem[me.__keyColumnName];
@@ -9835,23 +9988,33 @@ IDBCursor.prototype.__findMultiEntry = function (key, primaryKey, tx, success, e
9835
9988
  return this.data[index];
9836
9989
  }
9837
9990
  };
9838
- CFG.DEBUG && console.log('Preloaded ' + me.__prefetchedData.length + ' records for multiEntry cursor');
9991
+ if (CFG.DEBUG) {
9992
+ console.log('Preloaded ' + me.__prefetchedData.length + ' records for multiEntry cursor');
9993
+ }
9839
9994
  me.__decode(rows[0], success);
9840
9995
  } else if (rows.length === 1) {
9841
- CFG.DEBUG && console.log('Reached end of multiEntry cursor');
9996
+ if (CFG.DEBUG) {
9997
+ console.log('Reached end of multiEntry cursor');
9998
+ }
9842
9999
  me.__decode(rows[0], success);
9843
10000
  } else {
9844
- CFG.DEBUG && console.log('Reached end of multiEntry cursor');
10001
+ if (CFG.DEBUG) {
10002
+ console.log('Reached end of multiEntry cursor');
10003
+ }
9845
10004
  success(undefined, undefined, undefined);
9846
10005
  }
9847
10006
  } else {
9848
- CFG.DEBUG && console.log('Reached end of multiEntry cursor');
10007
+ if (CFG.DEBUG) {
10008
+ console.log('Reached end of multiEntry cursor');
10009
+ }
9849
10010
  success(undefined, undefined, undefined);
9850
10011
  }
9851
10012
  }, function (tx, err) {
9852
- CFG.DEBUG && console.log('Could not execute Cursor.continue', sqlStr, sqlValues);
10013
+ if (CFG.DEBUG) {
10014
+ console.log('Could not execute Cursor.continue', sqlStr, sqlValues);
10015
+ }
9853
10016
  error(err);
9854
- return true;
10017
+ return false;
9855
10018
  });
9856
10019
  };
9857
10020
 
@@ -9940,7 +10103,7 @@ IDBCursor.prototype.__decode = function (rowItem, callback) {
9940
10103
  const key = decode$1(encKey, me.__multiEntryIndex);
9941
10104
  const val = me.__valueDecoder.decode(encVal);
9942
10105
  const primaryKey = decode$1(encPrimaryKey);
9943
- callback(key, val, primaryKey, encKey /*, encVal, encPrimaryKey */);
10106
+ callback(key, val, primaryKey, encKey /* , encVal, encPrimaryKey */);
9944
10107
  };
9945
10108
 
9946
10109
  /**
@@ -10148,7 +10311,9 @@ IDBCursor.prototype.advance = function (count) {
10148
10311
  */
10149
10312
  IDBCursor.prototype.update = function (valueToUpdate) {
10150
10313
  const me = this;
10151
- if (!arguments.length) throw new TypeError('A value must be passed to update()');
10314
+ if (!arguments.length) {
10315
+ throw new TypeError('A value must be passed to update()');
10316
+ }
10152
10317
  IDBTransaction.__assertActive(me.__store.transaction);
10153
10318
  /** @type {import('./IDBTransaction.js').IDBTransactionFull} */
10154
10319
  me.__store.transaction.__assertWritable();
@@ -10199,28 +10364,29 @@ IDBCursor.prototype.delete = function () {
10199
10364
  if (me.__keyOnly) {
10200
10365
  throw createDOMException('InvalidStateError', 'This cursor method cannot be called when the key only flag has been set.');
10201
10366
  }
10202
- return (/** @type {import('./IDBTransaction.js').IDBTransactionFull} */this.__store.transaction.__addToTransactionQueue(function cursorDelete(tx, args, success, error) {
10203
- me.__find(undefined, undefined, tx, /** @type {KeySuccess} */
10204
- function (key, value, primaryKey) {
10205
- const sql = 'DELETE FROM ' + escapeStoreNameForSQL(me.__store.__currentName) + ' WHERE "key" = ?';
10206
- CFG.DEBUG && console.log(sql, key, primaryKey);
10207
- // Key.convertValueToKey(primaryKey); // Already checked when entered
10208
- tx.executeSql(sql, [escapeSQLiteStatement( /** @type {string} */encode$1(primaryKey))], function (tx, data) {
10209
- if (data.rowsAffected === 1) {
10210
- // We don't invalidate the cache (as we don't access it anymore
10211
- // and it will set the index off)
10212
- success(undefined);
10213
- } else {
10214
- // @ts-expect-error Apparently ok
10215
- error('No rows with key found' + key);
10216
- }
10217
- }, function (tx, data) {
10218
- error(data);
10219
- return true;
10220
- });
10221
- }, error);
10222
- }, undefined, me)
10223
- );
10367
+ return /** @type {import('./IDBTransaction.js').IDBTransactionFull} */this.__store.transaction.__addToTransactionQueue(function cursorDelete(tx, args, success, error) {
10368
+ me.__find(undefined, undefined, tx, /** @type {KeySuccess} */
10369
+ function (key, value, primaryKey) {
10370
+ const sql = 'DELETE FROM ' + escapeStoreNameForSQL(me.__store.__currentName) + ' WHERE "key" = ?';
10371
+ if (CFG.DEBUG) {
10372
+ console.log(sql, key, primaryKey);
10373
+ }
10374
+ // Key.convertValueToKey(primaryKey); // Already checked when entered
10375
+ tx.executeSql(sql, [escapeSQLiteStatement( /** @type {string} */encode$1(primaryKey))], function (tx, data) {
10376
+ if (data.rowsAffected === 1) {
10377
+ // We don't invalidate the cache (as we don't access it anymore
10378
+ // and it will set the index off)
10379
+ success(undefined);
10380
+ } else {
10381
+ // @ts-expect-error Apparently ok
10382
+ error('No rows with key found' + key);
10383
+ }
10384
+ }, function (tx, data) {
10385
+ error(data);
10386
+ return false;
10387
+ });
10388
+ }, error);
10389
+ }, undefined, me);
10224
10390
  };
10225
10391
  IDBCursor.prototype[Symbol.toStringTag] = 'IDBCursorPrototype';
10226
10392
  defineReadonlyOuterInterface(IDBCursor.prototype, ['source', 'direction', 'key', 'primaryKey', 'request']);
@@ -10410,8 +10576,7 @@ function setGlobalVars(idb, initialConfig) {
10410
10576
  * @returns {AnyValue}
10411
10577
  */
10412
10578
  get [name]() {
10413
- return (/** @type {AnyFunction} */ /** @type {PropertyDescriptor} */propDesc.get.call(this)
10414
- );
10579
+ return /** @type {AnyFunction} */( /** @type {PropertyDescriptor} */propDesc.get).call(this);
10415
10580
  }
10416
10581
  };
10417
10582
  desc = /** @type {PropertyDescriptor} */
@@ -10427,7 +10592,9 @@ function setGlobalVars(idb, initialConfig) {
10427
10592
 
10428
10593
  // @ts-expect-error It's ok
10429
10594
  if (IDB[name] !== value) {
10430
- typeof console !== 'undefined' && console.warn && console.warn('Unable to shim ' + name);
10595
+ if (typeof console !== 'undefined' && console.warn) {
10596
+ console.warn('Unable to shim ' + name);
10597
+ }
10431
10598
  }
10432
10599
  }
10433
10600
  if (CFG.win.openDatabase !== undefined) {
@@ -10603,8 +10770,7 @@ function setGlobalVars(idb, initialConfig) {
10603
10770
  IDB.IDBCursor = IDB.IDBCursor || 'webkitIDBCursor' in IDB && IDB.webkitIDBCursor;
10604
10771
  IDB.IDBKeyRange = IDB.IDBKeyRange || 'webkitIDBKeyRange' in IDB && IDB.webkitIDBKeyRange;
10605
10772
  }
10606
- return (/** @type {ShimmedObject} */IDB
10607
- );
10773
+ return /** @type {ShimmedObject} */IDB;
10608
10774
  }
10609
10775
 
10610
10776
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -12933,7 +13099,6 @@ function requireSignals() {
12933
13099
  // 'SIGPROF'
12934
13100
  );
12935
13101
  }
12936
-
12937
13102
  if (process.platform === 'linux') {
12938
13103
  module.exports.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT', 'SIGUNUSED');
12939
13104
  }
@@ -17178,7 +17343,6 @@ function requireNapi() {
17178
17343
  if (versionArray[0] === 9 && versionArray[1] >= 3) version = 2; // 9.3.0+
17179
17344
  else if (versionArray[0] === 8) version = 1; // 8.0.0+
17180
17345
  }
17181
-
17182
17346
  return version;
17183
17347
  };
17184
17348
  module.exports.get_napi_version_as_string = function (target) {
@@ -17349,10 +17513,15 @@ function requireConstants() {
17349
17513
 
17350
17514
  // Max safe segment length for coercion.
17351
17515
  const MAX_SAFE_COMPONENT_LENGTH = 16;
17516
+
17517
+ // Max safe length for a build identifier. The max length minus 6 characters for
17518
+ // the shortest version with a build 0.0.0+BUILD.
17519
+ const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
17352
17520
  const RELEASE_TYPES = ['major', 'premajor', 'minor', 'preminor', 'patch', 'prepatch', 'prerelease'];
17353
17521
  constants = {
17354
17522
  MAX_LENGTH,
17355
17523
  MAX_SAFE_COMPONENT_LENGTH,
17524
+ MAX_SAFE_BUILD_LENGTH,
17356
17525
  MAX_SAFE_INTEGER,
17357
17526
  RELEASE_TYPES,
17358
17527
  SEMVER_SPEC_VERSION,
@@ -17378,22 +17547,42 @@ function requireRe() {
17378
17547
  hasRequiredRe = 1;
17379
17548
  (function (module, exports) {
17380
17549
  const {
17381
- MAX_SAFE_COMPONENT_LENGTH
17550
+ MAX_SAFE_COMPONENT_LENGTH,
17551
+ MAX_SAFE_BUILD_LENGTH,
17552
+ MAX_LENGTH
17382
17553
  } = requireConstants();
17383
17554
  const debug = requireDebug();
17384
17555
  exports = module.exports = {};
17385
17556
 
17386
17557
  // The actual regexps go on exports.re
17387
17558
  const re = exports.re = [];
17559
+ const safeRe = exports.safeRe = [];
17388
17560
  const src = exports.src = [];
17389
17561
  const t = exports.t = {};
17390
17562
  let R = 0;
17563
+ const LETTERDASHNUMBER = '[a-zA-Z0-9-]';
17564
+
17565
+ // Replace some greedy regex tokens to prevent regex dos issues. These regex are
17566
+ // used internally via the safeRe object since all inputs in this library get
17567
+ // normalized first to trim and collapse all extra whitespace. The original
17568
+ // regexes are exported for userland consumption and lower level usage. A
17569
+ // future breaking change could export the safer regex only with a note that
17570
+ // all input should have extra whitespace removed.
17571
+ const safeRegexReplacements = [['\\s', 1], ['\\d', MAX_LENGTH], [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]];
17572
+ const makeSafeRegex = value => {
17573
+ for (const [token, max] of safeRegexReplacements) {
17574
+ value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
17575
+ }
17576
+ return value;
17577
+ };
17391
17578
  const createToken = (name, value, isGlobal) => {
17579
+ const safe = makeSafeRegex(value);
17392
17580
  const index = R++;
17393
17581
  debug(name, index, value);
17394
17582
  t[name] = index;
17395
17583
  src[index] = value;
17396
17584
  re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
17585
+ safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined);
17397
17586
  };
17398
17587
 
17399
17588
  // The following Regular Expressions can be used for tokenizing,
@@ -17403,13 +17592,13 @@ function requireRe() {
17403
17592
  // A single `0`, or a non-zero digit followed by zero or more digits.
17404
17593
 
17405
17594
  createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
17406
- createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+');
17595
+ createToken('NUMERICIDENTIFIERLOOSE', '\\d+');
17407
17596
 
17408
17597
  // ## Non-numeric Identifier
17409
17598
  // Zero or more digits, followed by a letter or hyphen, and then zero or
17410
17599
  // more letters, digits, or hyphens.
17411
17600
 
17412
- createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*');
17601
+ createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
17413
17602
 
17414
17603
  // ## Main Version
17415
17604
  // Three dot-separated numeric identifiers.
@@ -17433,7 +17622,7 @@ function requireRe() {
17433
17622
  // ## Build Metadata Identifier
17434
17623
  // Any combination of digits, letters, or hyphens.
17435
17624
 
17436
- createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+');
17625
+ createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`);
17437
17626
 
17438
17627
  // ## Build Metadata
17439
17628
  // Plus sign, followed by one or more period-separated build metadata
@@ -17573,7 +17762,7 @@ function requireSemver$1() {
17573
17762
  MAX_SAFE_INTEGER
17574
17763
  } = requireConstants();
17575
17764
  const {
17576
- re,
17765
+ safeRe: re,
17577
17766
  t
17578
17767
  } = requireRe();
17579
17768
  const parseOptions = requireParseOptions();
@@ -17833,8 +18022,10 @@ function requireSemver$1() {
17833
18022
  default:
17834
18023
  throw new Error(`invalid increment argument: ${release}`);
17835
18024
  }
17836
- this.format();
17837
- this.raw = this.version;
18025
+ this.raw = this.format();
18026
+ if (this.build.length) {
18027
+ this.raw += `+${this.build.join('.')}`;
18028
+ }
17838
18029
  return this;
17839
18030
  }
17840
18031
  }
@@ -17932,6 +18123,33 @@ function requireDiff() {
17932
18123
  const highVersion = v1Higher ? v1 : v2;
17933
18124
  const lowVersion = v1Higher ? v2 : v1;
17934
18125
  const highHasPre = !!highVersion.prerelease.length;
18126
+ const lowHasPre = !!lowVersion.prerelease.length;
18127
+ if (lowHasPre && !highHasPre) {
18128
+ // Going from prerelease -> no prerelease requires some special casing
18129
+
18130
+ // If the low version has only a major, then it will always be a major
18131
+ // Some examples:
18132
+ // 1.0.0-1 -> 1.0.0
18133
+ // 1.0.0-1 -> 1.1.1
18134
+ // 1.0.0-1 -> 2.0.0
18135
+ if (!lowVersion.patch && !lowVersion.minor) {
18136
+ return 'major';
18137
+ }
18138
+
18139
+ // Otherwise it can be determined by checking the high version
18140
+
18141
+ if (highVersion.patch) {
18142
+ // anything higher than a patch bump would result in the wrong version
18143
+ return 'patch';
18144
+ }
18145
+ if (highVersion.minor) {
18146
+ // anything higher than a minor bump would result in the wrong version
18147
+ return 'minor';
18148
+ }
18149
+
18150
+ // bumping major/minor/patch all have same result
18151
+ return 'major';
18152
+ }
17935
18153
 
17936
18154
  // add the `pre` prefix if we are going to a prerelease version
17937
18155
  const prefix = highHasPre ? 'pre' : '';
@@ -17945,24 +18163,8 @@ function requireDiff() {
17945
18163
  return prefix + 'patch';
17946
18164
  }
17947
18165
 
17948
- // at this point we know stable versions match but overall versions are not equal,
17949
- // so either they are both prereleases, or the lower version is a prerelease
17950
-
17951
- if (highHasPre) {
17952
- // high and low are preleases
17953
- return 'prerelease';
17954
- }
17955
- if (lowVersion.patch) {
17956
- // anything higher than a patch bump would result in the wrong version
17957
- return 'patch';
17958
- }
17959
- if (lowVersion.minor) {
17960
- // anything higher than a minor bump would result in the wrong version
17961
- return 'minor';
17962
- }
17963
-
17964
- // bumping major/minor/patch all have same result
17965
- return 'major';
18166
+ // high and low are preleases
18167
+ return 'prerelease';
17966
18168
  };
17967
18169
  diff_1 = diff;
17968
18170
  return diff_1;
@@ -18210,7 +18412,7 @@ function requireCoerce() {
18210
18412
  const SemVer = requireSemver$1();
18211
18413
  const parse = requireParse();
18212
18414
  const {
18213
- re,
18415
+ safeRe: re,
18214
18416
  t
18215
18417
  } = requireRe();
18216
18418
  const coerce = (version, options) => {
@@ -18766,7 +18968,6 @@ function requireLruCache() {
18766
18968
  this[LRU_LIST] = new Yallist(); // list of items in order of use recency
18767
18969
  this[LENGTH] = 0; // length of items in the list
18768
18970
  }
18769
-
18770
18971
  dump() {
18771
18972
  return this[LRU_LIST].map(hit => isStale(this, hit) ? false : {
18772
18973
  k: hit.key,
@@ -18950,9 +19151,13 @@ function requireRange() {
18950
19151
  this.loose = !!options.loose;
18951
19152
  this.includePrerelease = !!options.includePrerelease;
18952
19153
 
18953
- // First, split based on boolean or ||
18954
- this.raw = range;
18955
- this.set = range.split('||')
19154
+ // First reduce all whitespace as much as possible so we do not have to rely
19155
+ // on potentially slow regexes like \s*. This is then stored and used for
19156
+ // future error messages as well.
19157
+ this.raw = range.trim().split(/\s+/).join(' ');
19158
+
19159
+ // First, split on ||
19160
+ this.set = this.raw.split('||')
18956
19161
  // map the range to a 2d array of comparators
18957
19162
  .map(r => this.parseRange(r.trim()))
18958
19163
  // throw out any comparator lists that are empty
@@ -18960,7 +19165,7 @@ function requireRange() {
18960
19165
  // in loose mode, but will still throw if the WHOLE range is invalid.
18961
19166
  .filter(c => c.length);
18962
19167
  if (!this.set.length) {
18963
- throw new TypeError(`Invalid SemVer Range: ${range}`);
19168
+ throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
18964
19169
  }
18965
19170
 
18966
19171
  // if we have any that are not the null set, throw out null sets.
@@ -18983,17 +19188,13 @@ function requireRange() {
18983
19188
  this.format();
18984
19189
  }
18985
19190
  format() {
18986
- this.range = this.set.map(comps => {
18987
- return comps.join(' ').trim();
18988
- }).join('||').trim();
19191
+ this.range = this.set.map(comps => comps.join(' ').trim()).join('||').trim();
18989
19192
  return this.range;
18990
19193
  }
18991
19194
  toString() {
18992
19195
  return this.range;
18993
19196
  }
18994
19197
  parseRange(range) {
18995
- range = range.trim();
18996
-
18997
19198
  // memoize range parsing for performance.
18998
19199
  // this is a very hot path, and fully deterministic.
18999
19200
  const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
@@ -19007,18 +19208,18 @@ function requireRange() {
19007
19208
  const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
19008
19209
  range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
19009
19210
  debug('hyphen replace', range);
19211
+
19010
19212
  // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
19011
19213
  range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
19012
19214
  debug('comparator trim', range);
19013
19215
 
19014
19216
  // `~ 1.2.3` => `~1.2.3`
19015
19217
  range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
19218
+ debug('tilde trim', range);
19016
19219
 
19017
19220
  // `^ 1.2.3` => `^1.2.3`
19018
19221
  range = range.replace(re[t.CARETTRIM], caretTrimReplace);
19019
-
19020
- // normalize spaces
19021
- range = range.split(/\s+/).join(' ');
19222
+ debug('caret trim', range);
19022
19223
 
19023
19224
  // At this point, the range is completely trimmed and
19024
19225
  // ready to be split into comparators.
@@ -19098,7 +19299,7 @@ function requireRange() {
19098
19299
  const debug = requireDebug();
19099
19300
  const SemVer = requireSemver$1();
19100
19301
  const {
19101
- re,
19302
+ safeRe: re,
19102
19303
  t,
19103
19304
  comparatorTrimReplace,
19104
19305
  tildeTrimReplace,
@@ -19150,9 +19351,9 @@ function requireRange() {
19150
19351
  // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
19151
19352
  // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
19152
19353
  // ~0.0.1 --> >=0.0.1 <0.1.0-0
19153
- const replaceTildes = (comp, options) => comp.trim().split(/\s+/).map(c => {
19154
- return replaceTilde(c, options);
19155
- }).join(' ');
19354
+ const replaceTildes = (comp, options) => {
19355
+ return comp.trim().split(/\s+/).map(c => replaceTilde(c, options)).join(' ');
19356
+ };
19156
19357
  const replaceTilde = (comp, options) => {
19157
19358
  const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
19158
19359
  return comp.replace(r, (_, M, m, p, pr) => {
@@ -19185,9 +19386,9 @@ function requireRange() {
19185
19386
  // ^1.2.0 --> >=1.2.0 <2.0.0-0
19186
19387
  // ^0.0.1 --> >=0.0.1 <0.0.2-0
19187
19388
  // ^0.1.0 --> >=0.1.0 <0.2.0-0
19188
- const replaceCarets = (comp, options) => comp.trim().split(/\s+/).map(c => {
19189
- return replaceCaret(c, options);
19190
- }).join(' ');
19389
+ const replaceCarets = (comp, options) => {
19390
+ return comp.trim().split(/\s+/).map(c => replaceCaret(c, options)).join(' ');
19391
+ };
19191
19392
  const replaceCaret = (comp, options) => {
19192
19393
  debug('caret', comp, options);
19193
19394
  const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
@@ -19234,9 +19435,7 @@ function requireRange() {
19234
19435
  };
19235
19436
  const replaceXRanges = (comp, options) => {
19236
19437
  debug('replaceXRanges', comp, options);
19237
- return comp.split(/\s+/).map(c => {
19238
- return replaceXRange(c, options);
19239
- }).join(' ');
19438
+ return comp.split(/\s+/).map(c => replaceXRange(c, options)).join(' ');
19240
19439
  };
19241
19440
  const replaceXRange = (comp, options) => {
19242
19441
  comp = comp.trim();
@@ -19402,6 +19601,7 @@ function requireComparator() {
19402
19601
  comp = comp.value;
19403
19602
  }
19404
19603
  }
19604
+ comp = comp.trim().split(/\s+/).join(' ');
19405
19605
  debug('comparator', comp, options);
19406
19606
  this.options = options;
19407
19607
  this.loose = !!options.loose;
@@ -19499,7 +19699,7 @@ function requireComparator() {
19499
19699
  comparator = Comparator;
19500
19700
  const parseOptions = requireParseOptions();
19501
19701
  const {
19502
- re,
19702
+ safeRe: re,
19503
19703
  t
19504
19704
  } = requireRe();
19505
19705
  const cmp = requireCmp();
@@ -20203,6 +20403,49 @@ function requireProcess() {
20203
20403
  return process_1;
20204
20404
  }
20205
20405
 
20406
+ var filesystem;
20407
+ var hasRequiredFilesystem;
20408
+ function requireFilesystem() {
20409
+ if (hasRequiredFilesystem) return filesystem;
20410
+ hasRequiredFilesystem = 1;
20411
+ const fs = require$$0$1;
20412
+
20413
+ /**
20414
+ * The path where we can find the ldd
20415
+ */
20416
+ const LDD_PATH = '/usr/bin/ldd';
20417
+
20418
+ /**
20419
+ * Read the content of a file synchronous
20420
+ *
20421
+ * @param {string} path
20422
+ * @returns {string}
20423
+ */
20424
+ const readFileSync = path => fs.readFileSync(path, 'utf-8');
20425
+
20426
+ /**
20427
+ * Read the content of a file
20428
+ *
20429
+ * @param {string} path
20430
+ * @returns {Promise<string>}
20431
+ */
20432
+ const readFile = path => new Promise((resolve, reject) => {
20433
+ fs.readFile(path, 'utf-8', (err, data) => {
20434
+ if (err) {
20435
+ reject(err);
20436
+ } else {
20437
+ resolve(data);
20438
+ }
20439
+ });
20440
+ });
20441
+ filesystem = {
20442
+ LDD_PATH,
20443
+ readFileSync,
20444
+ readFile
20445
+ };
20446
+ return filesystem;
20447
+ }
20448
+
20206
20449
  var detectLibc;
20207
20450
  var hasRequiredDetectLibc;
20208
20451
  function requireDetectLibc() {
@@ -20213,6 +20456,13 @@ function requireDetectLibc() {
20213
20456
  isLinux,
20214
20457
  getReport
20215
20458
  } = requireProcess();
20459
+ const {
20460
+ LDD_PATH,
20461
+ readFile,
20462
+ readFileSync
20463
+ } = requireFilesystem();
20464
+ let cachedFamilyFilesystem;
20465
+ let cachedVersionFilesystem;
20216
20466
  const command = 'getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true';
20217
20467
  let commandOut = '';
20218
20468
  const safeCommand = () => {
@@ -20246,12 +20496,30 @@ function requireDetectLibc() {
20246
20496
  */
20247
20497
  const GLIBC = 'glibc';
20248
20498
 
20499
+ /**
20500
+ * A Regexp constant to get the GLIBC Version.
20501
+ * @type {string}
20502
+ */
20503
+ const RE_GLIBC_VERSION = /GLIBC\s(\d+\.\d+)/;
20504
+
20249
20505
  /**
20250
20506
  * A String constant containing the value `musl`.
20251
20507
  * @type {string}
20252
20508
  * @public
20253
20509
  */
20254
20510
  const MUSL = 'musl';
20511
+
20512
+ /**
20513
+ * This string is used to find if the {@link LDD_PATH} is GLIBC
20514
+ * @type {string}
20515
+ */
20516
+ const GLIBC_ON_LDD = GLIBC.toUpperCase();
20517
+
20518
+ /**
20519
+ * This string is used to find if the {@link LDD_PATH} is musl
20520
+ * @type {string}
20521
+ */
20522
+ const MUSL_ON_LDD = MUSL.toLowerCase();
20255
20523
  const isFileMusl = f => f.includes('libc.musl-') || f.includes('ld-musl-');
20256
20524
  const familyFromReport = () => {
20257
20525
  const report = getReport();
@@ -20275,6 +20543,37 @@ function requireDetectLibc() {
20275
20543
  }
20276
20544
  return null;
20277
20545
  };
20546
+ const getFamilyFromLddContent = content => {
20547
+ if (content.includes(MUSL_ON_LDD)) {
20548
+ return MUSL;
20549
+ }
20550
+ if (content.includes(GLIBC_ON_LDD)) {
20551
+ return GLIBC;
20552
+ }
20553
+ return null;
20554
+ };
20555
+ const familyFromFilesystem = async () => {
20556
+ if (cachedFamilyFilesystem !== undefined) {
20557
+ return cachedFamilyFilesystem;
20558
+ }
20559
+ cachedFamilyFilesystem = null;
20560
+ try {
20561
+ const lddContent = await readFile(LDD_PATH);
20562
+ cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
20563
+ } catch (e) {}
20564
+ return cachedFamilyFilesystem;
20565
+ };
20566
+ const familyFromFilesystemSync = () => {
20567
+ if (cachedFamilyFilesystem !== undefined) {
20568
+ return cachedFamilyFilesystem;
20569
+ }
20570
+ cachedFamilyFilesystem = null;
20571
+ try {
20572
+ const lddContent = readFileSync(LDD_PATH);
20573
+ cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
20574
+ } catch (e) {}
20575
+ return cachedFamilyFilesystem;
20576
+ };
20278
20577
 
20279
20578
  /**
20280
20579
  * Resolves with the libc family when it can be determined, `null` otherwise.
@@ -20283,7 +20582,10 @@ function requireDetectLibc() {
20283
20582
  const family = async () => {
20284
20583
  let family = null;
20285
20584
  if (isLinux()) {
20286
- family = familyFromReport();
20585
+ family = await familyFromFilesystem();
20586
+ if (!family) {
20587
+ family = familyFromReport();
20588
+ }
20287
20589
  if (!family) {
20288
20590
  const out = await safeCommand();
20289
20591
  family = familyFromCommand(out);
@@ -20299,7 +20601,10 @@ function requireDetectLibc() {
20299
20601
  const familySync = () => {
20300
20602
  let family = null;
20301
20603
  if (isLinux()) {
20302
- family = familyFromReport();
20604
+ family = familyFromFilesystemSync();
20605
+ if (!family) {
20606
+ family = familyFromReport();
20607
+ }
20303
20608
  if (!family) {
20304
20609
  const out = safeCommandSync();
20305
20610
  family = familyFromCommand(out);
@@ -20319,6 +20624,34 @@ function requireDetectLibc() {
20319
20624
  * @returns {boolean}
20320
20625
  */
20321
20626
  const isNonGlibcLinuxSync = () => isLinux() && familySync() !== GLIBC;
20627
+ const versionFromFilesystem = async () => {
20628
+ if (cachedVersionFilesystem !== undefined) {
20629
+ return cachedVersionFilesystem;
20630
+ }
20631
+ cachedVersionFilesystem = null;
20632
+ try {
20633
+ const lddContent = await readFile(LDD_PATH);
20634
+ const versionMatch = lddContent.match(RE_GLIBC_VERSION);
20635
+ if (versionMatch) {
20636
+ cachedVersionFilesystem = versionMatch[1];
20637
+ }
20638
+ } catch (e) {}
20639
+ return cachedVersionFilesystem;
20640
+ };
20641
+ const versionFromFilesystemSync = () => {
20642
+ if (cachedVersionFilesystem !== undefined) {
20643
+ return cachedVersionFilesystem;
20644
+ }
20645
+ cachedVersionFilesystem = null;
20646
+ try {
20647
+ const lddContent = readFileSync(LDD_PATH);
20648
+ const versionMatch = lddContent.match(RE_GLIBC_VERSION);
20649
+ if (versionMatch) {
20650
+ cachedVersionFilesystem = versionMatch[1];
20651
+ }
20652
+ } catch (e) {}
20653
+ return cachedVersionFilesystem;
20654
+ };
20322
20655
  const versionFromReport = () => {
20323
20656
  const report = getReport();
20324
20657
  if (report.header && report.header.glibcVersionRuntime) {
@@ -20345,7 +20678,10 @@ function requireDetectLibc() {
20345
20678
  const version = async () => {
20346
20679
  let version = null;
20347
20680
  if (isLinux()) {
20348
- version = versionFromReport();
20681
+ version = await versionFromFilesystem();
20682
+ if (!version) {
20683
+ version = versionFromReport();
20684
+ }
20349
20685
  if (!version) {
20350
20686
  const out = await safeCommand();
20351
20687
  version = versionFromCommand(out);
@@ -20361,7 +20697,10 @@ function requireDetectLibc() {
20361
20697
  const versionSync = () => {
20362
20698
  let version = null;
20363
20699
  if (isLinux()) {
20364
- version = versionFromReport();
20700
+ version = versionFromFilesystemSync();
20701
+ if (!version) {
20702
+ version = versionFromReport();
20703
+ }
20365
20704
  if (!version) {
20366
20705
  const out = safeCommandSync();
20367
20706
  version = versionFromCommand(out);
@@ -23354,7 +23693,7 @@ function requirePreBinding() {
23354
23693
 
23355
23694
  var name = "@mapbox/node-pre-gyp";
23356
23695
  var description = "Node.js native addon binary install tool";
23357
- var version = "1.0.10";
23696
+ var version = "1.0.11";
23358
23697
  var keywords = [
23359
23698
  "native",
23360
23699
  "addon",
@@ -23955,7 +24294,6 @@ function SQLiteDatabase(name, opts) {
23955
24294
  if (opts.busyTimeout) {
23956
24295
  this._db.configure('busyTimeout', opts.busyTimeout); // Default is 1000
23957
24296
  }
23958
-
23959
24297
  if (opts.trace) {
23960
24298
  this._db.configure('trace', opts.trace);
23961
24299
  }
@@ -24038,7 +24376,6 @@ function wrappedSQLiteDatabase(name) {
24038
24376
  if (CFG.sqlBusyTimeout) {
24039
24377
  db._db.configure('busyTimeout', /** @type {number} */CFG.sqlBusyTimeout); // Default is 1000
24040
24378
  }
24041
-
24042
24379
  if (CFG.sqlTrace) {
24043
24380
  // @ts-expect-error native API?
24044
24381
  db._db.configure('trace', CFG.sqlTrace);