indexeddbshim 15.2.0 → 16.1.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 (68) hide show
  1. package/README.md +1 -1
  2. package/badges/licenses-badge-dev.svg +1 -1
  3. package/badges/licenses-badge.svg +1 -1
  4. package/dist/DOMException.d.ts +2 -2
  5. package/dist/DOMException.d.ts.map +1 -1
  6. package/dist/DOMStringList.d.ts.map +1 -1
  7. package/dist/Event.d.ts +1 -1
  8. package/dist/Event.d.ts.map +1 -1
  9. package/dist/IDBCursor.d.ts +3 -2
  10. package/dist/IDBCursor.d.ts.map +1 -1
  11. package/dist/IDBDatabase.d.ts.map +1 -1
  12. package/dist/IDBFactory.d.ts +1 -1
  13. package/dist/IDBFactory.d.ts.map +1 -1
  14. package/dist/IDBIndex.d.ts +3 -3
  15. package/dist/IDBIndex.d.ts.map +1 -1
  16. package/dist/IDBKeyRange.d.ts +2 -2
  17. package/dist/IDBKeyRange.d.ts.map +1 -1
  18. package/dist/IDBObjectStore.d.ts +3 -3
  19. package/dist/IDBObjectStore.d.ts.map +1 -1
  20. package/dist/IDBTransaction.d.ts.map +1 -1
  21. package/dist/Key.d.ts +7 -7
  22. package/dist/Key.d.ts.map +1 -1
  23. package/dist/Sca.d.ts +1 -1
  24. package/dist/Sca.d.ts.map +1 -1
  25. package/dist/indexeddbshim-Key.js +1668 -1839
  26. package/dist/indexeddbshim-Key.js.map +1 -1
  27. package/dist/indexeddbshim-Key.min.js +2 -2
  28. package/dist/indexeddbshim-Key.min.js.map +1 -1
  29. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +1257 -1163
  30. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
  31. package/dist/indexeddbshim-UnicodeIdentifiers.js +1850 -2721
  32. package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
  33. package/dist/indexeddbshim-UnicodeIdentifiers.min.js +2 -2
  34. package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
  35. package/dist/indexeddbshim-node.cjs +1257 -1163
  36. package/dist/indexeddbshim-node.cjs.map +1 -1
  37. package/dist/indexeddbshim-noninvasive.js +1848 -2719
  38. package/dist/indexeddbshim-noninvasive.js.map +1 -1
  39. package/dist/indexeddbshim-noninvasive.min.js +2 -2
  40. package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
  41. package/dist/indexeddbshim.js +1846 -2709
  42. package/dist/indexeddbshim.js.map +1 -1
  43. package/dist/indexeddbshim.min.js +2 -2
  44. package/dist/indexeddbshim.min.js.map +1 -1
  45. package/dist/node-UnicodeIdentifiers.d.ts.map +1 -1
  46. package/dist/node.d.ts.map +1 -1
  47. package/dist/setGlobalVars.d.ts +1 -1
  48. package/dist/setGlobalVars.d.ts.map +1 -1
  49. package/dist/unicode-regex.d.ts +2 -2
  50. package/dist/unicode-regex.d.ts.map +1 -1
  51. package/dist/util.d.ts +1 -1
  52. package/dist/util.d.ts.map +1 -1
  53. package/package.json +30 -31
  54. package/src/DOMException.js +0 -1
  55. package/src/DOMStringList.js +0 -1
  56. package/src/IDBCursor.js +8 -4
  57. package/src/IDBFactory.js +2 -4
  58. package/src/IDBIndex.js +1 -2
  59. package/src/IDBKeyRange.js +1 -0
  60. package/src/IDBObjectStore.js +0 -1
  61. package/src/IDBTransaction.js +0 -1
  62. package/src/Key.js +5 -1
  63. package/src/browser-UnicodeIdentifiers.js +2 -2
  64. package/src/browser-noninvasive.js +1 -1
  65. package/src/browser.js +1 -1
  66. package/src/setGlobalVars.js +0 -2
  67. package/src/unicode-regex.js +12 -3
  68. package/src/util.js +1 -0
@@ -1,4 +1,4 @@
1
- /*! indexeddbshim - v15.2.0 - 9/11/2024 */
1
+ /*! indexeddbshim - v16.1.0 - 9/1/2025 */
2
2
 
3
3
  'use strict';
4
4
 
@@ -1160,10 +1160,19 @@ val => {
1160
1160
  function getDefaultExportFromCjs$1(x) {
1161
1161
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
1162
1162
  }
1163
- 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]/;
1164
- var regex$1 = /*@__PURE__*/getDefaultExportFromCjs$1(regex);
1163
+ var regex$1;
1164
+ var hasRequiredRegex;
1165
+ function requireRegex() {
1166
+ if (hasRequiredRegex) return regex$1;
1167
+ hasRequiredRegex = 1;
1168
+ regex$1 = /[\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]|\uD801[\uDDC9\uDDE4]|\uD804[\uDC9A\uDC9C\uDCAB\uDD2E\uDD2F\uDF4B\uDF4C\uDF83\uDF85\uDF8E\uDF91\uDFC5\uDFC7\uDFC8]|\uD805[\uDCBB\uDCBC\uDCBE\uDDBA\uDDBB]|\uD806\uDD38|\uD818[\uDD21-\uDD28]|\uD81B[\uDD68-\uDD6A]|\uD834[\uDD5E-\uDD64\uDDBB-\uDDC0]/;
1169
+ return regex$1;
1170
+ }
1171
+ var regexExports = requireRegex();
1172
+ var regex = /*@__PURE__*/getDefaultExportFromCjs$1(regexExports);
1165
1173
 
1166
1174
  /* eslint-disable new-cap -- ToString is how it is defined */
1175
+ /* eslint-disable sonarjs/no-control-regex -- Needed */
1167
1176
 
1168
1177
  /**
1169
1178
  * @typedef {number} Integer
@@ -1258,7 +1267,7 @@ function escapeDatabaseNameForSQLAndFiles(db) {
1258
1267
  db = 'D' + escapeNameForSQLiteIdentifier(db);
1259
1268
  if (CFG.escapeNFDForDatabaseNames !== false) {
1260
1269
  // ES6 copying of regex with different flags
1261
- db = db.replaceAll(new RegExp(regex$1, 'gu'), function (expandable) {
1270
+ db = db.replaceAll(new RegExp(regex, 'gu'), function (expandable) {
1262
1271
  return '^4' + /** @type {Integer} */expandable.codePointAt(0).toString(16).padStart(6, '0');
1263
1272
  });
1264
1273
  }
@@ -2082,7 +2091,6 @@ try {
2082
2091
  // Native DOMException works as expected
2083
2092
  useNativeDOMException = true;
2084
2093
  }
2085
- // eslint-disable-next-line no-unused-vars -- Problem with commonJS rollup
2086
2094
  } catch (err) {}
2087
2095
  const createDOMException = useNativeDOMException
2088
2096
  // eslint-disable-next-line @stylistic/operator-linebreak -- Need JSDoc
@@ -2689,7 +2697,7 @@ const signValues = ['negativeInfinity', 'bigNegative', 'smallNegative', 'smallPo
2689
2697
  * }
2690
2698
  * }}
2691
2699
  */
2692
- const types$1 = {
2700
+ const types = {
2693
2701
  invalid: {
2694
2702
  /**
2695
2703
  * @returns {string}
@@ -3191,7 +3199,7 @@ function convertValueToKeyValueDecoded(input, seen, multiEntry, fullKeys) {
3191
3199
  value: date.getTime()
3192
3200
  } : {
3193
3201
  type,
3194
- value: new Date(date.getTime())
3202
+ value: new Date(date)
3195
3203
  };
3196
3204
  }
3197
3205
  return {
@@ -3545,7 +3553,7 @@ function encode$1(key, inArray) {
3545
3553
  return null;
3546
3554
  }
3547
3555
  // array, date, number, string, binary (should already have detected "invalid")
3548
- return types$1[getKeyType(key)].encode(key, inArray);
3556
+ return types[getKeyType(key)].encode(key, inArray);
3549
3557
  }
3550
3558
 
3551
3559
  /**
@@ -3559,7 +3567,7 @@ function decode$1(key, inArray) {
3559
3567
  if (typeof key !== 'string') {
3560
3568
  return undefined;
3561
3569
  }
3562
- return types$1[encodedCharToKeyType[key.slice(0, 1)]].decode(key, inArray);
3570
+ return types[encodedCharToKeyType[key.slice(0, 1)]].decode(key, inArray);
3563
3571
  }
3564
3572
 
3565
3573
  /**
@@ -4011,7 +4019,6 @@ if (Object.defineProperty) {
4011
4019
  if (testObject.test) {
4012
4020
  cleanInterface = true;
4013
4021
  }
4014
- // eslint-disable-next-line no-unused-vars -- Problem with commonJS rollup
4015
4022
  } catch (err) {
4016
4023
  // Object.defineProperty does not work as intended.
4017
4024
  }
@@ -4875,7 +4882,6 @@ IDBTransaction.prototype.__abortTransaction = function (err) {
4875
4882
  }
4876
4883
  try {
4877
4884
  me.__tx.executeSql('ROLLBACK', [], abort, /** @type {SQLStatementErrorCallback} */abort); // Not working in some circumstances, even in Node
4878
- // eslint-disable-next-line no-unused-vars -- Problem with commonJS rollup
4879
4885
  } catch (err) {
4880
4886
  // Browser errs when transaction has ended and since it most likely already erred here,
4881
4887
  // we call to abort
@@ -4989,6 +4995,32 @@ Object.defineProperty(IDBTransaction, 'prototype', {
4989
4995
  writable: false
4990
4996
  });
4991
4997
 
4998
+ function _arrayLikeToArray(e, t) {
4999
+ (null == t || t > e.length) && (t = e.length);
5000
+ for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
5001
+ return n;
5002
+ }
5003
+ function _classCallCheck(e, t) {
5004
+ if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
5005
+ }
5006
+ function _createClass(e, t, r) {
5007
+ return t && function _defineProperties(e, t) {
5008
+ for (var r = 0; r < t.length; r++) {
5009
+ var n = t[r];
5010
+ n.enumerable = n.enumerable || false, n.configurable = true, "value" in n && (n.writable = true), Object.defineProperty(e, _toPropertyKey(n.key), n);
5011
+ }
5012
+ }(e.prototype, t), Object.defineProperty(e, "prototype", {
5013
+ writable: false
5014
+ }), e;
5015
+ }
5016
+ function _defineProperty(e, t, r) {
5017
+ return (t = _toPropertyKey(t)) in e ? Object.defineProperty(e, t, {
5018
+ value: r,
5019
+ enumerable: true,
5020
+ configurable: true,
5021
+ writable: true
5022
+ }) : e[t] = r, e;
5023
+ }
4992
5024
  function ownKeys(e, t) {
4993
5025
  var r = Object.keys(e);
4994
5026
  if (Object.getOwnPropertySymbols) {
@@ -5002,7 +5034,7 @@ function ownKeys(e, t) {
5002
5034
  function _objectSpread2(e) {
5003
5035
  for (var t = 1; t < arguments.length; t++) {
5004
5036
  var r = null != arguments[t] ? arguments[t] : {};
5005
- t % 2 ? ownKeys(Object(r), !0).forEach(function (t) {
5037
+ t % 2 ? ownKeys(Object(r), true).forEach(function (t) {
5006
5038
  _defineProperty(e, t, r[t]);
5007
5039
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : ownKeys(Object(r)).forEach(function (t) {
5008
5040
  Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
@@ -5010,34 +5042,6 @@ function _objectSpread2(e) {
5010
5042
  }
5011
5043
  return e;
5012
5044
  }
5013
- function _typeof(e) {
5014
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
5015
- return typeof e;
5016
- } : function (e) {
5017
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
5018
- }, _typeof(e);
5019
- }
5020
- function _classCallCheck(e, t) {
5021
- if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
5022
- }
5023
- function _createClass(e, t, r) {
5024
- return t && function _defineProperties(e, t) {
5025
- for (var r = 0; r < t.length; r++) {
5026
- var n = t[r];
5027
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, _toPropertyKey(n.key), n);
5028
- }
5029
- }(e.prototype, t), Object.defineProperty(e, "prototype", {
5030
- writable: !1
5031
- }), e;
5032
- }
5033
- function _defineProperty(e, t, r) {
5034
- return (t = _toPropertyKey(t)) in e ? Object.defineProperty(e, t, {
5035
- value: r,
5036
- enumerable: !0,
5037
- configurable: !0,
5038
- writable: !0
5039
- }) : e[t] = r, e;
5040
- }
5041
5045
  function _slicedToArray(e, t) {
5042
5046
  return function _arrayWithHoles(e) {
5043
5047
  if (Array.isArray(e)) return e;
@@ -5049,15 +5053,15 @@ function _slicedToArray(e, t) {
5049
5053
  o,
5050
5054
  i,
5051
5055
  c = [],
5052
- s = !0,
5053
- u = !1;
5056
+ s = true,
5057
+ u = false;
5054
5058
  try {
5055
5059
  if (o = (r = r.call(e)).next, 0 === t) {
5056
5060
  if (Object(r) !== r) return;
5057
5061
  s = !1;
5058
5062
  } else for (; !(s = (n = o.call(r)).done) && (c.push(n.value), c.length !== t); s = !0);
5059
5063
  } catch (e) {
5060
- u = !0, a = e;
5064
+ u = true, a = e;
5061
5065
  } finally {
5062
5066
  try {
5063
5067
  if (!s && null != r.return && (i = r.return(), Object(i) !== i)) return;
@@ -5071,30 +5075,32 @@ function _slicedToArray(e, t) {
5071
5075
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5072
5076
  }();
5073
5077
  }
5074
- function _unsupportedIterableToArray(e, t) {
5075
- if (e) {
5076
- if ("string" == typeof e) return _arrayLikeToArray(e, t);
5077
- var r = Object.prototype.toString.call(e).slice(8, -1);
5078
- return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? _arrayLikeToArray(e, t) : void 0;
5079
- }
5080
- }
5081
- function _arrayLikeToArray(e, t) {
5082
- (null == t || t > e.length) && (t = e.length);
5083
- for (var r = 0, n = new Array(t); r < t; r++) n[r] = e[r];
5084
- return n;
5085
- }
5086
5078
  function _toPropertyKey(e) {
5087
5079
  var t = function _toPrimitive(e, t) {
5088
- if ("object" != typeof e || null === e) return e;
5080
+ if ("object" != typeof e || !e) return e;
5089
5081
  var r = e[Symbol.toPrimitive];
5090
5082
  if (void 0 !== r) {
5091
5083
  var n = r.call(e, t);
5092
5084
  if ("object" != typeof n) return n;
5093
5085
  throw new TypeError("@@toPrimitive must return a primitive value.");
5094
5086
  }
5095
- return (String )(e);
5087
+ return String(e);
5096
5088
  }(e, "string");
5097
- return "symbol" == typeof t ? t : String(t);
5089
+ return "symbol" == typeof t ? t : t + "";
5090
+ }
5091
+ function _typeof(e) {
5092
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
5093
+ return typeof e;
5094
+ } : function (e) {
5095
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
5096
+ }, _typeof(e);
5097
+ }
5098
+ function _unsupportedIterableToArray(e, t) {
5099
+ if (e) {
5100
+ if ("string" == typeof e) return _arrayLikeToArray(e, t);
5101
+ var r = {}.toString.call(e).slice(8, -1);
5102
+ return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? _arrayLikeToArray(e, t) : void 0;
5103
+ }
5098
5104
  }
5099
5105
  var e = _createClass(function TypesonPromise(e) {
5100
5106
  _classCallCheck(this, TypesonPromise), this.p = new Promise(e);
@@ -5144,13 +5150,13 @@ e.__typeson__type__ = "TypesonPromise", "undefined" != typeof Symbol && Object.d
5144
5150
  var t = Object.hasOwn,
5145
5151
  r = Object.getPrototypeOf;
5146
5152
  function isThenable(e, t) {
5147
- return isObject(e) && "function" == typeof e.then && (!t);
5153
+ return isObject(e) && "function" == typeof e.then && (true || "function" == typeof e.catch);
5148
5154
  }
5149
5155
  function toStringTag(e) {
5150
5156
  return Object.prototype.toString.call(e).slice(8, -1);
5151
5157
  }
5152
5158
  function hasConstructorOf(e, n) {
5153
- if (!e || "object" !== _typeof(e)) return !1;
5159
+ if (!e || "object" !== _typeof(e)) return false;
5154
5160
  var a = r(e);
5155
5161
  if (!a) return null === n;
5156
5162
  var o = t(a, "constructor") && a.constructor;
@@ -5160,7 +5166,7 @@ function isPlainObject(e) {
5160
5166
  return !(!e || "Object" !== toStringTag(e)) && (!r(e) || hasConstructorOf(e, Object));
5161
5167
  }
5162
5168
  function isUserObject(e) {
5163
- if (!e || "Object" !== toStringTag(e)) return !1;
5169
+ if (!e || "Object" !== toStringTag(e)) return false;
5164
5170
  var t = r(e);
5165
5171
  return !t || hasConstructorOf(e, Object) || isUserObject(t);
5166
5172
  }
@@ -5177,7 +5183,7 @@ function getByKeyPath(e, t) {
5177
5183
  if ("" === t) return e;
5178
5184
  if (null === e || "object" !== _typeof(e)) throw new TypeError("Unexpected non-object type");
5179
5185
  var r = t.indexOf(".");
5180
- if (r > -1) {
5186
+ if (-1 !== r) {
5181
5187
  var n = e[unescapeKeyPathComponent(t.slice(0, r))];
5182
5188
  return void 0 === n ? void 0 : getByKeyPath(n, t.slice(r + 1));
5183
5189
  }
@@ -5186,8 +5192,9 @@ function getByKeyPath(e, t) {
5186
5192
  function setAtKeyPath(e, t, r) {
5187
5193
  if ("" === t) return r;
5188
5194
  if (!e || "object" !== _typeof(e)) throw new TypeError("Unexpected non-object type");
5195
+ if ("__proto__" === t) throw new TypeError("Invalid property");
5189
5196
  var n = t.indexOf(".");
5190
- return n > -1 ? setAtKeyPath(e[unescapeKeyPathComponent(t.slice(0, n))], t.slice(n + 1), r) : (e[unescapeKeyPathComponent(t)] = r, e);
5197
+ return -1 !== n ? setAtKeyPath(e[unescapeKeyPathComponent(t.slice(0, n))], t.slice(n + 1), r) : (e[unescapeKeyPathComponent(t)] = r, e);
5191
5198
  }
5192
5199
  function getJSONType(e) {
5193
5200
  return null === e ? "null" : Array.isArray(e) ? "array" : _typeof(e);
@@ -5198,7 +5205,7 @@ function _await(e, t, r) {
5198
5205
  var n = Object.keys,
5199
5206
  a = Object.hasOwn,
5200
5207
  o = Array.isArray,
5201
- i$1 = ["type", "replaced", "iterateIn", "iterateUnsetNumeric", "addLength"];
5208
+ i = ["type", "replaced", "iterateIn", "iterateUnsetNumeric", "addLength"];
5202
5209
  function _async(e) {
5203
5210
  return function () {
5204
5211
  for (var t = [], r = 0; r < arguments.length; r++) t[r] = arguments[r];
@@ -5216,498 +5223,494 @@ function nestedPathsFirst(e, t) {
5216
5223
  o = null !== (n = t.keypath.match(/\./g)) && void 0 !== n ? n : 0;
5217
5224
  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;
5218
5225
  }
5219
- var c = function () {
5220
- function Typeson(e) {
5221
- _classCallCheck(this, Typeson), this.options = e, this.plainObjectReplacers = [], this.nonplainObjectReplacers = [], this.revivers = {}, this.types = {};
5226
+ var c = _createClass(function Typeson(e) {
5227
+ _classCallCheck(this, Typeson), this.options = e, this.plainObjectReplacers = [], this.nonplainObjectReplacers = [], this.revivers = {}, this.types = {};
5228
+ }, [{
5229
+ key: "stringify",
5230
+ value: function stringify(e, t, r, n) {
5231
+ n = _objectSpread2(_objectSpread2(_objectSpread2({}, this.options), n), {}, {
5232
+ stringification: true
5233
+ });
5234
+ var a = this.encapsulate(e, null, n);
5235
+ return o(a) ? JSON.stringify(a[0], t, r) : a.then(function (e) {
5236
+ return JSON.stringify(e, t, r);
5237
+ });
5222
5238
  }
5223
- return _createClass(Typeson, [{
5224
- key: "stringify",
5225
- value: function stringify(e, t, r, n) {
5226
- n = _objectSpread2(_objectSpread2(_objectSpread2({}, this.options), n), {}, {
5227
- stringification: !0
5228
- });
5229
- var a = this.encapsulate(e, null, n);
5230
- return o(a) ? JSON.stringify(a[0], t, r) : a.then(function (e) {
5231
- return JSON.stringify(e, t, r);
5232
- });
5233
- }
5234
- }, {
5235
- key: "stringifySync",
5236
- value: function stringifySync(e, t, r, n) {
5237
- return this.stringify(e, t, r, _objectSpread2(_objectSpread2({
5238
- throwOnBadSyncType: !0
5239
- }, n), {}, {
5240
- sync: !0
5241
- }));
5242
- }
5243
- }, {
5244
- key: "stringifyAsync",
5245
- value: function stringifyAsync(e, t, r, n) {
5246
- return this.stringify(e, t, r, _objectSpread2(_objectSpread2({
5247
- throwOnBadSyncType: !0
5248
- }, n), {}, {
5249
- sync: !1
5250
- }));
5251
- }
5252
- }, {
5253
- key: "parse",
5254
- value: function parse(e, t, r) {
5255
- return r = _objectSpread2(_objectSpread2(_objectSpread2({}, this.options), r), {}, {
5256
- parse: !0
5257
- }), this.revive(JSON.parse(e, t), r);
5258
- }
5259
- }, {
5260
- key: "parseSync",
5261
- value: function parseSync(e, t, r) {
5262
- return this.parse(e, t, _objectSpread2(_objectSpread2({
5263
- throwOnBadSyncType: !0
5264
- }, r), {}, {
5265
- sync: !0
5266
- }));
5267
- }
5268
- }, {
5269
- key: "parseAsync",
5270
- value: function parseAsync(e, t, r) {
5271
- return this.parse(e, t, _objectSpread2(_objectSpread2({
5272
- throwOnBadSyncType: !0
5273
- }, r), {}, {
5274
- sync: !1
5275
- }));
5276
- }
5277
- }, {
5278
- key: "specialTypeNames",
5279
- value: function specialTypeNames(e, t) {
5280
- var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
5281
- return r.returnTypeNames = !0, this.encapsulate(e, t, r);
5282
- }
5283
- }, {
5284
- key: "rootTypeName",
5285
- value: function rootTypeName(e, t) {
5286
- var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
5287
- return r.iterateNone = !0, this.encapsulate(e, t, r);
5288
- }
5289
- }, {
5290
- key: "encapsulate",
5291
- value: function encapsulate(t, r, c) {
5292
- var s = this,
5293
- u = _objectSpread2(_objectSpread2({
5294
- sync: !0
5295
- }, this.options), c),
5296
- l = u.sync,
5297
- f = {},
5298
- y = [],
5299
- p = [],
5300
- d = [],
5301
- v = !("cyclic" in u) || u.cyclic,
5302
- m = u.encapsulateObserver,
5303
- b = function finish(e) {
5304
- var t = Object.values(f);
5305
- if (u.iterateNone) return t.length ? t[0] : getJSONType(e);
5306
- if (t.length) {
5307
- if (u.returnTypeNames) return function _toConsumableArray(e) {
5308
- return function _arrayWithoutHoles(e) {
5309
- if (Array.isArray(e)) return _arrayLikeToArray(e);
5310
- }(e) || function _iterableToArray(e) {
5311
- if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
5312
- }(e) || _unsupportedIterableToArray(e) || function _nonIterableSpread() {
5313
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5314
- }();
5315
- }(new Set(t));
5316
- e && isPlainObject(e) && !a(e, "$types") ? e.$types = f : e = {
5317
- $: e,
5318
- $types: {
5319
- $: f
5320
- }
5321
- };
5322
- } else isObject(e) && a(e, "$types") && (e = {
5239
+ }, {
5240
+ key: "stringifySync",
5241
+ value: function stringifySync(e, t, r, n) {
5242
+ return this.stringify(e, t, r, _objectSpread2(_objectSpread2({
5243
+ throwOnBadSyncType: true
5244
+ }, n), {}, {
5245
+ sync: true
5246
+ }));
5247
+ }
5248
+ }, {
5249
+ key: "stringifyAsync",
5250
+ value: function stringifyAsync(e, t, r, n) {
5251
+ return this.stringify(e, t, r, _objectSpread2(_objectSpread2({
5252
+ throwOnBadSyncType: true
5253
+ }, n), {}, {
5254
+ sync: false
5255
+ }));
5256
+ }
5257
+ }, {
5258
+ key: "parse",
5259
+ value: function parse(e, t, r) {
5260
+ return r = _objectSpread2(_objectSpread2(_objectSpread2({}, this.options), r), {}, {
5261
+ parse: true
5262
+ }), this.revive(JSON.parse(e, t), r);
5263
+ }
5264
+ }, {
5265
+ key: "parseSync",
5266
+ value: function parseSync(e, t, r) {
5267
+ return this.parse(e, t, _objectSpread2(_objectSpread2({
5268
+ throwOnBadSyncType: true
5269
+ }, r), {}, {
5270
+ sync: true
5271
+ }));
5272
+ }
5273
+ }, {
5274
+ key: "parseAsync",
5275
+ value: function parseAsync(e, t, r) {
5276
+ return this.parse(e, t, _objectSpread2(_objectSpread2({
5277
+ throwOnBadSyncType: true
5278
+ }, r), {}, {
5279
+ sync: false
5280
+ }));
5281
+ }
5282
+ }, {
5283
+ key: "specialTypeNames",
5284
+ value: function specialTypeNames(e, t) {
5285
+ var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
5286
+ return r.returnTypeNames = true, this.encapsulate(e, t, r);
5287
+ }
5288
+ }, {
5289
+ key: "rootTypeName",
5290
+ value: function rootTypeName(e, t) {
5291
+ var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
5292
+ return r.iterateNone = true, this.encapsulate(e, t, r);
5293
+ }
5294
+ }, {
5295
+ key: "encapsulate",
5296
+ value: function encapsulate(t, r, c) {
5297
+ var s = this,
5298
+ u = _objectSpread2(_objectSpread2({
5299
+ sync: true
5300
+ }, this.options), c),
5301
+ l = u.sync,
5302
+ f = {},
5303
+ y = [],
5304
+ p = [],
5305
+ d = [],
5306
+ v = !("cyclic" in u) || u.cyclic,
5307
+ b = u.encapsulateObserver,
5308
+ m = function finish(e) {
5309
+ var t = Object.values(f);
5310
+ if (u.iterateNone) return t.length ? t[0] : getJSONType(e);
5311
+ if (t.length) {
5312
+ if (u.returnTypeNames) return function _toConsumableArray(e) {
5313
+ return function _arrayWithoutHoles(e) {
5314
+ if (Array.isArray(e)) return _arrayLikeToArray(e);
5315
+ }(e) || function _iterableToArray(e) {
5316
+ if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
5317
+ }(e) || _unsupportedIterableToArray(e) || function _nonIterableSpread() {
5318
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5319
+ }();
5320
+ }(new Set(t));
5321
+ e && isPlainObject(e) && !a(e, "$types") ? e.$types = f : e = {
5323
5322
  $: e,
5324
- $types: !0
5325
- });
5326
- return !u.returnTypeNames && e;
5327
- },
5328
- h = _async(function (t, r) {
5329
- return _await(Promise.all(r.map(function (e) {
5330
- return e[1].p;
5331
- })), function (n) {
5332
- return _await(Promise.all(n.map(_async(function (n) {
5333
- var a = !1,
5334
- o = [],
5335
- i = _slicedToArray(r.splice(0, 1), 1),
5336
- c = _slicedToArray(i[0], 7),
5337
- s = c[0],
5338
- u = c[2],
5339
- l = c[3],
5340
- f = c[4],
5341
- y = c[5],
5342
- p = c[6],
5343
- d = O(s, n, u, l, o, !0, p),
5344
- v = hasConstructorOf(d, e);
5345
- return function _invoke(e, t) {
5346
- var r = e();
5347
- return r && r.then ? r.then(t) : t(r);
5348
- }(function () {
5349
- if (s && v) return _await(d.p, function (e) {
5350
- f[y] = e;
5351
- var r = h(t, o);
5352
- return a = !0, r;
5353
- });
5354
- }, function (e) {
5355
- return a ? e : (s ? f[y] = d : t = v ? d.p : d, h(t, o));
5323
+ $types: {
5324
+ $: f
5325
+ }
5326
+ };
5327
+ } else isObject(e) && a(e, "$types") && (e = {
5328
+ $: e,
5329
+ $types: true
5330
+ });
5331
+ return !u.returnTypeNames && e;
5332
+ },
5333
+ h = _async(function (t, r) {
5334
+ return _await(Promise.all(r.map(function (e) {
5335
+ return e[1].p;
5336
+ })), function (n) {
5337
+ return _await(Promise.all(n.map(_async(function (n) {
5338
+ var a = false,
5339
+ o = [],
5340
+ i = _slicedToArray(r.splice(0, 1), 1),
5341
+ c = _slicedToArray(i[0], 7),
5342
+ s = c[0],
5343
+ u = c[2],
5344
+ l = c[3],
5345
+ f = c[4],
5346
+ y = c[5],
5347
+ p = c[6],
5348
+ d = O(s, n, u, l, o, true, p),
5349
+ v = hasConstructorOf(d, e);
5350
+ return function _invoke(e, t) {
5351
+ var r = e();
5352
+ return r && r.then ? r.then(t) : t(r);
5353
+ }(function () {
5354
+ if (s && v) return _await(d.p, function (e) {
5355
+ f[y] = e;
5356
+ var r = h(t, o);
5357
+ return a = true, r;
5356
5358
  });
5357
- }))), function () {
5358
- return t;
5359
+ }, function (e) {
5360
+ return a ? e : (s ? f[y] = d : t = v ? d.p : d, h(t, o));
5359
5361
  });
5362
+ }))), function () {
5363
+ return t;
5360
5364
  });
5361
- }),
5362
- g = function _adaptBuiltinStateObjectProperties(e, t, r) {
5363
- Object.assign(e, t);
5364
- var n = i$1.map(function (t) {
5365
- var r = e[t];
5366
- return delete e[t], r;
5367
- });
5368
- r(), i$1.forEach(function (t, r) {
5369
- e[t] = n[r];
5370
- });
5371
- },
5372
- O = function _encapsulate(t, r, i, c, l, d, v) {
5373
- var b,
5374
- h = {},
5375
- O = _typeof(r),
5376
- _ = m ? function (n) {
5377
- var a,
5378
- o = null !== (a = null != v ? v : c.type) && void 0 !== a ? a : getJSONType(r);
5379
- m(Object.assign(null != n ? n : h, {
5380
- keypath: t,
5381
- value: r,
5382
- cyclic: i,
5383
- stateObj: c,
5384
- promisesData: l,
5385
- resolvingTypesonPromise: d,
5386
- awaitingTypesonPromise: hasConstructorOf(r, e)
5387
- }, {
5388
- type: o
5389
- }));
5390
- } : null;
5391
- if (["string", "boolean", "number", "undefined"].includes(O)) return void 0 === r || Number.isNaN(r) || r === Number.NEGATIVE_INFINITY || r === Number.POSITIVE_INFINITY || 0 === r ? (b = c.replaced ? r : w(t, r, c, l, !1, d, _)) !== r && (h = {
5392
- replaced: b
5393
- }) : b = r, _ && _(), b;
5394
- if (null === r) return _ && _(), r;
5395
- if (i && !c.iterateIn && !c.iterateUnsetNumeric && r && "object" === _typeof(r)) {
5396
- var A = y.indexOf(r);
5397
- if (!(A < 0)) return f[t] = "#", _ && _({
5398
- cyclicKeypath: p[A]
5399
- }), "#" + p[A];
5400
- !0 === i && (y.push(r), p.push(t));
5401
- }
5402
- var S,
5403
- j,
5404
- T = isPlainObject(r),
5405
- I = o(r),
5406
- N = (T || I) && (!s.plainObjectReplacers.length || c.replaced) || c.iterateIn ? r : w(t, r, c, l, T || I, null, _);
5407
- if (N !== r ? (b = N, h = {
5408
- replaced: N
5409
- }) : "" === t && hasConstructorOf(r, e) ? (l.push([t, r, i, c, void 0, void 0, c.type]), b = r) : I && "object" !== c.iterateIn || "array" === c.iterateIn ? (S = new Array(r.length), h = {
5410
- clone: S
5411
- }) : (["function", "symbol"].includes(_typeof(r)) || "toJSON" in r || hasConstructorOf(r, e) || hasConstructorOf(r, Promise) || hasConstructorOf(r, ArrayBuffer)) && !T && "object" !== c.iterateIn ? b = r : (S = {}, c.addLength && (S.length = r.length), h = {
5412
- clone: S
5413
- }), _ && _(), u.iterateNone) return null !== (j = S) && void 0 !== j ? j : b;
5414
- if (!S) return b;
5415
- if (c.iterateIn) {
5416
- var P = function _loop(n) {
5417
- var o = {
5418
- ownKeys: a(r, n)
5419
- };
5420
- g(c, o, function () {
5421
- var a = t + (t ? "." : "") + escapeKeyPathComponent(n),
5422
- o = _encapsulate(a, r[n], Boolean(i), c, l, d);
5423
- hasConstructorOf(o, e) ? l.push([a, o, Boolean(i), c, S, n, c.type]) : void 0 !== o && (S[n] = o);
5424
- });
5365
+ });
5366
+ }),
5367
+ g = function _adaptBuiltinStateObjectProperties(e, t, r) {
5368
+ Object.assign(e, t);
5369
+ var n = i.map(function (t) {
5370
+ var r = e[t];
5371
+ return delete e[t], r;
5372
+ });
5373
+ r(), i.forEach(function (t, r) {
5374
+ e[t] = n[r];
5375
+ });
5376
+ },
5377
+ O = function _encapsulate(t, r, i, c, l, d, v) {
5378
+ var m,
5379
+ h = {},
5380
+ _ = _typeof(r),
5381
+ A = b ? function (n) {
5382
+ var a,
5383
+ o = null !== (a = null != v ? v : c.type) && void 0 !== a ? a : getJSONType(r);
5384
+ b(Object.assign(null != n ? n : h, {
5385
+ keypath: t,
5386
+ value: r,
5387
+ cyclic: i,
5388
+ stateObj: c,
5389
+ promisesData: l,
5390
+ resolvingTypesonPromise: d,
5391
+ awaitingTypesonPromise: hasConstructorOf(r, e)
5392
+ }, {
5393
+ type: o
5394
+ }));
5395
+ } : null;
5396
+ if (["string", "boolean", "number", "undefined"].includes(_)) return void 0 === r || Number.isNaN(r) || r === Number.NEGATIVE_INFINITY || r === Number.POSITIVE_INFINITY || 0 === r ? (m = c.replaced ? r : w(t, r, c, l, false, d, A)) !== r && (h = {
5397
+ replaced: m
5398
+ }) : m = r, A && A(), m;
5399
+ if (null === r) return A && A(), r;
5400
+ if (i && !c.iterateIn && !c.iterateUnsetNumeric && r && "object" === _typeof(r)) {
5401
+ var S = y.indexOf(r);
5402
+ if (-1 !== S) return f[t] = "#", A && A({
5403
+ cyclicKeypath: p[S]
5404
+ }), "#" + p[S];
5405
+ true === i && (y.push(r), p.push(t));
5406
+ }
5407
+ var j,
5408
+ T = isPlainObject(r),
5409
+ I = o(r),
5410
+ N = (T || I) && (!s.plainObjectReplacers.length || c.replaced) || c.iterateIn ? r : w(t, r, c, l, T || I, null, A);
5411
+ if (N !== r ? (m = N, h = {
5412
+ replaced: N
5413
+ }) : "" === t && hasConstructorOf(r, e) ? (l.push([t, r, i, c, void 0, void 0, c.type]), m = r) : I && "object" !== c.iterateIn || "array" === c.iterateIn ? (j = new Array(r.length), h = {
5414
+ clone: j
5415
+ }) : (["function", "symbol"].includes(_typeof(r)) || "toJSON" in r || hasConstructorOf(r, e) || hasConstructorOf(r, Promise) || hasConstructorOf(r, ArrayBuffer)) && !T && "object" !== c.iterateIn ? m = r : (j = {}, c.addLength && (j.length = r.length), h = {
5416
+ clone: j
5417
+ }), A && A(), u.iterateNone) return null != j ? j : m;
5418
+ if (!j) return m;
5419
+ if (c.iterateIn) {
5420
+ var P = function _loop(n) {
5421
+ var o = {
5422
+ ownKeys: a(r, n)
5425
5423
  };
5426
- for (var x in r) P(x);
5427
- _ && _({
5428
- endIterateIn: !0,
5429
- end: !0
5424
+ g(c, o, function () {
5425
+ var a = t + (t ? "." : "") + escapeKeyPathComponent(n),
5426
+ o = O(a, r[n], Boolean(i), c, l, d);
5427
+ hasConstructorOf(o, e) ? l.push([a, o, Boolean(i), c, j, n, c.type]) : void 0 !== o && (j[n] = o);
5430
5428
  });
5431
- } else n(r).forEach(function (n) {
5432
- var a = t + (t ? "." : "") + escapeKeyPathComponent(n);
5433
- g(c, {
5434
- ownKeys: !0
5435
- }, function () {
5436
- var t = _encapsulate(a, r[n], Boolean(i), c, l, d);
5437
- hasConstructorOf(t, e) ? l.push([a, t, Boolean(i), c, S, n, c.type]) : void 0 !== t && (S[n] = t);
5438
- });
5439
- }), _ && _({
5440
- endIterateOwn: !0,
5441
- end: !0
5429
+ };
5430
+ for (var x in r) P(x);
5431
+ A && A({
5432
+ endIterateIn: true,
5433
+ end: true
5442
5434
  });
5443
- if (c.iterateUnsetNumeric) {
5444
- for (var E = r.length, C = function _loop2(n) {
5445
- if (!(n in r)) {
5446
- var a = "".concat(t).concat(t ? "." : "").concat(n);
5447
- g(c, {
5448
- ownKeys: !1
5449
- }, function () {
5450
- var t = _encapsulate(a, void 0, Boolean(i), c, l, d);
5451
- hasConstructorOf(t, e) ? l.push([a, t, Boolean(i), c, S, n, c.type]) : void 0 !== t && (S[n] = t);
5452
- });
5453
- }
5454
- }, B = 0; B < E; B++) C(B);
5455
- _ && _({
5456
- endIterateUnsetNumeric: !0,
5457
- end: !0
5458
- });
5459
- }
5460
- return S;
5461
- },
5462
- w = function replace(e, t, r, n, a, o, i) {
5463
- for (var c = a ? s.plainObjectReplacers : s.nonplainObjectReplacers, u = c.length; u--;) {
5464
- var y = c[u];
5465
- if (y.test(t, r)) {
5466
- var p = y.type;
5467
- if (s.revivers[p]) {
5468
- var d = f[e];
5469
- f[e] = d ? [p].concat(d) : p;
5435
+ } else n(r).forEach(function (n) {
5436
+ var a = t + (t ? "." : "") + escapeKeyPathComponent(n);
5437
+ g(c, {
5438
+ ownKeys: true
5439
+ }, function () {
5440
+ var t = O(a, r[n], Boolean(i), c, l, d);
5441
+ hasConstructorOf(t, e) ? l.push([a, t, Boolean(i), c, j, n, c.type]) : void 0 !== t && (j[n] = t);
5442
+ });
5443
+ }), A && A({
5444
+ endIterateOwn: true,
5445
+ end: true
5446
+ });
5447
+ if (c.iterateUnsetNumeric) {
5448
+ for (var E = r.length, C = function _loop2(n) {
5449
+ if (!(n in r)) {
5450
+ var a = "".concat(t).concat(t ? "." : "").concat(String(n));
5451
+ g(c, {
5452
+ ownKeys: false
5453
+ }, function () {
5454
+ var t = O(a, void 0, Boolean(i), c, l, d);
5455
+ hasConstructorOf(t, e) ? l.push([a, t, Boolean(i), c, j, n, c.type]) : void 0 !== t && (j[n] = t);
5456
+ });
5470
5457
  }
5471
- if (Object.assign(r, {
5472
- type: p,
5473
- replaced: !0
5474
- }), (l || !y.replaceAsync) && !y.replace) return i && i({
5475
- typeDetected: !0
5476
- }), O(e, t, v && "readonly", r, n, o, p);
5477
- i && i({
5478
- replacing: !0
5479
- });
5480
- var m = void 0;
5481
- if (l || !y.replaceAsync) {
5482
- if (void 0 === y.replace) throw new TypeError("Missing replacer");
5483
- m = y.replace(t, r);
5484
- } else m = y.replaceAsync(t, r);
5485
- return O(e, m, v && "readonly", r, n, o, p);
5458
+ }, B = 0; B < E; B++) C(B);
5459
+ A && A({
5460
+ endIterateUnsetNumeric: true,
5461
+ end: true
5462
+ });
5463
+ }
5464
+ return j;
5465
+ },
5466
+ w = function replace(e, t, r, n, a, o, i) {
5467
+ for (var c = a ? s.plainObjectReplacers : s.nonplainObjectReplacers, u = c.length; u--;) {
5468
+ var y = c[u];
5469
+ if (y.test(t, r)) {
5470
+ var p = y.type;
5471
+ if (s.revivers[p]) {
5472
+ var d = f[e];
5473
+ f[e] = d ? [p].concat(d) : p;
5486
5474
  }
5487
- }
5488
- return t;
5489
- },
5490
- _ = O("", t, v, null != r ? r : {}, d);
5491
- if (d.length) return l && u.throwOnBadSyncType ? function () {
5492
- throw new TypeError("Sync method requested but async result obtained");
5493
- }() : Promise.resolve(h(_, d)).then(b);
5494
- if (!l && u.throwOnBadSyncType) throw new TypeError("Async method requested but sync result obtained");
5495
- return u.stringification && l ? [b(_)] : l ? b(_) : Promise.resolve(b(_));
5496
- }
5497
- }, {
5498
- key: "encapsulateSync",
5499
- value: function encapsulateSync(e, t, r) {
5500
- return this.encapsulate(e, t, _objectSpread2(_objectSpread2({
5501
- throwOnBadSyncType: !0
5502
- }, r), {}, {
5503
- sync: !0
5504
- }));
5505
- }
5506
- }, {
5507
- key: "encapsulateAsync",
5508
- value: function encapsulateAsync(e, t, r) {
5509
- return this.encapsulate(e, t, _objectSpread2(_objectSpread2({
5510
- throwOnBadSyncType: !0
5511
- }, r), {}, {
5512
- sync: !1
5513
- }));
5514
- }
5515
- }, {
5516
- key: "revive",
5517
- value: function revive(t, r) {
5518
- var a = this,
5519
- i = _objectSpread2(_objectSpread2({
5520
- sync: !0
5521
- }, this.options), r),
5522
- c = i.sync;
5523
- function finishRevival(e) {
5524
- if (c) return e;
5525
- if (i.throwOnBadSyncType) throw new TypeError("Async method requested but sync result obtained");
5526
- return Promise.resolve(e);
5527
- }
5528
- if (!t || "object" !== _typeof(t) || Array.isArray(t)) return finishRevival(t);
5529
- var u = t.$types;
5530
- if (!0 === u) return finishRevival(t.$);
5531
- if (!u || "object" !== _typeof(u) || Array.isArray(u)) return finishRevival(t);
5532
- var l = [],
5533
- f = {},
5534
- y = !0;
5535
- u.$ && isPlainObject(u.$) && (t = t.$, u = u.$, y = !1);
5536
- var p = function executeReviver(e, t) {
5537
- var r,
5538
- n = _slicedToArray(null !== (r = a.revivers[e]) && void 0 !== r ? r : [], 1)[0];
5539
- if (!n) throw new Error("Unregistered type: " + e);
5540
- if (c && !("revive" in n)) return t;
5541
- if (!c && n.reviveAsync) return n.reviveAsync(t, f);
5542
- if (n.revive) return n.revive(t, f);
5543
- throw new Error("Missing reviver");
5544
- },
5545
- d = [];
5546
- function checkUndefined(e) {
5547
- return hasConstructorOf(e, s) ? void 0 : e;
5548
- }
5549
- var v,
5550
- m = function revivePlainObjects() {
5551
- var r = [];
5552
- if (!u) throw new Error("Found bad `types`");
5553
- if (Object.entries(u).forEach(function (e) {
5554
- var t = _slicedToArray(e, 2),
5555
- n = t[0],
5556
- o = t[1];
5557
- "#" !== o && [].concat(o).forEach(function (e) {
5558
- var t;
5559
- _slicedToArray(null !== (t = a.revivers[e]) && void 0 !== t ? t : [null, {}], 2)[1].plain && (r.push({
5560
- keypath: n,
5561
- type: e
5562
- }), delete u[n]);
5563
- });
5564
- }), r.length) return r.sort(nestedPathsFirst).reduce(function reducer(r, n) {
5565
- var a = n.keypath,
5566
- o = n.type;
5567
- if (isThenable(r)) return r.then(function (e) {
5568
- return reducer(e, {
5569
- keypath: a,
5570
- type: o
5571
- });
5475
+ if (Object.assign(r, {
5476
+ type: p,
5477
+ replaced: true
5478
+ }), (l || !y.replaceAsync) && !y.replace) return i && i({
5479
+ typeDetected: true
5480
+ }), O(e, t, v && "readonly", r, n, o, p);
5481
+ i && i({
5482
+ replacing: true
5572
5483
  });
5573
- var i = getByKeyPath(t, a);
5574
- if (hasConstructorOf(i = p(o, i), e)) return i.then(function (e) {
5575
- var r = setAtKeyPath(t, a, e);
5576
- r === e && (t = r);
5577
- });
5578
- var c = setAtKeyPath(t, a, i);
5579
- c === i && (t = c);
5580
- }, void 0);
5581
- }();
5582
- return hasConstructorOf(m, e) ? v = m.then(function () {
5583
- return t;
5584
- }) : (v = function _revive(t, r, a, i, c) {
5585
- if (!y || "$types" !== t) {
5586
- var f = u[t],
5587
- v = o(r);
5588
- if (v || isPlainObject(r)) {
5589
- var m = v ? new Array(r.length) : {};
5590
- for (n(r).forEach(function (n) {
5591
- var o = _revive(t + (t ? "." : "") + escapeKeyPathComponent(n), r[n], null != a ? a : m, m, n),
5592
- i = function set(e) {
5593
- return hasConstructorOf(e, s) ? m[n] = void 0 : void 0 !== e && (m[n] = e), e;
5594
- };
5595
- hasConstructorOf(o, e) ? d.push(o.then(function (e) {
5596
- return i(e);
5597
- })) : i(o);
5598
- }), r = m; l.length;) {
5599
- var b = _slicedToArray(l[0], 4),
5600
- h = b[0],
5601
- g = b[1],
5602
- O = b[2],
5603
- w = b[3],
5604
- _ = getByKeyPath(h, g);
5605
- if (void 0 === _) break;
5606
- O[w] = _, l.splice(0, 1);
5607
- }
5608
- }
5609
- if (!f) return r;
5610
- if ("#" === f) {
5611
- var A = getByKeyPath(a, r.slice(1));
5612
- return void 0 === A && l.push([a, r.slice(1), i, c]), A;
5484
+ var b = void 0;
5485
+ if (l || !y.replaceAsync) {
5486
+ if (void 0 === y.replace) throw new TypeError("Missing replacer");
5487
+ b = y.replace(t, r);
5488
+ } else b = y.replaceAsync(t, r);
5489
+ return O(e, b, v && "readonly", r, n, o, p);
5613
5490
  }
5614
- return [].concat(f).reduce(function reducer(t, r) {
5615
- if (hasConstructorOf(t, e)) return t.then(function (e) {
5616
- return reducer(e, r);
5617
- });
5618
- if ("string" != typeof r) throw new TypeError("Bad type JSON");
5619
- return p(r, t);
5620
- }, r);
5621
5491
  }
5622
- }("", t, null), d.length && (v = e.resolve(v).then(function (t) {
5623
- return e.all([t].concat(d));
5624
- }).then(function (e) {
5625
- return _slicedToArray(e, 1)[0];
5626
- }))), isThenable(v) ? c && i.throwOnBadSyncType ? function () {
5627
- throw new TypeError("Sync method requested but async result obtained");
5628
- }() : hasConstructorOf(v, e) ? v.p.then(checkUndefined) : v : !c && i.throwOnBadSyncType ? function () {
5629
- throw new TypeError("Async method requested but sync result obtained");
5630
- }() : c ? checkUndefined(v) : Promise.resolve(checkUndefined(v));
5631
- }
5632
- }, {
5633
- key: "reviveSync",
5634
- value: function reviveSync(e, t) {
5635
- return this.revive(e, _objectSpread2(_objectSpread2({
5636
- throwOnBadSyncType: !0
5637
- }, t), {}, {
5638
- sync: !0
5639
- }));
5640
- }
5641
- }, {
5642
- key: "reviveAsync",
5643
- value: function reviveAsync(e, t) {
5644
- return this.revive(e, _objectSpread2(_objectSpread2({
5645
- throwOnBadSyncType: !0
5646
- }, t), {}, {
5647
- sync: !1
5648
- }));
5649
- }
5650
- }, {
5651
- key: "register",
5652
- value: function register(e, t) {
5653
- var r = this,
5654
- a = null != t ? t : {},
5655
- i = function R(e) {
5656
- o(e) ? e.forEach(function (e) {
5657
- return R(e);
5658
- }) : n(e).forEach(function (t) {
5659
- var n;
5660
- if ("#" === t) throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");
5661
- if (u.includes(t)) throw new TypeError("Plain JSON object types are reserved as type names");
5662
- var i = e[t],
5663
- c = i && "function" != typeof i && !Array.isArray(i) && i.testPlainObjects ? r.plainObjectReplacers : r.nonplainObjectReplacers,
5664
- s = c.filter(function (e) {
5665
- return e.type === t;
5666
- });
5667
- if (s.length && (c.splice(c.indexOf(s[0]), 1), delete r.revivers[t], delete r.types[t]), "function" == typeof i) {
5668
- var l = i;
5669
- i = {
5670
- test: function test(e) {
5671
- return e && e.constructor === l;
5672
- },
5673
- replace: function replace(e) {
5674
- return _objectSpread2({}, e);
5675
- },
5676
- revive: function revive(e) {
5677
- return Object.assign(Object.create(l.prototype), e);
5678
- }
5679
- };
5680
- } else if (o(i)) {
5681
- var f = _slicedToArray(i, 3);
5682
- i = {
5683
- test: f[0],
5684
- replace: f[1],
5685
- revive: f[2]
5686
- };
5687
- }
5688
- if (null !== (n = i) && void 0 !== n && n.test) {
5689
- var y = {
5690
- type: t,
5691
- test: i.test.bind(i)
5492
+ return t;
5493
+ },
5494
+ _ = O("", t, v, null != r ? r : {}, d);
5495
+ if (d.length) return l && u.throwOnBadSyncType ? function () {
5496
+ throw new TypeError("Sync method requested but async result obtained");
5497
+ }() : Promise.resolve(h(_, d)).then(m);
5498
+ if (!l && u.throwOnBadSyncType) throw new TypeError("Async method requested but sync result obtained");
5499
+ return u.stringification && l ? [m(_)] : l ? m(_) : Promise.resolve(m(_));
5500
+ }
5501
+ }, {
5502
+ key: "encapsulateSync",
5503
+ value: function encapsulateSync(e, t, r) {
5504
+ return this.encapsulate(e, t, _objectSpread2(_objectSpread2({
5505
+ throwOnBadSyncType: true
5506
+ }, r), {}, {
5507
+ sync: true
5508
+ }));
5509
+ }
5510
+ }, {
5511
+ key: "encapsulateAsync",
5512
+ value: function encapsulateAsync(e, t, r) {
5513
+ return this.encapsulate(e, t, _objectSpread2(_objectSpread2({
5514
+ throwOnBadSyncType: true
5515
+ }, r), {}, {
5516
+ sync: false
5517
+ }));
5518
+ }
5519
+ }, {
5520
+ key: "revive",
5521
+ value: function revive(t, r) {
5522
+ var a = this,
5523
+ i = _objectSpread2(_objectSpread2({
5524
+ sync: true
5525
+ }, this.options), r),
5526
+ c = i.sync;
5527
+ function finishRevival(e) {
5528
+ if (c) return e;
5529
+ if (i.throwOnBadSyncType) throw new TypeError("Async method requested but sync result obtained");
5530
+ return Promise.resolve(e);
5531
+ }
5532
+ if (!t || "object" !== _typeof(t) || Array.isArray(t)) return finishRevival(t);
5533
+ var u = t.$types;
5534
+ if (true === u) return finishRevival(t.$);
5535
+ if (!u || "object" !== _typeof(u) || Array.isArray(u)) return finishRevival(t);
5536
+ var l = [],
5537
+ f = {},
5538
+ y = true;
5539
+ u.$ && isPlainObject(u.$) && (t = t.$, u = u.$, y = false);
5540
+ var p = function executeReviver(e, t) {
5541
+ var r,
5542
+ n = _slicedToArray(null !== (r = a.revivers[e]) && void 0 !== r ? r : [], 1)[0];
5543
+ if (!n) throw new Error("Unregistered type: " + e);
5544
+ if (c && !("revive" in n)) return t;
5545
+ if (!c && n.reviveAsync) return n.reviveAsync(t, f);
5546
+ if (n.revive) return n.revive(t, f);
5547
+ throw new Error("Missing reviver");
5548
+ },
5549
+ d = [];
5550
+ function checkUndefined(e) {
5551
+ return hasConstructorOf(e, s) ? void 0 : e;
5552
+ }
5553
+ var v,
5554
+ b = function revivePlainObjects() {
5555
+ var r = [];
5556
+ if (!u) throw new Error("Found bad `types`");
5557
+ if (Object.entries(u).forEach(function (e) {
5558
+ var t = _slicedToArray(e, 2),
5559
+ n = t[0],
5560
+ o = t[1];
5561
+ "#" !== o && [].concat(o).forEach(function (e) {
5562
+ var t;
5563
+ _slicedToArray(null !== (t = a.revivers[e]) && void 0 !== t ? t : [null, {}], 2)[1].plain && (r.push({
5564
+ keypath: n,
5565
+ type: e
5566
+ }), delete u[n]);
5567
+ });
5568
+ }), r.length) return r.sort(nestedPathsFirst), r.reduce(function reducer(r, n) {
5569
+ var a = n.keypath,
5570
+ o = n.type;
5571
+ if (isThenable(r)) return r.then(function (e) {
5572
+ return reducer(e, {
5573
+ keypath: a,
5574
+ type: o
5575
+ });
5576
+ });
5577
+ var i = getByKeyPath(t, a);
5578
+ if (hasConstructorOf(i = p(o, i), e)) return i.then(function (e) {
5579
+ var r = setAtKeyPath(t, a, e);
5580
+ r === e && (t = r);
5581
+ });
5582
+ var c = setAtKeyPath(t, a, i);
5583
+ c === i && (t = c);
5584
+ }, void 0);
5585
+ }();
5586
+ return hasConstructorOf(b, e) ? v = b.then(function () {
5587
+ return t;
5588
+ }) : (v = function _revive(t, r, a, i, c) {
5589
+ if (!y || "$types" !== t) {
5590
+ var f = u[t],
5591
+ v = o(r);
5592
+ if (v || isPlainObject(r)) {
5593
+ var b = v ? new Array(r.length) : {};
5594
+ for (n(r).forEach(function (n) {
5595
+ var o = _revive(t + (t ? "." : "") + escapeKeyPathComponent(n), r[n], null != a ? a : b, b, n),
5596
+ i = function set(e) {
5597
+ return hasConstructorOf(e, s) ? b[n] = void 0 : void 0 !== e && (b[n] = e), e;
5692
5598
  };
5693
- i.replace && (y.replace = i.replace.bind(i)), i.replaceAsync && (y.replaceAsync = i.replaceAsync.bind(i));
5694
- var p = "number" == typeof a.fallback ? a.fallback : a.fallback ? 0 : Number.POSITIVE_INFINITY;
5695
- if (i.testPlainObjects ? r.plainObjectReplacers.splice(p, 0, y) : r.nonplainObjectReplacers.splice(p, 0, y), i.revive || i.reviveAsync) {
5696
- var d = {};
5697
- i.revive && (d.revive = i.revive.bind(i)), i.reviveAsync && (d.reviveAsync = i.reviveAsync.bind(i)), r.revivers[t] = [d, {
5698
- plain: i.testPlainObjects
5699
- }];
5599
+ hasConstructorOf(o, e) ? d.push(o.then(function (e) {
5600
+ return i(e);
5601
+ })) : i(o);
5602
+ }), r = b; l.length;) {
5603
+ var m = _slicedToArray(l[0], 4),
5604
+ h = m[0],
5605
+ g = m[1],
5606
+ O = m[2],
5607
+ w = m[3],
5608
+ _ = getByKeyPath(h, g);
5609
+ if (void 0 === _) break;
5610
+ O[w] = _, l.splice(0, 1);
5611
+ }
5612
+ }
5613
+ if (!f) return r;
5614
+ if ("#" === f) {
5615
+ var A = getByKeyPath(a, r.slice(1));
5616
+ return void 0 === A && l.push([a, r.slice(1), i, c]), A;
5617
+ }
5618
+ return [].concat(f).reduce(function reducer(t, r) {
5619
+ if (hasConstructorOf(t, e)) return t.then(function (e) {
5620
+ return reducer(e, r);
5621
+ });
5622
+ if ("string" != typeof r) throw new TypeError("Bad type JSON");
5623
+ return p(r, t);
5624
+ }, r);
5625
+ }
5626
+ }("", t, null), d.length && (v = e.resolve(v).then(function (t) {
5627
+ return e.all([t].concat(d));
5628
+ }).then(function (e) {
5629
+ return _slicedToArray(e, 1)[0];
5630
+ }))), isThenable(v) ? c && i.throwOnBadSyncType ? function () {
5631
+ throw new TypeError("Sync method requested but async result obtained");
5632
+ }() : hasConstructorOf(v, e) ? v.p.then(checkUndefined) : v : !c && i.throwOnBadSyncType ? function () {
5633
+ throw new TypeError("Async method requested but sync result obtained");
5634
+ }() : c ? checkUndefined(v) : Promise.resolve(checkUndefined(v));
5635
+ }
5636
+ }, {
5637
+ key: "reviveSync",
5638
+ value: function reviveSync(e, t) {
5639
+ return this.revive(e, _objectSpread2(_objectSpread2({
5640
+ throwOnBadSyncType: true
5641
+ }, t), {}, {
5642
+ sync: true
5643
+ }));
5644
+ }
5645
+ }, {
5646
+ key: "reviveAsync",
5647
+ value: function reviveAsync(e, t) {
5648
+ return this.revive(e, _objectSpread2(_objectSpread2({
5649
+ throwOnBadSyncType: true
5650
+ }, t), {}, {
5651
+ sync: false
5652
+ }));
5653
+ }
5654
+ }, {
5655
+ key: "register",
5656
+ value: function register(e, t) {
5657
+ var r = this,
5658
+ a = null != t ? t : {},
5659
+ i = function reg(e) {
5660
+ o(e) ? e.forEach(function (e) {
5661
+ i(e);
5662
+ }) : n(e).forEach(function (t) {
5663
+ var n;
5664
+ if ("#" === t) throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");
5665
+ if (u.includes(t)) throw new TypeError("Plain JSON object types are reserved as type names");
5666
+ var i = e[t],
5667
+ c = i && "function" != typeof i && !Array.isArray(i) && i.testPlainObjects ? r.plainObjectReplacers : r.nonplainObjectReplacers,
5668
+ s = c.filter(function (e) {
5669
+ return e.type === t;
5670
+ });
5671
+ if (s.length && (c.splice(c.indexOf(s[0]), 1), delete r.revivers[t], delete r.types[t]), "function" == typeof i) {
5672
+ var l = i;
5673
+ i = {
5674
+ test: function test(e) {
5675
+ return e && e.constructor === l;
5676
+ },
5677
+ replace: function replace(e) {
5678
+ return _objectSpread2({}, e);
5679
+ },
5680
+ revive: function revive(e) {
5681
+ return Object.assign(Object.create(l.prototype), e);
5700
5682
  }
5701
- r.types[t] = i;
5683
+ };
5684
+ } else if (o(i)) {
5685
+ var f = _slicedToArray(i, 3);
5686
+ i = {
5687
+ test: f[0],
5688
+ replace: f[1],
5689
+ revive: f[2]
5690
+ };
5691
+ }
5692
+ if (null !== (n = i) && void 0 !== n && n.test) {
5693
+ var y = {
5694
+ type: t,
5695
+ test: i.test.bind(i)
5696
+ };
5697
+ i.replace && (y.replace = i.replace.bind(i)), i.replaceAsync && (y.replaceAsync = i.replaceAsync.bind(i));
5698
+ var p = "number" == typeof a.fallback ? a.fallback : a.fallback ? 0 : Number.POSITIVE_INFINITY;
5699
+ if (i.testPlainObjects ? r.plainObjectReplacers.splice(p, 0, y) : r.nonplainObjectReplacers.splice(p, 0, y), i.revive || i.reviveAsync) {
5700
+ var d = {};
5701
+ i.revive && (d.revive = i.revive.bind(i)), i.reviveAsync && (d.reviveAsync = i.reviveAsync.bind(i)), r.revivers[t] = [d, {
5702
+ plain: i.testPlainObjects
5703
+ }];
5702
5704
  }
5703
- });
5704
- };
5705
- return [].concat(e).forEach(function (e) {
5706
- return i(e);
5707
- }), this;
5708
- }
5709
- }]), Typeson;
5710
- }(),
5705
+ r.types[t] = i;
5706
+ }
5707
+ });
5708
+ };
5709
+ return [].concat(e).forEach(function (e) {
5710
+ i(e);
5711
+ }), this;
5712
+ }
5713
+ }]),
5711
5714
  s = _createClass(function Undefined() {
5712
5715
  _classCallCheck(this, Undefined);
5713
5716
  });
@@ -5737,30 +5740,31 @@ const v = {
5737
5740
  replace(e, t) {
5738
5741
  t.buffers || (t.buffers = []);
5739
5742
  const r = t.buffers.indexOf(e);
5740
- return r > -1 ? {
5743
+ return -1 !== r ? {
5741
5744
  index: r
5742
5745
  } : (t.buffers.push(e), {
5743
5746
  s: p(e),
5744
- maxByteLength: e.maxByteLength
5747
+ maxByteLength: e.maxByteLength,
5748
+ resizable: e.resizable
5745
5749
  });
5746
5750
  },
5747
5751
  revive(e, t) {
5748
5752
  if (t.buffers || (t.buffers = []), Object.hasOwn(e, "index")) return t.buffers[e.index];
5749
- const r = d(e.s, {
5753
+ const r = d(e.s, e.resizable ? {
5750
5754
  maxByteLength: e.maxByteLength
5751
- });
5755
+ } : void 0);
5752
5756
  return t.buffers.push(r), r;
5753
5757
  }
5754
5758
  }
5755
5759
  },
5756
- m = {
5760
+ b = {
5757
5761
  bigintObject: {
5758
5762
  test: e => "object" == typeof e && hasConstructorOf(e, BigInt),
5759
5763
  replace: String,
5760
5764
  revive: e => new Object(BigInt(e))
5761
5765
  }
5762
5766
  },
5763
- b = {
5767
+ m = {
5764
5768
  bigint: {
5765
5769
  test: e => "bigint" == typeof e,
5766
5770
  replace: String,
@@ -5780,7 +5784,7 @@ const h = {
5780
5784
  test: e => "Blob" === toStringTag(e),
5781
5785
  replace(e) {
5782
5786
  const t = new XMLHttpRequest();
5783
- if (t.overrideMimeType("text/plain; charset=x-user-defined"), t.open("GET", URL.createObjectURL(e), !1), t.send(), 200 !== t.status && 0 !== t.status) throw new Error("Bad Blob access: " + t.status);
5787
+ if (t.overrideMimeType("text/plain; charset=x-user-defined"), t.open("GET", URL.createObjectURL(e), false), t.send(), 200 !== t.status && 0 !== t.status) throw new Error("Bad Blob access: " + t.status);
5784
5788
  return {
5785
5789
  type: e.type,
5786
5790
  stringContents: t.responseText
@@ -5830,7 +5834,7 @@ const w = {
5830
5834
  algorithm: r,
5831
5835
  usages: n
5832
5836
  } = e;
5833
- return crypto.subtle.importKey("jwk", t, r, !0, n);
5837
+ return crypto.subtle.importKey("jwk", t, r, true, n);
5834
5838
  }
5835
5839
  }
5836
5840
  },
@@ -5844,13 +5848,14 @@ const w = {
5844
5848
  }, n) {
5845
5849
  n.buffers || (n.buffers = []);
5846
5850
  const a = n.buffers.indexOf(e);
5847
- return a > -1 ? {
5851
+ return -1 !== a ? {
5848
5852
  index: a,
5849
5853
  byteOffset: t,
5850
5854
  byteLength: r
5851
5855
  } : (n.buffers.push(e), {
5852
5856
  encoded: p(e),
5853
5857
  maxByteLength: e.maxByteLength,
5858
+ resizable: e.resizable,
5854
5859
  byteOffset: t,
5855
5860
  byteLength: r
5856
5861
  });
@@ -5862,12 +5867,13 @@ const w = {
5862
5867
  byteLength: n,
5863
5868
  encoded: a,
5864
5869
  index: o,
5865
- maxByteLength: i
5870
+ maxByteLength: i,
5871
+ resizable: c
5866
5872
  } = e;
5867
- let c;
5868
- return "index" in e ? c = t.buffers[o] : (c = d(a, void 0 === i ? i : {
5873
+ let s;
5874
+ return "index" in e ? s = t.buffers[o] : (s = d(a, c ? {
5869
5875
  maxByteLength: i
5870
- }), t.buffers.push(c)), new DataView(c, r, n);
5876
+ } : i), t.buffers.push(s)), new DataView(s, r, n);
5871
5877
  }
5872
5878
  }
5873
5879
  },
@@ -6043,7 +6049,7 @@ const E = {
6043
6049
  test: e => "File" === toStringTag(e),
6044
6050
  replace(e) {
6045
6051
  const t = new XMLHttpRequest();
6046
- if (t.overrideMimeType("text/plain; charset=x-user-defined"), t.open("GET", URL.createObjectURL(e), !1), t.send(), 200 !== t.status && 0 !== t.status) throw new Error("Bad File access: " + t.status);
6052
+ if (t.overrideMimeType("text/plain; charset=x-user-defined"), t.open("GET", URL.createObjectURL(e), false), t.send(), 200 !== t.status && 0 !== t.status) throw new Error("Bad File access: " + t.status);
6047
6053
  return {
6048
6054
  type: e.type,
6049
6055
  stringContents: t.responseText,
@@ -6160,28 +6166,28 @@ const E = {
6160
6166
  revive: e => new Map(e)
6161
6167
  }
6162
6168
  },
6163
- K = {
6169
+ R = {
6164
6170
  nan: {
6165
6171
  test: e => Number.isNaN(e),
6166
6172
  replace: () => "NaN",
6167
6173
  revive: () => Number.NaN
6168
6174
  }
6169
6175
  },
6170
- F = {
6176
+ K = {
6171
6177
  negativeInfinity: {
6172
6178
  test: e => e === Number.NEGATIVE_INFINITY,
6173
6179
  replace: () => "-Infinity",
6174
6180
  revive: () => Number.NEGATIVE_INFINITY
6175
6181
  }
6176
6182
  },
6177
- $ = {
6183
+ F = {
6178
6184
  negativeZero: {
6179
6185
  test: e => Object.is(e, -0),
6180
6186
  replace: () => 0,
6181
6187
  revive: () => -0
6182
6188
  }
6183
6189
  },
6184
- V = {
6190
+ z = {
6185
6191
  StringObject: {
6186
6192
  test: e => "String" === toStringTag(e) && "object" == typeof e,
6187
6193
  replace: String,
@@ -6198,12 +6204,12 @@ const E = {
6198
6204
  revive: e => new Number(e)
6199
6205
  }
6200
6206
  },
6201
- Y = {
6207
+ V = {
6202
6208
  regexp: {
6203
6209
  test: e => "RegExp" === toStringTag(e),
6204
6210
  replace: e => ({
6205
6211
  source: e.source,
6206
- flags: (e.global ? "g" : "") + (e.ignoreCase ? "i" : "") + (e.multiline ? "m" : "") + (e.sticky ? "y" : "") + (e.unicode ? "u" : "")
6212
+ flags: (e.global ? "g" : "") + (e.ignoreCase ? "i" : "") + (e.multiline ? "m" : "") + (e.sticky ? "y" : "") + (e.unicode ? "u" : "") + (e.unicodeSets ? "v" : "") + (e.hasIndices ? "d" : "") + (e.dotAll ? "s" : "")
6207
6213
  }),
6208
6214
  revive: ({
6209
6215
  source: e,
@@ -6211,26 +6217,26 @@ const E = {
6211
6217
  }) => new RegExp(e, t)
6212
6218
  }
6213
6219
  },
6214
- H = {
6220
+ W = {
6215
6221
  set: {
6216
6222
  test: e => "Set" === toStringTag(e),
6217
6223
  replace: e => [...e.values()],
6218
6224
  revive: e => new Set(e)
6219
6225
  }
6220
6226
  },
6221
- Q = {};
6227
+ H = {};
6222
6228
  "function" == typeof Int8Array && [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, ...("function" == typeof BigInt64Array ? [BigInt64Array, BigUint64Array] : [])].forEach(e => function create$1(e) {
6223
6229
  const t = e.name;
6224
- Q[t.toLowerCase()] = {
6230
+ H[t.toLowerCase()] = {
6225
6231
  test: e => toStringTag(e) === t,
6226
6232
  replace: e => (0 === e.byteOffset && e.byteLength === e.buffer.byteLength ? e : e.slice(0)).buffer,
6227
6233
  revive: t => "ArrayBuffer" === toStringTag(t) ? new e(t) : t
6228
6234
  };
6229
6235
  }(e));
6230
- const X = {};
6236
+ const Q = {};
6231
6237
  "function" == typeof Int8Array && [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, ...("function" == typeof BigInt64Array ? [BigInt64Array, BigUint64Array] : [])].forEach(e => function create(e) {
6232
6238
  const t = e.name;
6233
- X[t.toLowerCase()] = {
6239
+ Q[t.toLowerCase()] = {
6234
6240
  test: e => toStringTag(e) === t,
6235
6241
  replace({
6236
6242
  buffer: e,
@@ -6239,12 +6245,13 @@ const X = {};
6239
6245
  }, n) {
6240
6246
  n.buffers || (n.buffers = []);
6241
6247
  const a = n.buffers.indexOf(e);
6242
- return a > -1 ? {
6248
+ return -1 !== a ? {
6243
6249
  index: a,
6244
6250
  byteOffset: t,
6245
6251
  length: r
6246
6252
  } : (n.buffers.push(e), {
6247
6253
  maxByteLength: e.maxByteLength,
6254
+ resizable: e.resizable,
6248
6255
  encoded: p(e),
6249
6256
  byteOffset: t,
6250
6257
  length: r
@@ -6257,23 +6264,24 @@ const X = {};
6257
6264
  length: a,
6258
6265
  encoded: o,
6259
6266
  index: i,
6260
- maxByteLength: c
6267
+ maxByteLength: c,
6268
+ resizable: s
6261
6269
  } = t;
6262
- let s;
6263
- return "index" in t ? s = r.buffers[i] : (s = d(o, void 0 === c ? void 0 : {
6270
+ let u;
6271
+ return "index" in t ? u = r.buffers[i] : (u = d(o, s ? {
6264
6272
  maxByteLength: c
6265
- }), r.buffers.push(s)), new e(s, n, a);
6273
+ } : void 0), r.buffers.push(u)), new e(u, n, a);
6266
6274
  }
6267
6275
  };
6268
6276
  }(e));
6269
- const Z = {
6277
+ const X = {
6270
6278
  undef: {
6271
6279
  test: (e, t) => void 0 === e && (t.ownKeys || !("ownKeys" in t)),
6272
6280
  replace: () => 0,
6273
6281
  revive: () => new s()
6274
6282
  }
6275
6283
  },
6276
- ee = {
6284
+ Z = {
6277
6285
  userObject: {
6278
6286
  test: e => isUserObject(e),
6279
6287
  replace: e => ({
@@ -6282,11 +6290,11 @@ const Z = {
6282
6290
  revive: e => e
6283
6291
  }
6284
6292
  },
6285
- te = [{
6293
+ ee = [{
6286
6294
  arrayNonindexKeys: {
6287
- testPlainObjects: !0,
6288
- test: (e, t) => !!Array.isArray(e) && (Object.keys(e).some(e => String(Number.parseInt(e)) !== e) && (t.iterateIn = "object", t.addLength = !0), !0),
6289
- replace: (e, t) => (t.iterateUnsetNumeric = !0, e),
6295
+ testPlainObjects: true,
6296
+ test: (e, t) => !!Array.isArray(e) && (Object.keys(e).some(e => String(Number.parseInt(e)) !== e) && (t.iterateIn = "object", t.addLength = true), true),
6297
+ replace: (e, t) => (t.iterateUnsetNumeric = true, e),
6290
6298
  revive(e) {
6291
6299
  if (Array.isArray(e)) return e;
6292
6300
  const t = [];
@@ -6297,26 +6305,26 @@ const Z = {
6297
6305
  }
6298
6306
  }, {
6299
6307
  sparseUndefined: {
6300
- test: (e, t) => void 0 === e && !1 === t.ownKeys,
6308
+ test: (e, t) => void 0 === e && false === t.ownKeys,
6301
6309
  replace: () => 0,
6302
6310
  revive() {}
6303
6311
  }
6304
6312
  }],
6305
- re = [K, U, F, $],
6306
- ce = [ee, Z, te, V, re, A, Y, k, B, E, C, h, P, x].concat("function" == typeof Map ? D : [], "function" == typeof Set ? H : [], "function" == typeof ArrayBuffer ? v : [], "function" == typeof Uint8Array ? X : [], "function" == typeof DataView ? _ : [], "undefined" != typeof crypto ? w : [], "undefined" != typeof BigInt ? [b, m] : [], "undefined" != typeof DOMException ? S : [], "undefined" != typeof DOMRect ? N : [], "undefined" != typeof DOMPoint ? T : [], "undefined" != typeof DOMQuad ? I : [], "undefined" != typeof DOMMatrix ? j : []),
6307
- se = ce.concat({
6313
+ te = [R, U, K, F],
6314
+ ie = [Z, X, ee, z, te, A, V, k, B, E, C, h, P, x].concat("function" == typeof Map ? D : [], "function" == typeof Set ? W : [], "function" == typeof ArrayBuffer ? v : [], "function" == typeof Uint8Array ? Q : [], "function" == typeof DataView ? _ : [], "undefined" != typeof crypto ? w : [], "undefined" != typeof BigInt ? [m, b] : [], "undefined" != typeof DOMException ? S : [], "undefined" != typeof DOMRect ? N : [], "undefined" != typeof DOMPoint ? T : [], "undefined" != typeof DOMQuad ? I : [], "undefined" != typeof DOMMatrix ? j : []),
6315
+ ce = ie.concat({
6308
6316
  checkDataCloneException: {
6309
6317
  test(e) {
6310
6318
  const t = {}.toString.call(e).slice(8, -1);
6311
6319
  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");
6312
- return !1;
6320
+ return false;
6313
6321
  }
6314
6322
  }
6315
6323
  });
6316
6324
 
6317
6325
  // See: http://stackoverflow.com/questions/42170826/categories-for-rejection-by-the-structured-cloning-algorithm
6318
6326
 
6319
- let typeson = new c().register(se);
6327
+ let typeson = new c().register(ce);
6320
6328
 
6321
6329
  /**
6322
6330
  * @param {(preset: import('typeson-registry').Preset) =>
@@ -6324,7 +6332,7 @@ let typeson = new c().register(se);
6324
6332
  * @returns {void}
6325
6333
  */
6326
6334
  function register(func) {
6327
- typeson = new c().register(func(se));
6335
+ typeson = new c().register(func(ce));
6328
6336
  }
6329
6337
 
6330
6338
  /**
@@ -6653,7 +6661,6 @@ IDBIndex.__createIndex = function (store, index) {
6653
6661
  tx.executeSql('UPDATE ' + escapeStoreNameForSQL(storeName) + ' SET ' + escapeIndexNameForSQL(indexName) + ' = ? WHERE "key" = ?', [escapeSQLiteStatement(indexKeyStr), data.rows.item(i).key], function () {
6654
6662
  addIndexEntry(i + 1);
6655
6663
  }, /** @type {SQLStatementErrorCallback} */error);
6656
- // eslint-disable-next-line no-unused-vars -- Problem with commonJS rollup
6657
6664
  } catch (err) {
6658
6665
  // Not a valid value to insert into index, so just continue
6659
6666
  addIndexEntry(i + 1);
@@ -6780,7 +6787,6 @@ IDBIndex.__deleteIndex = function (store, index) {
6780
6787
  IDBIndex.__updateIndexList = function (store, tx, success, failure) {
6781
6788
  /** @type {IndexList} **/
6782
6789
  const indexList = {};
6783
- // eslint-disable-next-line sonarjs/prefer-for-of -- Implement iterability?
6784
6790
  for (let i = 0; i < store.indexNames.length; i++) {
6785
6791
  const idx = store.__indexes[store.indexNames[i]];
6786
6792
  indexList[idx.name] = {
@@ -7740,7 +7746,6 @@ IDBObjectStore.prototype.__insertData = function (tx, encoded, value, clonedKeyO
7740
7746
  if ('invalid' in indexKey && indexKey.invalid || 'failure' in indexKey && indexKey.failure) {
7741
7747
  throw new Error('Go to catch');
7742
7748
  }
7743
- // eslint-disable-next-line no-unused-vars -- Problem with commonJS rollup
7744
7749
  } catch (err) {
7745
7750
  resolve(undefined);
7746
7751
  return;
@@ -8664,7 +8669,6 @@ const setFS = _fs => {
8664
8669
  * @returns {string}
8665
8670
  */
8666
8671
  const getOrigin = () => {
8667
- // eslint-disable-next-line no-undef -- If browser/polyfilled
8668
8672
  return typeof location !== 'object' || !location ? 'null' : location.origin;
8669
8673
  };
8670
8674
  const hasNullOrigin = () => CFG.checkOrigin !== false && getOrigin() === 'null';
@@ -8840,7 +8844,7 @@ let nameCounter = 0;
8840
8844
  */
8841
8845
  function getLatestCachedWebSQLVersion(name) {
8842
8846
  return Object.keys(websqlDBCache[name]).map(Number).reduce((prev, curr) => {
8843
- return curr > prev ? curr : prev;
8847
+ return Math.max(curr, prev);
8844
8848
  }, 0);
8845
8849
  }
8846
8850
 
@@ -9122,7 +9126,6 @@ IDBFactory.prototype.open = function (name /* , version */) {
9122
9126
  if (err) {
9123
9127
  try {
9124
9128
  systx.executeSql('ROLLBACK', [], cb, cb);
9125
- // eslint-disable-next-line no-unused-vars -- Problem with commonJS rollup
9126
9129
  } catch (err) {
9127
9130
  // Browser may fail with expired transaction above so
9128
9131
  // no choice but to manually revert
@@ -9230,7 +9233,7 @@ IDBFactory.prototype.open = function (name /* , version */) {
9230
9233
  // eslint-disable-next-line camelcase -- Clear API
9231
9234
  req.transaction.on__complete = function () {
9232
9235
  const pos = connection.__transactions.indexOf(req.transaction);
9233
- if (pos > -1) {
9236
+ if (pos !== -1) {
9234
9237
  connection.__transactions.splice(pos, 1);
9235
9238
  }
9236
9239
  if (/** @type {import('./IDBDatabase.js').IDBDatabaseFull} */req.__result.__closePending) {
@@ -9790,8 +9793,8 @@ IDBCursor.__createInstance = function (...args) {
9790
9793
  */
9791
9794
  IDBCursor.prototype.__find = function (...args /* key, tx, success, error, recordsToLoad */) {
9792
9795
  if (this.__multiEntryIndex) {
9793
- const [key, primaryKey, tx, success, error] = args;
9794
- this.__findMultiEntry(key, primaryKey, tx, success, error);
9796
+ const [key, primaryKey, tx, success, error, recordsToLoad] = args;
9797
+ this.__findMultiEntry(key, primaryKey, tx, success, error, recordsToLoad);
9795
9798
  } else {
9796
9799
  const [key, primaryKey, tx, success, error, recordsToLoad] = args;
9797
9800
  this.__findBasic(key, primaryKey, tx, success, error, recordsToLoad);
@@ -9910,10 +9913,11 @@ const leftBracketRegex = /\[/gu;
9910
9913
  * @param {SQLTransaction} tx
9911
9914
  * @param {KeySuccess} success
9912
9915
  * @param {FindError} error
9916
+ * @param {Integer|undefined} recordsToLoad
9913
9917
  * @this {IDBCursorFull}
9914
9918
  * @returns {void}
9915
9919
  */
9916
- IDBCursor.prototype.__findMultiEntry = function (key, primaryKey, tx, success, error) {
9920
+ IDBCursor.prototype.__findMultiEntry = function (key, primaryKey, tx, success, error, recordsToLoad) {
9917
9921
  const me = this;
9918
9922
  if (me.__prefetchedData && me.__prefetchedData.length === me.__prefetchedIndex) {
9919
9923
  if (CFG.DEBUG) {
@@ -9968,6 +9972,7 @@ IDBCursor.prototype.__findMultiEntry = function (key, primaryKey, tx, success, e
9968
9972
  // 4. Sort by object store position (if defined and not unique)
9969
9973
  sql.push(',', sqlQuote(me.__valueColumnName), direction);
9970
9974
  }
9975
+ sql.push('LIMIT', String(recordsToLoad));
9971
9976
  }
9972
9977
  const sqlStr = sql.join(' ');
9973
9978
  if (CFG.DEBUG) {
@@ -10248,9 +10253,11 @@ IDBCursor.prototype.__continueFinish = function (key, primaryKey, advanceState)
10248
10253
  triggerSuccess(k, val, primKey);
10249
10254
  return;
10250
10255
  }
10256
+ // @ts-expect-error Todo: Our bug to fix
10251
10257
  cursorContinue(tx, args, success, error);
10252
10258
  }
10253
10259
  if (me.__unique && !me.__multiEntryIndex && encKey === encode$1(me.key, me.__multiEntryIndex)) {
10260
+ // @ts-expect-error Todo: Our bug to fix
10254
10261
  cursorContinue(tx, args, success, error);
10255
10262
  return;
10256
10263
  }
@@ -10630,7 +10637,6 @@ function setGlobalVars(idb, initialConfig) {
10630
10637
  Object.getOwnPropertyDescriptor(o, name);
10631
10638
  }
10632
10639
  Object.defineProperty(IDB, name, desc);
10633
- // eslint-disable-next-line no-unused-vars -- Problem with commonJS rollup
10634
10640
  } catch (err) {
10635
10641
  // With `indexedDB`, PhantomJS fails here and below but
10636
10642
  // not above, while Chrome is reverse (and Firefox doesn't
@@ -10797,9 +10803,7 @@ function setGlobalVars(idb, initialConfig) {
10797
10803
  // Exclude genuine Safari: http://stackoverflow.com/a/7768006/271577
10798
10804
  // Detect iOS: http://stackoverflow.com/questions/9038625/detect-if-device-is-ios/9039885#9039885
10799
10805
  // and detect version 9: http://stackoverflow.com/a/26363560/271577
10800
- /(iPad|iPhone|iPod).* os 9_/ui.test(navigator.userAgent) && typeof window !== 'undefined' &&
10801
- // eslint-disable-next-line no-undef -- Extra check
10802
- !('MSStream' in window) // But avoid IE11
10806
+ /(iPad|iPhone|iPod).* os 9_/ui.test(navigator.userAgent) && typeof window !== 'undefined' && !('MSStream' in window) // But avoid IE11
10803
10807
  )) {
10804
10808
  poorIndexedDbSupport = true;
10805
10809
  }
@@ -10829,237 +10833,301 @@ function getDefaultExportFromCjs (x) {
10829
10833
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
10830
10834
  }
10831
10835
 
10832
- var nextTick$1 = {};
10836
+ var nextTick = {};
10833
10837
 
10834
- nextTick$1.test = function () {
10835
- // Don't get fooled by e.g. browserify environments.
10836
- return typeof process !== 'undefined' && !process.browser;
10837
- };
10838
- nextTick$1.install = function (func) {
10839
- return function () {
10840
- process.nextTick(func);
10838
+ var hasRequiredNextTick;
10839
+ function requireNextTick() {
10840
+ if (hasRequiredNextTick) return nextTick;
10841
+ hasRequiredNextTick = 1;
10842
+ nextTick.test = function () {
10843
+ // Don't get fooled by e.g. browserify environments.
10844
+ return typeof process !== 'undefined' && !process.browser;
10841
10845
  };
10842
- };
10846
+ nextTick.install = function (func) {
10847
+ return function () {
10848
+ process.nextTick(func);
10849
+ };
10850
+ };
10851
+ return nextTick;
10852
+ }
10843
10853
 
10844
10854
  var queueMicrotask = {};
10845
10855
 
10846
- queueMicrotask.test = function () {
10847
- return typeof commonjsGlobal.queueMicrotask === 'function';
10848
- };
10849
- queueMicrotask.install = function (func) {
10850
- return function () {
10851
- commonjsGlobal.queueMicrotask(func);
10856
+ var hasRequiredQueueMicrotask;
10857
+ function requireQueueMicrotask() {
10858
+ if (hasRequiredQueueMicrotask) return queueMicrotask;
10859
+ hasRequiredQueueMicrotask = 1;
10860
+ queueMicrotask.test = function () {
10861
+ return typeof commonjsGlobal.queueMicrotask === 'function';
10852
10862
  };
10853
- };
10863
+ queueMicrotask.install = function (func) {
10864
+ return function () {
10865
+ commonjsGlobal.queueMicrotask(func);
10866
+ };
10867
+ };
10868
+ return queueMicrotask;
10869
+ }
10854
10870
 
10855
10871
  var mutation = {};
10856
10872
 
10857
- //based off rsvp https://github.com/tildeio/rsvp.js
10858
- //license https://github.com/tildeio/rsvp.js/blob/master/LICENSE
10859
- //https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/asap.js
10860
-
10861
- var Mutation = commonjsGlobal.MutationObserver || commonjsGlobal.WebKitMutationObserver;
10862
- mutation.test = function () {
10863
- return Mutation;
10864
- };
10865
- mutation.install = function (handle) {
10866
- var called = 0;
10867
- var observer = new Mutation(handle);
10868
- var element = commonjsGlobal.document.createTextNode('');
10869
- observer.observe(element, {
10870
- characterData: true
10871
- });
10872
- return function () {
10873
- element.data = called = ++called % 2;
10873
+ var hasRequiredMutation;
10874
+ function requireMutation() {
10875
+ if (hasRequiredMutation) return mutation;
10876
+ hasRequiredMutation = 1;
10877
+ //based off rsvp https://github.com/tildeio/rsvp.js
10878
+ //license https://github.com/tildeio/rsvp.js/blob/master/LICENSE
10879
+ //https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/asap.js
10880
+
10881
+ var Mutation = commonjsGlobal.MutationObserver || commonjsGlobal.WebKitMutationObserver;
10882
+ mutation.test = function () {
10883
+ return Mutation;
10874
10884
  };
10875
- };
10885
+ mutation.install = function (handle) {
10886
+ var called = 0;
10887
+ var observer = new Mutation(handle);
10888
+ var element = commonjsGlobal.document.createTextNode('');
10889
+ observer.observe(element, {
10890
+ characterData: true
10891
+ });
10892
+ return function () {
10893
+ element.data = called = ++called % 2;
10894
+ };
10895
+ };
10896
+ return mutation;
10897
+ }
10876
10898
 
10877
10899
  var messageChannel = {};
10878
10900
 
10879
- messageChannel.test = function () {
10880
- if (commonjsGlobal.setImmediate) {
10881
- // we can only get here in IE10
10882
- // which doesn't handel postMessage well
10883
- return false;
10884
- }
10885
- return typeof commonjsGlobal.MessageChannel !== 'undefined';
10886
- };
10887
- messageChannel.install = function (func) {
10888
- var channel = new commonjsGlobal.MessageChannel();
10889
- channel.port1.onmessage = func;
10890
- return function () {
10891
- channel.port2.postMessage(0);
10901
+ var hasRequiredMessageChannel;
10902
+ function requireMessageChannel() {
10903
+ if (hasRequiredMessageChannel) return messageChannel;
10904
+ hasRequiredMessageChannel = 1;
10905
+ messageChannel.test = function () {
10906
+ if (commonjsGlobal.setImmediate) {
10907
+ // we can only get here in IE10
10908
+ // which doesn't handel postMessage well
10909
+ return false;
10910
+ }
10911
+ return typeof commonjsGlobal.MessageChannel !== 'undefined';
10892
10912
  };
10893
- };
10913
+ messageChannel.install = function (func) {
10914
+ var channel = new commonjsGlobal.MessageChannel();
10915
+ channel.port1.onmessage = func;
10916
+ return function () {
10917
+ channel.port2.postMessage(0);
10918
+ };
10919
+ };
10920
+ return messageChannel;
10921
+ }
10894
10922
 
10895
10923
  var stateChange = {};
10896
10924
 
10897
- stateChange.test = function () {
10898
- return 'document' in commonjsGlobal && 'onreadystatechange' in commonjsGlobal.document.createElement('script');
10899
- };
10900
- stateChange.install = function (handle) {
10901
- return function () {
10902
- // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
10903
- // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
10904
- var scriptEl = commonjsGlobal.document.createElement('script');
10905
- scriptEl.onreadystatechange = function () {
10906
- handle();
10907
- scriptEl.onreadystatechange = null;
10908
- scriptEl.parentNode.removeChild(scriptEl);
10909
- scriptEl = null;
10925
+ var hasRequiredStateChange;
10926
+ function requireStateChange() {
10927
+ if (hasRequiredStateChange) return stateChange;
10928
+ hasRequiredStateChange = 1;
10929
+ stateChange.test = function () {
10930
+ return 'document' in commonjsGlobal && 'onreadystatechange' in commonjsGlobal.document.createElement('script');
10931
+ };
10932
+ stateChange.install = function (handle) {
10933
+ return function () {
10934
+ // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
10935
+ // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
10936
+ var scriptEl = commonjsGlobal.document.createElement('script');
10937
+ scriptEl.onreadystatechange = function () {
10938
+ handle();
10939
+ scriptEl.onreadystatechange = null;
10940
+ scriptEl.parentNode.removeChild(scriptEl);
10941
+ scriptEl = null;
10942
+ };
10943
+ commonjsGlobal.document.documentElement.appendChild(scriptEl);
10944
+ return handle;
10910
10945
  };
10911
- commonjsGlobal.document.documentElement.appendChild(scriptEl);
10912
- return handle;
10913
10946
  };
10914
- };
10947
+ return stateChange;
10948
+ }
10915
10949
 
10916
10950
  var timeout = {};
10917
10951
 
10918
- timeout.test = function () {
10919
- return true;
10920
- };
10921
- timeout.install = function (t) {
10922
- return function () {
10923
- setTimeout(t, 0);
10952
+ var hasRequiredTimeout;
10953
+ function requireTimeout() {
10954
+ if (hasRequiredTimeout) return timeout;
10955
+ hasRequiredTimeout = 1;
10956
+ timeout.test = function () {
10957
+ return true;
10924
10958
  };
10925
- };
10926
-
10927
- var types = [nextTick$1, queueMicrotask, mutation, messageChannel, stateChange, timeout];
10928
- var draining;
10929
- var currentQueue;
10930
- var queueIndex = -1;
10931
- var queue = [];
10932
- var scheduled = false;
10933
- function cleanUpNextTick() {
10934
- if (!draining || !currentQueue) {
10935
- return;
10936
- }
10937
- draining = false;
10938
- if (currentQueue.length) {
10939
- queue = currentQueue.concat(queue);
10940
- } else {
10941
- queueIndex = -1;
10942
- }
10943
- if (queue.length) {
10944
- nextTick();
10959
+ timeout.install = function (t) {
10960
+ return function () {
10961
+ setTimeout(t, 0);
10962
+ };
10963
+ };
10964
+ return timeout;
10965
+ }
10966
+
10967
+ var lib;
10968
+ var hasRequiredLib;
10969
+ function requireLib() {
10970
+ if (hasRequiredLib) return lib;
10971
+ hasRequiredLib = 1;
10972
+ var types = [requireNextTick(), requireQueueMicrotask(), requireMutation(), requireMessageChannel(), requireStateChange(), requireTimeout()];
10973
+ var draining;
10974
+ var currentQueue;
10975
+ var queueIndex = -1;
10976
+ var queue = [];
10977
+ var scheduled = false;
10978
+ function cleanUpNextTick() {
10979
+ if (!draining || !currentQueue) {
10980
+ return;
10981
+ }
10982
+ draining = false;
10983
+ if (currentQueue.length) {
10984
+ queue = currentQueue.concat(queue);
10985
+ } else {
10986
+ queueIndex = -1;
10987
+ }
10988
+ if (queue.length) {
10989
+ nextTick();
10990
+ }
10945
10991
  }
10946
- }
10947
10992
 
10948
- //named nextTick for less confusing stack traces
10949
- function nextTick() {
10950
- if (draining) {
10951
- return;
10952
- }
10953
- scheduled = false;
10954
- draining = true;
10955
- var len = queue.length;
10956
- var timeout = setTimeout(cleanUpNextTick);
10957
- while (len) {
10958
- currentQueue = queue;
10959
- queue = [];
10960
- while (currentQueue && ++queueIndex < len) {
10961
- currentQueue[queueIndex].run();
10993
+ //named nextTick for less confusing stack traces
10994
+ function nextTick() {
10995
+ if (draining) {
10996
+ return;
10962
10997
  }
10998
+ scheduled = false;
10999
+ draining = true;
11000
+ var len = queue.length;
11001
+ var timeout = setTimeout(cleanUpNextTick);
11002
+ while (len) {
11003
+ currentQueue = queue;
11004
+ queue = [];
11005
+ while (currentQueue && ++queueIndex < len) {
11006
+ currentQueue[queueIndex].run();
11007
+ }
11008
+ queueIndex = -1;
11009
+ len = queue.length;
11010
+ }
11011
+ currentQueue = null;
10963
11012
  queueIndex = -1;
10964
- len = queue.length;
10965
- }
10966
- currentQueue = null;
10967
- queueIndex = -1;
10968
- draining = false;
10969
- clearTimeout(timeout);
10970
- }
10971
- var scheduleDrain;
10972
- var i = -1;
10973
- var len = types.length;
10974
- while (++i < len) {
10975
- if (types[i] && types[i].test && types[i].test()) {
10976
- scheduleDrain = types[i].install(nextTick);
10977
- break;
10978
- }
10979
- }
10980
- // v8 likes predictible objects
10981
- function Item(fun, array) {
10982
- this.fun = fun;
10983
- this.array = array;
10984
- }
10985
- Item.prototype.run = function () {
10986
- var fun = this.fun;
10987
- var array = this.array;
10988
- switch (array.length) {
10989
- case 0:
10990
- return fun();
10991
- case 1:
10992
- return fun(array[0]);
10993
- case 2:
10994
- return fun(array[0], array[1]);
10995
- case 3:
10996
- return fun(array[0], array[1], array[2]);
10997
- default:
10998
- return fun.apply(null, array);
10999
- }
11000
- };
11001
- var lib = immediate;
11002
- function immediate(task) {
11003
- var args = new Array(arguments.length - 1);
11004
- if (arguments.length > 1) {
11005
- for (var i = 1; i < arguments.length; i++) {
11006
- args[i - 1] = arguments[i];
11013
+ draining = false;
11014
+ clearTimeout(timeout);
11015
+ }
11016
+ var scheduleDrain;
11017
+ var i = -1;
11018
+ var len = types.length;
11019
+ while (++i < len) {
11020
+ if (types[i] && types[i].test && types[i].test()) {
11021
+ scheduleDrain = types[i].install(nextTick);
11022
+ break;
11007
11023
  }
11008
11024
  }
11009
- queue.push(new Item(task, args));
11010
- if (!scheduled && !draining) {
11011
- scheduled = true;
11012
- scheduleDrain();
11025
+ // v8 likes predictible objects
11026
+ function Item(fun, array) {
11027
+ this.fun = fun;
11028
+ this.array = array;
11029
+ }
11030
+ Item.prototype.run = function () {
11031
+ var fun = this.fun;
11032
+ var array = this.array;
11033
+ switch (array.length) {
11034
+ case 0:
11035
+ return fun();
11036
+ case 1:
11037
+ return fun(array[0]);
11038
+ case 2:
11039
+ return fun(array[0], array[1]);
11040
+ case 3:
11041
+ return fun(array[0], array[1], array[2]);
11042
+ default:
11043
+ return fun.apply(null, array);
11044
+ }
11045
+ };
11046
+ lib = immediate;
11047
+ function immediate(task) {
11048
+ var args = new Array(arguments.length - 1);
11049
+ if (arguments.length > 1) {
11050
+ for (var i = 1; i < arguments.length; i++) {
11051
+ args[i - 1] = arguments[i];
11052
+ }
11053
+ }
11054
+ queue.push(new Item(task, args));
11055
+ if (!scheduled && !draining) {
11056
+ scheduled = true;
11057
+ scheduleDrain();
11058
+ }
11013
11059
  }
11060
+ return lib;
11014
11061
  }
11015
- var immediate$1 = /*@__PURE__*/getDefaultExportFromCjs(lib);
11016
11062
 
11017
- // Simple FIFO queue implementation to avoid having to do shift()
11018
- // on an array, which is slow.
11063
+ var libExports = requireLib();
11064
+ var immediate = /*@__PURE__*/getDefaultExportFromCjs(libExports);
11019
11065
 
11020
- function Queue() {
11021
- this.length = 0;
11022
- }
11023
- Queue.prototype.push = function (item) {
11024
- var node = {
11025
- item: item
11026
- };
11027
- if (this.last) {
11028
- this.last = this.last.next = node;
11029
- } else {
11030
- this.last = this.first = node;
11066
+ var tinyQueue;
11067
+ var hasRequiredTinyQueue;
11068
+ function requireTinyQueue() {
11069
+ if (hasRequiredTinyQueue) return tinyQueue;
11070
+ hasRequiredTinyQueue = 1;
11071
+
11072
+ // Simple FIFO queue implementation to avoid having to do shift()
11073
+ // on an array, which is slow.
11074
+
11075
+ function Queue() {
11076
+ this.length = 0;
11031
11077
  }
11032
- this.length++;
11033
- };
11034
- Queue.prototype.shift = function () {
11035
- var node = this.first;
11036
- if (node) {
11037
- this.first = node.next;
11038
- if (! --this.length) {
11039
- this.last = undefined;
11078
+ Queue.prototype.push = function (item) {
11079
+ var node = {
11080
+ item: item
11081
+ };
11082
+ if (this.last) {
11083
+ this.last = this.last.next = node;
11084
+ } else {
11085
+ this.last = this.first = node;
11040
11086
  }
11041
- return node.item;
11042
- }
11043
- };
11044
- Queue.prototype.slice = function (start, end) {
11045
- start = typeof start === 'undefined' ? 0 : start;
11046
- end = typeof end === 'undefined' ? Infinity : end;
11047
- var output = [];
11048
- var i = 0;
11049
- for (var node = this.first; node; node = node.next) {
11050
- if (--end < 0) {
11051
- break;
11052
- } else if (++i > start) {
11053
- output.push(node.item);
11087
+ this.length++;
11088
+ };
11089
+ Queue.prototype.shift = function () {
11090
+ var node = this.first;
11091
+ if (node) {
11092
+ this.first = node.next;
11093
+ if (! --this.length) {
11094
+ this.last = undefined;
11095
+ }
11096
+ return node.item;
11054
11097
  }
11055
- }
11056
- return output;
11057
- };
11058
- var tinyQueue = Queue;
11059
- var Queue$1 = /*@__PURE__*/getDefaultExportFromCjs(tinyQueue);
11098
+ };
11099
+ Queue.prototype.slice = function (start, end) {
11100
+ start = typeof start === 'undefined' ? 0 : start;
11101
+ end = typeof end === 'undefined' ? Infinity : end;
11102
+ var output = [];
11103
+ var i = 0;
11104
+ for (var node = this.first; node; node = node.next) {
11105
+ if (--end < 0) {
11106
+ break;
11107
+ } else if (++i > start) {
11108
+ output.push(node.item);
11109
+ }
11110
+ }
11111
+ return output;
11112
+ };
11113
+ tinyQueue = Queue;
11114
+ return tinyQueue;
11115
+ }
11116
+
11117
+ var tinyQueueExports = requireTinyQueue();
11118
+ var Queue = /*@__PURE__*/getDefaultExportFromCjs(tinyQueueExports);
11119
+
11120
+ var noopFn;
11121
+ var hasRequiredNoopFn;
11122
+ function requireNoopFn() {
11123
+ if (hasRequiredNoopFn) return noopFn;
11124
+ hasRequiredNoopFn = 1;
11125
+ noopFn = function () {};
11126
+ return noopFn;
11127
+ }
11060
11128
 
11061
- var noopFn = function () {};
11062
- var noop = /*@__PURE__*/getDefaultExportFromCjs(noopFn);
11129
+ var noopFnExports = requireNoopFn();
11130
+ var noop = /*@__PURE__*/getDefaultExportFromCjs(noopFnExports);
11063
11131
 
11064
11132
  function WebSQLRows(array) {
11065
11133
  this._array = array;
@@ -11174,8 +11242,8 @@ function WebSQLTransaction(websqlDatabase, executeDelay) {
11174
11242
  this._error = null;
11175
11243
  this._complete = false;
11176
11244
  this._runningTimeout = false;
11177
- this._executeDelay = executeDelay || immediate$1;
11178
- this._sqlQueue = new Queue$1();
11245
+ this._executeDelay = executeDelay || immediate;
11246
+ this._sqlQueue = new Queue();
11179
11247
  if (!websqlDatabase._currentTask.readOnly) {
11180
11248
  // Since we serialize all access to the database, there is no need to
11181
11249
  // run read-only tasks in a transaction. This is a perf boost.
@@ -11219,10 +11287,10 @@ function TransactionTask(readOnly, txnCallback, errorCallback, successCallback,
11219
11287
  function WebSQLDatabase(dbVersion, db, webSQLOverrides) {
11220
11288
  this.version = dbVersion;
11221
11289
  this._db = db;
11222
- this._txnQueue = new Queue$1();
11290
+ this._txnQueue = new Queue();
11223
11291
  this._running = false;
11224
11292
  this._currentTask = null;
11225
- this._transactionDelay = webSQLOverrides.transactionDelay || immediate$1;
11293
+ this._transactionDelay = webSQLOverrides.transactionDelay || immediate;
11226
11294
  this._executeDelay = webSQLOverrides.executeDelay;
11227
11295
  }
11228
11296
  WebSQLDatabase.prototype._onTransactionComplete = function (err) {
@@ -11326,7 +11394,7 @@ function customOpenDatabase(SQLiteDatabase, opts) {
11326
11394
  opts = opts || {};
11327
11395
  var sqliteOpts = opts.sqlite;
11328
11396
  var webSQLOverrides = opts.websql || {};
11329
- var openDelay = webSQLOverrides.openDelay || immediate$1;
11397
+ var openDelay = webSQLOverrides.openDelay || immediate;
11330
11398
  function createDb(dbName, dbVersion) {
11331
11399
  var sqliteDatabase = new SQLiteDatabase(dbName, sqliteOpts);
11332
11400
  return new WebSQLDatabase(dbVersion, sqliteDatabase, webSQLOverrides);
@@ -11358,249 +11426,268 @@ function commonjsRequire(path) {
11358
11426
 
11359
11427
  var bindings = {exports: {}};
11360
11428
 
11361
- /**
11362
- * Module dependencies.
11363
- */
11429
+ var fileUriToPath_1;
11430
+ var hasRequiredFileUriToPath;
11431
+ function requireFileUriToPath() {
11432
+ if (hasRequiredFileUriToPath) return fileUriToPath_1;
11433
+ hasRequiredFileUriToPath = 1;
11434
+ /**
11435
+ * Module dependencies.
11436
+ */
11364
11437
 
11365
- var sep = path.sep || '/';
11438
+ var sep = path.sep || '/';
11366
11439
 
11367
- /**
11368
- * Module exports.
11369
- */
11440
+ /**
11441
+ * Module exports.
11442
+ */
11370
11443
 
11371
- var fileUriToPath_1 = fileUriToPath;
11444
+ fileUriToPath_1 = fileUriToPath;
11372
11445
 
11373
- /**
11374
- * File URI to Path function.
11375
- *
11376
- * @param {String} uri
11377
- * @return {String} path
11378
- * @api public
11379
- */
11446
+ /**
11447
+ * File URI to Path function.
11448
+ *
11449
+ * @param {String} uri
11450
+ * @return {String} path
11451
+ * @api public
11452
+ */
11380
11453
 
11381
- function fileUriToPath(uri) {
11382
- if ('string' != typeof uri || uri.length <= 7 || 'file://' != uri.substring(0, 7)) {
11383
- throw new TypeError('must pass in a file:// URI to convert to a file path');
11384
- }
11385
- var rest = decodeURI(uri.substring(7));
11386
- var firstSlash = rest.indexOf('/');
11387
- var host = rest.substring(0, firstSlash);
11388
- var path = rest.substring(firstSlash + 1);
11454
+ function fileUriToPath(uri) {
11455
+ if ('string' != typeof uri || uri.length <= 7 || 'file://' != uri.substring(0, 7)) {
11456
+ throw new TypeError('must pass in a file:// URI to convert to a file path');
11457
+ }
11458
+ var rest = decodeURI(uri.substring(7));
11459
+ var firstSlash = rest.indexOf('/');
11460
+ var host = rest.substring(0, firstSlash);
11461
+ var path = rest.substring(firstSlash + 1);
11389
11462
 
11390
- // 2. Scheme Definition
11391
- // As a special case, <host> can be the string "localhost" or the empty
11392
- // string; this is interpreted as "the machine from which the URL is
11393
- // being interpreted".
11394
- if ('localhost' == host) host = '';
11395
- if (host) {
11396
- host = sep + sep + host;
11397
- }
11463
+ // 2. Scheme Definition
11464
+ // As a special case, <host> can be the string "localhost" or the empty
11465
+ // string; this is interpreted as "the machine from which the URL is
11466
+ // being interpreted".
11467
+ if ('localhost' == host) host = '';
11468
+ if (host) {
11469
+ host = sep + sep + host;
11470
+ }
11398
11471
 
11399
- // 3.2 Drives, drive letters, mount points, file system root
11400
- // Drive letters are mapped into the top of a file URI in various ways,
11401
- // depending on the implementation; some applications substitute
11402
- // vertical bar ("|") for the colon after the drive letter, yielding
11403
- // "file:///c|/tmp/test.txt". In some cases, the colon is left
11404
- // unchanged, as in "file:///c:/tmp/test.txt". In other cases, the
11405
- // colon is simply omitted, as in "file:///c/tmp/test.txt".
11406
- path = path.replace(/^(.+)\|/, '$1:');
11472
+ // 3.2 Drives, drive letters, mount points, file system root
11473
+ // Drive letters are mapped into the top of a file URI in various ways,
11474
+ // depending on the implementation; some applications substitute
11475
+ // vertical bar ("|") for the colon after the drive letter, yielding
11476
+ // "file:///c|/tmp/test.txt". In some cases, the colon is left
11477
+ // unchanged, as in "file:///c:/tmp/test.txt". In other cases, the
11478
+ // colon is simply omitted, as in "file:///c/tmp/test.txt".
11479
+ path = path.replace(/^(.+)\|/, '$1:');
11407
11480
 
11408
- // for Windows, we need to invert the path separators from what a URI uses
11409
- if (sep == '\\') {
11410
- path = path.replace(/\//g, '\\');
11411
- }
11412
- if (/^.+\:/.test(path)) ; else {
11413
- // unix path…
11414
- path = sep + path;
11481
+ // for Windows, we need to invert the path separators from what a URI uses
11482
+ if (sep == '\\') {
11483
+ path = path.replace(/\//g, '\\');
11484
+ }
11485
+ if (/^.+\:/.test(path)) ; else {
11486
+ // unix path…
11487
+ path = sep + path;
11488
+ }
11489
+ return host + path;
11415
11490
  }
11416
- return host + path;
11491
+ return fileUriToPath_1;
11417
11492
  }
11418
11493
 
11419
11494
  /**
11420
11495
  * Module dependencies.
11421
11496
  */
11422
- (function (module, exports) {
11423
- var fs = require$$0,
11424
- path$1 = path,
11425
- fileURLToPath = fileUriToPath_1,
11426
- join = path$1.join,
11427
- dirname = path$1.dirname,
11428
- exists = fs.accessSync && function (path) {
11429
- try {
11430
- fs.accessSync(path);
11431
- } catch (e) {
11432
- return false;
11433
- }
11434
- return true;
11435
- } || fs.existsSync || path$1.existsSync,
11436
- defaults = {
11437
- arrow: process.env.NODE_BINDINGS_ARROW || ' → ',
11438
- compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled',
11439
- platform: process.platform,
11440
- arch: process.arch,
11441
- nodePreGyp: 'node-v' + process.versions.modules + '-' + process.platform + '-' + process.arch,
11442
- version: process.versions.node,
11443
- bindings: 'bindings.node',
11444
- try: [
11445
- // node-gyp's linked version in the "build" dir
11446
- ['module_root', 'build', 'bindings'],
11447
- // node-waf and gyp_addon (a.k.a node-gyp)
11448
- ['module_root', 'build', 'Debug', 'bindings'], ['module_root', 'build', 'Release', 'bindings'],
11449
- // Debug files, for development (legacy behavior, remove for node v0.9)
11450
- ['module_root', 'out', 'Debug', 'bindings'], ['module_root', 'Debug', 'bindings'],
11451
- // Release files, but manually compiled (legacy behavior, remove for node v0.9)
11452
- ['module_root', 'out', 'Release', 'bindings'], ['module_root', 'Release', 'bindings'],
11453
- // Legacy from node-waf, node <= 0.4.x
11454
- ['module_root', 'build', 'default', 'bindings'],
11455
- // Production "Release" buildtype binary (meh...)
11456
- ['module_root', 'compiled', 'version', 'platform', 'arch', 'bindings'],
11457
- // node-qbs builds
11458
- ['module_root', 'addon-build', 'release', 'install-root', 'bindings'], ['module_root', 'addon-build', 'debug', 'install-root', 'bindings'], ['module_root', 'addon-build', 'default', 'install-root', 'bindings'],
11459
- // node-pre-gyp path ./lib/binding/{node_abi}-{platform}-{arch}
11460
- ['module_root', 'lib', 'binding', 'nodePreGyp', 'bindings']]
11461
- };
11497
+ var hasRequiredBindings;
11498
+ function requireBindings() {
11499
+ if (hasRequiredBindings) return bindings.exports;
11500
+ hasRequiredBindings = 1;
11501
+ (function (module, exports) {
11502
+ var fs = require$$0,
11503
+ path$1 = path,
11504
+ fileURLToPath = requireFileUriToPath(),
11505
+ join = path$1.join,
11506
+ dirname = path$1.dirname,
11507
+ exists = fs.accessSync && function (path) {
11508
+ try {
11509
+ fs.accessSync(path);
11510
+ } catch (e) {
11511
+ return false;
11512
+ }
11513
+ return true;
11514
+ } || fs.existsSync || path$1.existsSync,
11515
+ defaults = {
11516
+ arrow: process.env.NODE_BINDINGS_ARROW || ' ',
11517
+ compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled',
11518
+ platform: process.platform,
11519
+ arch: process.arch,
11520
+ nodePreGyp: 'node-v' + process.versions.modules + '-' + process.platform + '-' + process.arch,
11521
+ version: process.versions.node,
11522
+ bindings: 'bindings.node',
11523
+ try: [
11524
+ // node-gyp's linked version in the "build" dir
11525
+ ['module_root', 'build', 'bindings'],
11526
+ // node-waf and gyp_addon (a.k.a node-gyp)
11527
+ ['module_root', 'build', 'Debug', 'bindings'], ['module_root', 'build', 'Release', 'bindings'],
11528
+ // Debug files, for development (legacy behavior, remove for node v0.9)
11529
+ ['module_root', 'out', 'Debug', 'bindings'], ['module_root', 'Debug', 'bindings'],
11530
+ // Release files, but manually compiled (legacy behavior, remove for node v0.9)
11531
+ ['module_root', 'out', 'Release', 'bindings'], ['module_root', 'Release', 'bindings'],
11532
+ // Legacy from node-waf, node <= 0.4.x
11533
+ ['module_root', 'build', 'default', 'bindings'],
11534
+ // Production "Release" buildtype binary (meh...)
11535
+ ['module_root', 'compiled', 'version', 'platform', 'arch', 'bindings'],
11536
+ // node-qbs builds
11537
+ ['module_root', 'addon-build', 'release', 'install-root', 'bindings'], ['module_root', 'addon-build', 'debug', 'install-root', 'bindings'], ['module_root', 'addon-build', 'default', 'install-root', 'bindings'],
11538
+ // node-pre-gyp path ./lib/binding/{node_abi}-{platform}-{arch}
11539
+ ['module_root', 'lib', 'binding', 'nodePreGyp', 'bindings']]
11540
+ };
11462
11541
 
11463
- /**
11464
- * The main `bindings()` function loads the compiled bindings for a given module.
11465
- * It uses V8's Error API to determine the parent filename that this function is
11466
- * being invoked from, which is then used to find the root directory.
11467
- */
11542
+ /**
11543
+ * The main `bindings()` function loads the compiled bindings for a given module.
11544
+ * It uses V8's Error API to determine the parent filename that this function is
11545
+ * being invoked from, which is then used to find the root directory.
11546
+ */
11468
11547
 
11469
- function bindings(opts) {
11470
- // Argument surgery
11471
- if (typeof opts == 'string') {
11472
- opts = {
11473
- bindings: opts
11474
- };
11475
- } else if (!opts) {
11476
- opts = {};
11477
- }
11548
+ function bindings(opts) {
11549
+ // Argument surgery
11550
+ if (typeof opts == 'string') {
11551
+ opts = {
11552
+ bindings: opts
11553
+ };
11554
+ } else if (!opts) {
11555
+ opts = {};
11556
+ }
11478
11557
 
11479
- // maps `defaults` onto `opts` object
11480
- Object.keys(defaults).map(function (i) {
11481
- if (!(i in opts)) opts[i] = defaults[i];
11482
- });
11558
+ // maps `defaults` onto `opts` object
11559
+ Object.keys(defaults).map(function (i) {
11560
+ if (!(i in opts)) opts[i] = defaults[i];
11561
+ });
11483
11562
 
11484
- // Get the module root
11485
- if (!opts.module_root) {
11486
- opts.module_root = exports.getRoot(exports.getFileName());
11487
- }
11563
+ // Get the module root
11564
+ if (!opts.module_root) {
11565
+ opts.module_root = exports.getRoot(exports.getFileName());
11566
+ }
11488
11567
 
11489
- // Ensure the given bindings name ends with .node
11490
- if (path$1.extname(opts.bindings) != '.node') {
11491
- opts.bindings += '.node';
11492
- }
11568
+ // Ensure the given bindings name ends with .node
11569
+ if (path$1.extname(opts.bindings) != '.node') {
11570
+ opts.bindings += '.node';
11571
+ }
11493
11572
 
11494
- // https://github.com/webpack/webpack/issues/4175#issuecomment-342931035
11495
- var requireFunc = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : commonjsRequire;
11496
- var tries = [],
11497
- i = 0,
11498
- l = opts.try.length,
11499
- n,
11500
- b,
11501
- err;
11502
- for (; i < l; i++) {
11503
- n = join.apply(null, opts.try[i].map(function (p) {
11504
- return opts[p] || p;
11505
- }));
11506
- tries.push(n);
11507
- try {
11508
- b = opts.path ? requireFunc.resolve(n) : requireFunc(n);
11509
- if (!opts.path) {
11510
- b.path = n;
11511
- }
11512
- return b;
11513
- } catch (e) {
11514
- if (e.code !== 'MODULE_NOT_FOUND' && e.code !== 'QUALIFIED_PATH_RESOLUTION_FAILED' && !/not find/i.test(e.message)) {
11515
- throw e;
11573
+ // https://github.com/webpack/webpack/issues/4175#issuecomment-342931035
11574
+ var requireFunc = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : commonjsRequire;
11575
+ var tries = [],
11576
+ i = 0,
11577
+ l = opts.try.length,
11578
+ n,
11579
+ b,
11580
+ err;
11581
+ for (; i < l; i++) {
11582
+ n = join.apply(null, opts.try[i].map(function (p) {
11583
+ return opts[p] || p;
11584
+ }));
11585
+ tries.push(n);
11586
+ try {
11587
+ b = opts.path ? requireFunc.resolve(n) : requireFunc(n);
11588
+ if (!opts.path) {
11589
+ b.path = n;
11590
+ }
11591
+ return b;
11592
+ } catch (e) {
11593
+ if (e.code !== 'MODULE_NOT_FOUND' && e.code !== 'QUALIFIED_PATH_RESOLUTION_FAILED' && !/not find/i.test(e.message)) {
11594
+ throw e;
11595
+ }
11516
11596
  }
11517
11597
  }
11598
+ err = new Error('Could not locate the bindings file. Tried:\n' + tries.map(function (a) {
11599
+ return opts.arrow + a;
11600
+ }).join('\n'));
11601
+ err.tries = tries;
11602
+ throw err;
11518
11603
  }
11519
- err = new Error('Could not locate the bindings file. Tried:\n' + tries.map(function (a) {
11520
- return opts.arrow + a;
11521
- }).join('\n'));
11522
- err.tries = tries;
11523
- throw err;
11524
- }
11525
- module.exports = exports = bindings;
11604
+ module.exports = exports = bindings;
11526
11605
 
11527
- /**
11528
- * Gets the filename of the JavaScript file that invokes this function.
11529
- * Used to help find the root directory of a module.
11530
- * Optionally accepts an filename argument to skip when searching for the invoking filename
11531
- */
11606
+ /**
11607
+ * Gets the filename of the JavaScript file that invokes this function.
11608
+ * Used to help find the root directory of a module.
11609
+ * Optionally accepts an filename argument to skip when searching for the invoking filename
11610
+ */
11532
11611
 
11533
- exports.getFileName = function getFileName(calling_file) {
11534
- var origPST = Error.prepareStackTrace,
11535
- origSTL = Error.stackTraceLimit,
11536
- dummy = {},
11537
- fileName;
11538
- Error.stackTraceLimit = 10;
11539
- Error.prepareStackTrace = function (e, st) {
11540
- for (var i = 0, l = st.length; i < l; i++) {
11541
- fileName = st[i].getFileName();
11542
- if (fileName !== __filename) {
11543
- if (calling_file) {
11544
- if (fileName !== calling_file) {
11612
+ exports.getFileName = function getFileName(calling_file) {
11613
+ var origPST = Error.prepareStackTrace,
11614
+ origSTL = Error.stackTraceLimit,
11615
+ dummy = {},
11616
+ fileName;
11617
+ Error.stackTraceLimit = 10;
11618
+ Error.prepareStackTrace = function (e, st) {
11619
+ for (var i = 0, l = st.length; i < l; i++) {
11620
+ fileName = st[i].getFileName();
11621
+ if (fileName !== __filename) {
11622
+ if (calling_file) {
11623
+ if (fileName !== calling_file) {
11624
+ return;
11625
+ }
11626
+ } else {
11545
11627
  return;
11546
11628
  }
11547
- } else {
11548
- return;
11549
11629
  }
11550
11630
  }
11551
- }
11552
- };
11631
+ };
11553
11632
 
11554
- // run the 'prepareStackTrace' function above
11555
- Error.captureStackTrace(dummy);
11556
- dummy.stack;
11633
+ // run the 'prepareStackTrace' function above
11634
+ Error.captureStackTrace(dummy);
11635
+ dummy.stack;
11557
11636
 
11558
- // cleanup
11559
- Error.prepareStackTrace = origPST;
11560
- Error.stackTraceLimit = origSTL;
11637
+ // cleanup
11638
+ Error.prepareStackTrace = origPST;
11639
+ Error.stackTraceLimit = origSTL;
11561
11640
 
11562
- // handle filename that starts with "file://"
11563
- var fileSchema = 'file://';
11564
- if (fileName.indexOf(fileSchema) === 0) {
11565
- fileName = fileURLToPath(fileName);
11566
- }
11567
- return fileName;
11568
- };
11641
+ // handle filename that starts with "file://"
11642
+ var fileSchema = 'file://';
11643
+ if (fileName.indexOf(fileSchema) === 0) {
11644
+ fileName = fileURLToPath(fileName);
11645
+ }
11646
+ return fileName;
11647
+ };
11569
11648
 
11570
- /**
11571
- * Gets the root directory of a module, given an arbitrary filename
11572
- * somewhere in the module tree. The "root directory" is the directory
11573
- * containing the `package.json` file.
11574
- *
11575
- * In: /home/nate/node-native-module/lib/index.js
11576
- * Out: /home/nate/node-native-module
11577
- */
11649
+ /**
11650
+ * Gets the root directory of a module, given an arbitrary filename
11651
+ * somewhere in the module tree. The "root directory" is the directory
11652
+ * containing the `package.json` file.
11653
+ *
11654
+ * In: /home/nate/node-native-module/lib/index.js
11655
+ * Out: /home/nate/node-native-module
11656
+ */
11578
11657
 
11579
- exports.getRoot = function getRoot(file) {
11580
- var dir = dirname(file),
11581
- prev;
11582
- while (true) {
11583
- if (dir === '.') {
11584
- // Avoids an infinite loop in rare cases, like the REPL
11585
- dir = process.cwd();
11586
- }
11587
- if (exists(join(dir, 'package.json')) || exists(join(dir, 'node_modules'))) {
11588
- // Found the 'package.json' file or 'node_modules' dir; we're done
11589
- return dir;
11590
- }
11591
- if (prev === dir) {
11592
- // Got to the top
11593
- throw new Error('Could not find module root given file: "' + file + '". Do you have a `package.json` file? ');
11658
+ exports.getRoot = function getRoot(file) {
11659
+ var dir = dirname(file),
11660
+ prev;
11661
+ while (true) {
11662
+ if (dir === '.') {
11663
+ // Avoids an infinite loop in rare cases, like the REPL
11664
+ dir = process.cwd();
11665
+ }
11666
+ if (exists(join(dir, 'package.json')) || exists(join(dir, 'node_modules'))) {
11667
+ // Found the 'package.json' file or 'node_modules' dir; we're done
11668
+ return dir;
11669
+ }
11670
+ if (prev === dir) {
11671
+ // Got to the top
11672
+ throw new Error('Could not find module root given file: "' + file + '". Do you have a `package.json` file? ');
11673
+ }
11674
+ // Try the parent dir next
11675
+ prev = dir;
11676
+ dir = join(dir, '..');
11594
11677
  }
11595
- // Try the parent dir next
11596
- prev = dir;
11597
- dir = join(dir, '..');
11598
- }
11599
- };
11600
- })(bindings, bindings.exports);
11601
- var bindingsExports = bindings.exports;
11678
+ };
11679
+ })(bindings, bindings.exports);
11680
+ return bindings.exports;
11681
+ }
11602
11682
 
11603
- var sqlite3Binding = bindingsExports('node_sqlite3.node');
11683
+ var sqlite3Binding;
11684
+ var hasRequiredSqlite3Binding;
11685
+ function requireSqlite3Binding() {
11686
+ if (hasRequiredSqlite3Binding) return sqlite3Binding;
11687
+ hasRequiredSqlite3Binding = 1;
11688
+ sqlite3Binding = requireBindings()('node_sqlite3.node');
11689
+ return sqlite3Binding;
11690
+ }
11604
11691
 
11605
11692
  var trace = {};
11606
11693
 
@@ -11644,177 +11731,184 @@ function requireTrace() {
11644
11731
  return trace;
11645
11732
  }
11646
11733
 
11647
- (function (module, exports) {
11648
- const path$1 = path;
11649
- const sqlite3 = sqlite3Binding;
11650
- const EventEmitter = require$$2.EventEmitter;
11651
- module.exports = sqlite3;
11652
- function normalizeMethod(fn) {
11653
- return function (sql) {
11654
- let errBack;
11655
- const args = Array.prototype.slice.call(arguments, 1);
11656
- if (typeof args[args.length - 1] === 'function') {
11657
- const callback = args[args.length - 1];
11658
- errBack = function (err) {
11659
- if (err) {
11660
- callback(err);
11661
- }
11662
- };
11663
- }
11664
- const statement = new Statement(this, sql, errBack);
11665
- return fn.call(this, statement, args);
11666
- };
11667
- }
11668
- function inherits(target, source) {
11669
- for (const k in source.prototype) target.prototype[k] = source.prototype[k];
11670
- }
11671
- sqlite3.cached = {
11672
- Database: function (file, a, b) {
11673
- if (file === '' || file === ':memory:') {
11674
- // Don't cache special databases.
11675
- return new Database(file, a, b);
11676
- }
11677
- let db;
11678
- file = path$1.resolve(file);
11679
- if (!sqlite3.cached.objects[file]) {
11680
- db = sqlite3.cached.objects[file] = new Database(file, a, b);
11681
- } else {
11682
- // Make sure the callback is called.
11683
- db = sqlite3.cached.objects[file];
11684
- const callback = typeof a === 'number' ? b : a;
11685
- if (typeof callback === 'function') {
11686
- function cb() {
11687
- callback.call(db, null);
11734
+ var hasRequiredSqlite3;
11735
+ function requireSqlite3() {
11736
+ if (hasRequiredSqlite3) return sqlite3$1.exports;
11737
+ hasRequiredSqlite3 = 1;
11738
+ (function (module, exports) {
11739
+ const path$1 = path;
11740
+ const sqlite3 = requireSqlite3Binding();
11741
+ const EventEmitter = require$$2.EventEmitter;
11742
+ module.exports = sqlite3;
11743
+ function normalizeMethod(fn) {
11744
+ return function (sql) {
11745
+ let errBack;
11746
+ const args = Array.prototype.slice.call(arguments, 1);
11747
+ if (typeof args[args.length - 1] === 'function') {
11748
+ const callback = args[args.length - 1];
11749
+ errBack = function (err) {
11750
+ if (err) {
11751
+ callback(err);
11752
+ }
11753
+ };
11754
+ }
11755
+ const statement = new Statement(this, sql, errBack);
11756
+ return fn.call(this, statement, args);
11757
+ };
11758
+ }
11759
+ function inherits(target, source) {
11760
+ for (const k in source.prototype) target.prototype[k] = source.prototype[k];
11761
+ }
11762
+ sqlite3.cached = {
11763
+ Database: function (file, a, b) {
11764
+ if (file === '' || file === ':memory:') {
11765
+ // Don't cache special databases.
11766
+ return new Database(file, a, b);
11767
+ }
11768
+ let db;
11769
+ file = path$1.resolve(file);
11770
+ if (!sqlite3.cached.objects[file]) {
11771
+ db = sqlite3.cached.objects[file] = new Database(file, a, b);
11772
+ } else {
11773
+ // Make sure the callback is called.
11774
+ db = sqlite3.cached.objects[file];
11775
+ const callback = typeof a === 'number' ? b : a;
11776
+ if (typeof callback === 'function') {
11777
+ function cb() {
11778
+ callback.call(db, null);
11779
+ }
11780
+ if (db.open) process.nextTick(cb);else db.once('open', cb);
11688
11781
  }
11689
- if (db.open) process.nextTick(cb);else db.once('open', cb);
11690
11782
  }
11691
- }
11692
- return db;
11693
- },
11694
- objects: {}
11695
- };
11696
- const Database = sqlite3.Database;
11697
- const Statement = sqlite3.Statement;
11698
- const Backup = sqlite3.Backup;
11699
- inherits(Database, EventEmitter);
11700
- inherits(Statement, EventEmitter);
11701
- inherits(Backup, EventEmitter);
11702
-
11703
- // Database#prepare(sql, [bind1, bind2, ...], [callback])
11704
- Database.prototype.prepare = normalizeMethod(function (statement, params) {
11705
- return params.length ? statement.bind.apply(statement, params) : statement;
11706
- });
11783
+ return db;
11784
+ },
11785
+ objects: {}
11786
+ };
11787
+ const Database = sqlite3.Database;
11788
+ const Statement = sqlite3.Statement;
11789
+ const Backup = sqlite3.Backup;
11790
+ inherits(Database, EventEmitter);
11791
+ inherits(Statement, EventEmitter);
11792
+ inherits(Backup, EventEmitter);
11793
+
11794
+ // Database#prepare(sql, [bind1, bind2, ...], [callback])
11795
+ Database.prototype.prepare = normalizeMethod(function (statement, params) {
11796
+ return params.length ? statement.bind.apply(statement, params) : statement;
11797
+ });
11707
11798
 
11708
- // Database#run(sql, [bind1, bind2, ...], [callback])
11709
- Database.prototype.run = normalizeMethod(function (statement, params) {
11710
- statement.run.apply(statement, params).finalize();
11711
- return this;
11712
- });
11799
+ // Database#run(sql, [bind1, bind2, ...], [callback])
11800
+ Database.prototype.run = normalizeMethod(function (statement, params) {
11801
+ statement.run.apply(statement, params).finalize();
11802
+ return this;
11803
+ });
11713
11804
 
11714
- // Database#get(sql, [bind1, bind2, ...], [callback])
11715
- Database.prototype.get = normalizeMethod(function (statement, params) {
11716
- statement.get.apply(statement, params).finalize();
11717
- return this;
11718
- });
11805
+ // Database#get(sql, [bind1, bind2, ...], [callback])
11806
+ Database.prototype.get = normalizeMethod(function (statement, params) {
11807
+ statement.get.apply(statement, params).finalize();
11808
+ return this;
11809
+ });
11719
11810
 
11720
- // Database#all(sql, [bind1, bind2, ...], [callback])
11721
- Database.prototype.all = normalizeMethod(function (statement, params) {
11722
- statement.all.apply(statement, params).finalize();
11723
- return this;
11724
- });
11811
+ // Database#all(sql, [bind1, bind2, ...], [callback])
11812
+ Database.prototype.all = normalizeMethod(function (statement, params) {
11813
+ statement.all.apply(statement, params).finalize();
11814
+ return this;
11815
+ });
11725
11816
 
11726
- // Database#each(sql, [bind1, bind2, ...], [callback], [complete])
11727
- Database.prototype.each = normalizeMethod(function (statement, params) {
11728
- statement.each.apply(statement, params).finalize();
11729
- return this;
11730
- });
11731
- Database.prototype.map = normalizeMethod(function (statement, params) {
11732
- statement.map.apply(statement, params).finalize();
11733
- return this;
11734
- });
11817
+ // Database#each(sql, [bind1, bind2, ...], [callback], [complete])
11818
+ Database.prototype.each = normalizeMethod(function (statement, params) {
11819
+ statement.each.apply(statement, params).finalize();
11820
+ return this;
11821
+ });
11822
+ Database.prototype.map = normalizeMethod(function (statement, params) {
11823
+ statement.map.apply(statement, params).finalize();
11824
+ return this;
11825
+ });
11735
11826
 
11736
- // Database#backup(filename, [callback])
11737
- // Database#backup(filename, destName, sourceName, filenameIsDest, [callback])
11738
- Database.prototype.backup = function () {
11739
- let backup;
11740
- if (arguments.length <= 2) {
11741
- // By default, we write the main database out to the main database of the named file.
11742
- // This is the most likely use of the backup api.
11743
- backup = new Backup(this, arguments[0], 'main', 'main', true, arguments[1]);
11744
- } else {
11745
- // Otherwise, give the user full control over the sqlite3_backup_init arguments.
11746
- backup = new Backup(this, arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]);
11747
- }
11748
- // Per the sqlite docs, exclude the following errors as non-fatal by default.
11749
- backup.retryErrors = [sqlite3.BUSY, sqlite3.LOCKED];
11750
- return backup;
11751
- };
11752
- Statement.prototype.map = function () {
11753
- const params = Array.prototype.slice.call(arguments);
11754
- const callback = params.pop();
11755
- params.push(function (err, rows) {
11756
- if (err) return callback(err);
11757
- const result = {};
11758
- if (rows.length) {
11759
- const keys = Object.keys(rows[0]);
11760
- const key = keys[0];
11761
- if (keys.length > 2) {
11762
- // Value is an object
11763
- for (let i = 0; i < rows.length; i++) {
11764
- result[rows[i][key]] = rows[i];
11765
- }
11766
- } else {
11767
- const value = keys[1];
11768
- // Value is a plain value
11769
- for (let i = 0; i < rows.length; i++) {
11770
- result[rows[i][key]] = rows[i][value];
11827
+ // Database#backup(filename, [callback])
11828
+ // Database#backup(filename, destName, sourceName, filenameIsDest, [callback])
11829
+ Database.prototype.backup = function () {
11830
+ let backup;
11831
+ if (arguments.length <= 2) {
11832
+ // By default, we write the main database out to the main database of the named file.
11833
+ // This is the most likely use of the backup api.
11834
+ backup = new Backup(this, arguments[0], 'main', 'main', true, arguments[1]);
11835
+ } else {
11836
+ // Otherwise, give the user full control over the sqlite3_backup_init arguments.
11837
+ backup = new Backup(this, arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]);
11838
+ }
11839
+ // Per the sqlite docs, exclude the following errors as non-fatal by default.
11840
+ backup.retryErrors = [sqlite3.BUSY, sqlite3.LOCKED];
11841
+ return backup;
11842
+ };
11843
+ Statement.prototype.map = function () {
11844
+ const params = Array.prototype.slice.call(arguments);
11845
+ const callback = params.pop();
11846
+ params.push(function (err, rows) {
11847
+ if (err) return callback(err);
11848
+ const result = {};
11849
+ if (rows.length) {
11850
+ const keys = Object.keys(rows[0]);
11851
+ const key = keys[0];
11852
+ if (keys.length > 2) {
11853
+ // Value is an object
11854
+ for (let i = 0; i < rows.length; i++) {
11855
+ result[rows[i][key]] = rows[i];
11856
+ }
11857
+ } else {
11858
+ const value = keys[1];
11859
+ // Value is a plain value
11860
+ for (let i = 0; i < rows.length; i++) {
11861
+ result[rows[i][key]] = rows[i][value];
11862
+ }
11771
11863
  }
11772
11864
  }
11865
+ callback(err, result);
11866
+ });
11867
+ return this.all.apply(this, params);
11868
+ };
11869
+ let isVerbose = false;
11870
+ const supportedEvents = ['trace', 'profile', 'change'];
11871
+ Database.prototype.addListener = Database.prototype.on = function (type) {
11872
+ const val = EventEmitter.prototype.addListener.apply(this, arguments);
11873
+ if (supportedEvents.indexOf(type) >= 0) {
11874
+ this.configure(type, true);
11875
+ }
11876
+ return val;
11877
+ };
11878
+ Database.prototype.removeListener = function (type) {
11879
+ const val = EventEmitter.prototype.removeListener.apply(this, arguments);
11880
+ if (supportedEvents.indexOf(type) >= 0 && !this._events[type]) {
11881
+ this.configure(type, false);
11773
11882
  }
11774
- callback(err, result);
11775
- });
11776
- return this.all.apply(this, params);
11777
- };
11778
- let isVerbose = false;
11779
- const supportedEvents = ['trace', 'profile', 'change'];
11780
- Database.prototype.addListener = Database.prototype.on = function (type) {
11781
- const val = EventEmitter.prototype.addListener.apply(this, arguments);
11782
- if (supportedEvents.indexOf(type) >= 0) {
11783
- this.configure(type, true);
11784
- }
11785
- return val;
11786
- };
11787
- Database.prototype.removeListener = function (type) {
11788
- const val = EventEmitter.prototype.removeListener.apply(this, arguments);
11789
- if (supportedEvents.indexOf(type) >= 0 && !this._events[type]) {
11790
- this.configure(type, false);
11791
- }
11792
- return val;
11793
- };
11794
- Database.prototype.removeAllListeners = function (type) {
11795
- const val = EventEmitter.prototype.removeAllListeners.apply(this, arguments);
11796
- if (supportedEvents.indexOf(type) >= 0) {
11797
- this.configure(type, false);
11798
- }
11799
- return val;
11800
- };
11883
+ return val;
11884
+ };
11885
+ Database.prototype.removeAllListeners = function (type) {
11886
+ const val = EventEmitter.prototype.removeAllListeners.apply(this, arguments);
11887
+ if (supportedEvents.indexOf(type) >= 0) {
11888
+ this.configure(type, false);
11889
+ }
11890
+ return val;
11891
+ };
11801
11892
 
11802
- // Save the stack trace over EIO callbacks.
11803
- sqlite3.verbose = function () {
11804
- if (!isVerbose) {
11805
- const trace = requireTrace();
11806
- ['prepare', 'get', 'run', 'all', 'each', 'map', 'close', 'exec'].forEach(function (name) {
11807
- trace.extendTrace(Database.prototype, name);
11808
- });
11809
- ['bind', 'get', 'run', 'all', 'each', 'map', 'reset', 'finalize'].forEach(function (name) {
11810
- trace.extendTrace(Statement.prototype, name);
11811
- });
11812
- isVerbose = true;
11813
- }
11814
- return sqlite3;
11815
- };
11816
- })(sqlite3$1);
11817
- var sqlite3Exports = sqlite3$1.exports;
11893
+ // Save the stack trace over EIO callbacks.
11894
+ sqlite3.verbose = function () {
11895
+ if (!isVerbose) {
11896
+ const trace = requireTrace();
11897
+ ['prepare', 'get', 'run', 'all', 'each', 'map', 'close', 'exec'].forEach(function (name) {
11898
+ trace.extendTrace(Database.prototype, name);
11899
+ });
11900
+ ['bind', 'get', 'run', 'all', 'each', 'map', 'reset', 'finalize'].forEach(function (name) {
11901
+ trace.extendTrace(Statement.prototype, name);
11902
+ });
11903
+ isVerbose = true;
11904
+ }
11905
+ return sqlite3;
11906
+ };
11907
+ })(sqlite3$1);
11908
+ return sqlite3$1.exports;
11909
+ }
11910
+
11911
+ var sqlite3Exports = requireSqlite3();
11818
11912
  var sqlite3 = /*@__PURE__*/getDefaultExportFromCjs(sqlite3Exports);
11819
11913
 
11820
11914
  function SQLiteResult(error, insertId, rowsAffected, rows) {