indexeddbshim 11.0.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /*! indexeddbshim - v11.0.0 - 4/9/2023 */
1
+ /*! indexeddbshim - v11.0.0 - 4/29/2023 */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1426,7 +1426,11 @@
1426
1426
  });
1427
1427
  });
1428
1428
 
1429
+ function getDefaultExportFromCjs$1(x) {
1430
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
1431
+ }
1429
1432
  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]/;
1433
+ var regex$1 = /*@__PURE__*/getDefaultExportFromCjs$1(regex);
1430
1434
 
1431
1435
  function escapeUnmatchedSurrogates(arg) {
1432
1436
  // http://stackoverflow.com/a/6701665/271577
@@ -1483,7 +1487,7 @@
1483
1487
  db = 'D' + escapeNameForSQLiteIdentifier(db);
1484
1488
  if (CFG.escapeNFDForDatabaseNames !== false) {
1485
1489
  // ES6 copying of regex with different flags
1486
- db = db.replace(new RegExp(regex, 'gu'), function (expandable) {
1490
+ db = db.replace(new RegExp(regex$1, 'gu'), function (expandable) {
1487
1491
  return '^4' + expandable.codePointAt().toString(16).padStart(6, '0');
1488
1492
  });
1489
1493
  }
@@ -2161,6 +2165,10 @@
2161
2165
  writable: false
2162
2166
  });
2163
2167
 
2168
+ function getDefaultExportFromCjs (x) {
2169
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
2170
+ }
2171
+
2164
2172
  // Since [immediate](https://github.com/calvinmetcalf/immediate) is
2165
2173
  // not doing the trick for our WebSQL transactions (at least in Node),
2166
2174
  // we are forced to make the promises run fully synchronously.
@@ -2309,6 +2317,7 @@
2309
2317
  });
2310
2318
  };
2311
2319
  var syncPromiseCommonjs = SyncPromise;
2320
+ var SyncPromise$1 = /*@__PURE__*/getDefaultExportFromCjs(syncPromiseCommonjs);
2312
2321
 
2313
2322
  /**
2314
2323
  * Compares two keys.
@@ -2779,6 +2788,15 @@
2779
2788
  invalid: true
2780
2789
  };
2781
2790
  }
2791
+
2792
+ // https://github.com/w3c/IndexedDB/issues/375
2793
+ // https://github.com/w3c/IndexedDB/pull/386
2794
+ if (Object.is(input, -0)) {
2795
+ return {
2796
+ type: type,
2797
+ value: 0
2798
+ };
2799
+ }
2782
2800
  return ret;
2783
2801
  }
2784
2802
  case 'string':
@@ -4192,14 +4210,14 @@
4192
4210
  bubbles: true,
4193
4211
  cancelable: true
4194
4212
  });
4195
- return new syncPromiseCommonjs(function (resolve) {
4213
+ return new SyncPromise$1(function (resolve) {
4196
4214
  setTimeout(function () {
4197
4215
  q.req.dispatchEvent(reqEvt); // No need to catch errors
4198
4216
  resolve();
4199
4217
  });
4200
4218
  });
4201
4219
  });
4202
- }, syncPromiseCommonjs.resolve()).then(function () {
4220
+ }, SyncPromise$1.resolve()).then(function () {
4203
4221
  // Also works when there are no pending requests
4204
4222
  var evt = createEvent('abort', err, {
4205
4223
  bubbles: true,
@@ -4690,7 +4708,7 @@
4690
4708
  type: o
4691
4709
  }));
4692
4710
  } : null;
4693
- if (["string", "boolean", "number", "undefined"].includes(m)) return void 0 === r || Number.isNaN(r) || r === Number.NEGATIVE_INFINITY || r === Number.POSITIVE_INFINITY ? (h = s.replaced ? r : replace(t, r, s, u, !1, d, O)) !== r && (g = {
4711
+ if (["string", "boolean", "number", "undefined"].includes(m)) return void 0 === r || Number.isNaN(r) || r === Number.NEGATIVE_INFINITY || r === Number.POSITIVE_INFINITY || 0 === r ? (h = s.replaced ? r : replace(t, r, s, u, !1, d, O)) !== r && (g = {
4694
4712
  replaced: h
4695
4713
  }) : h = r, O && O(), h;
4696
4714
  if (null === r) return O && O(), r;
@@ -5457,7 +5475,20 @@
5457
5475
  }
5458
5476
  }
5459
5477
  },
5460
- D = {
5478
+ F = {
5479
+ negativeZero: {
5480
+ test: function test(e) {
5481
+ return Object.is(e, -0);
5482
+ },
5483
+ replace: function replace(e) {
5484
+ return 0;
5485
+ },
5486
+ revive: function revive(e) {
5487
+ return -0;
5488
+ }
5489
+ }
5490
+ },
5491
+ M = {
5461
5492
  StringObject: {
5462
5493
  test: function test(e) {
5463
5494
  return "String" === toStringTag(e) && "object" == _typeof$2(e);
@@ -5486,7 +5517,7 @@
5486
5517
  }
5487
5518
  }
5488
5519
  },
5489
- M = {
5520
+ $ = {
5490
5521
  regexp: {
5491
5522
  test: function test(e) {
5492
5523
  return "RegExp" === toStringTag(e);
@@ -5504,7 +5535,7 @@
5504
5535
  }
5505
5536
  }
5506
5537
  },
5507
- J = {
5538
+ Y = {
5508
5539
  set: {
5509
5540
  test: function test(e) {
5510
5541
  return "Set" === toStringTag(e);
@@ -5517,11 +5548,11 @@
5517
5548
  }
5518
5549
  }
5519
5550
  },
5520
- Y = {};
5551
+ q = {};
5521
5552
  "function" == typeof Int8Array && [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array].forEach(function (e) {
5522
5553
  return function create$1(e) {
5523
5554
  var t = e.name;
5524
- Y[t.toLowerCase()] = {
5555
+ q[t.toLowerCase()] = {
5525
5556
  test: function test(e) {
5526
5557
  return toStringTag(e) === t;
5527
5558
  },
@@ -5534,11 +5565,11 @@
5534
5565
  };
5535
5566
  }(e);
5536
5567
  });
5537
- var q = {};
5568
+ var W = {};
5538
5569
  "function" == typeof Int8Array && [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array].forEach(function (e) {
5539
5570
  return function create(e) {
5540
5571
  var t = e.name;
5541
- q[t.toLowerCase()] = {
5572
+ W[t.toLowerCase()] = {
5542
5573
  test: function test(e) {
5543
5574
  return toStringTag(e) === t;
5544
5575
  },
@@ -5570,7 +5601,7 @@
5570
5601
  };
5571
5602
  }(e);
5572
5603
  });
5573
- var W = {
5604
+ var G = {
5574
5605
  undef: {
5575
5606
  test: function test(e, t) {
5576
5607
  return void 0 === e && (t.ownKeys || !("ownKeys" in t));
@@ -5583,7 +5614,7 @@
5583
5614
  }
5584
5615
  }
5585
5616
  },
5586
- G = {
5617
+ H = {
5587
5618
  userObject: {
5588
5619
  test: function test(e, t) {
5589
5620
  return isUserObject(e);
@@ -5596,7 +5627,7 @@
5596
5627
  }
5597
5628
  }
5598
5629
  },
5599
- H = [{
5630
+ X = [{
5600
5631
  arrayNonindexKeys: {
5601
5632
  testPlainObjects: !0,
5602
5633
  test: function test(e, t) {
@@ -5627,9 +5658,9 @@
5627
5658
  revive: function revive(e) {}
5628
5659
  }
5629
5660
  }],
5630
- X = [K, x, L],
5631
- te = [G, W, H, D, X, j, M, C, E, N, P, O, T, I].concat("function" == typeof Map ? U : [], "function" == typeof Set ? J : [], "function" == typeof ArrayBuffer ? h : [], "function" == typeof Uint8Array ? q : [], "function" == typeof DataView ? w : [], "undefined" != typeof Intl ? B : [], "undefined" != typeof crypto ? A : [], "undefined" != typeof BigInt ? [m, g] : []);
5632
- var re = te.concat({
5661
+ Z = [K, x, L, F],
5662
+ re = [H, G, X, M, Z, j, $, C, E, N, P, O, T, I].concat("function" == typeof Map ? U : [], "function" == typeof Set ? Y : [], "function" == typeof ArrayBuffer ? h : [], "function" == typeof Uint8Array ? W : [], "function" == typeof DataView ? w : [], "undefined" != typeof Intl ? B : [], "undefined" != typeof crypto ? A : [], "undefined" != typeof BigInt ? [m, g] : []);
5663
+ var ne = re.concat({
5633
5664
  checkDataCloneException: {
5634
5665
  test: function test(e) {
5635
5666
  var t = {}.toString.call(e).slice(8, -1);
@@ -5641,9 +5672,9 @@
5641
5672
 
5642
5673
  // See: http://stackoverflow.com/questions/42170826/categories-for-rejection-by-the-structured-cloning-algorithm
5643
5674
 
5644
- var typeson = new u().register(re);
5675
+ var typeson = new u().register(ne);
5645
5676
  function register(func) {
5646
- typeson = new u().register(func(re));
5677
+ typeson = new u().register(func(ne));
5647
5678
  }
5648
5679
 
5649
5680
  // We are keeping the callback approach for now in case we wish to reexpose
@@ -6142,7 +6173,7 @@
6142
6173
  }
6143
6174
  var indexCreations = colNamesToPreserve.slice(2) // Doing `key` separately and no need for index on `value`
6144
6175
  .map(function (escapedIndexNameSQL) {
6145
- return new syncPromiseCommonjs(function (resolve, reject) {
6176
+ return new SyncPromise$1(function (resolve, reject) {
6146
6177
  var escapedIndexToRecreate = sqlQuote(escapedStoreNameSQL.slice(1, -1) + '^5' + escapedIndexNameSQL.slice(1, -1));
6147
6178
  // const sql = 'DROP INDEX IF EXISTS ' + escapedIndexToRecreate;
6148
6179
  // CFG.DEBUG && console.log(sql);
@@ -6158,7 +6189,7 @@
6158
6189
  });
6159
6190
  });
6160
6191
 
6161
- indexCreations.push(new syncPromiseCommonjs(function (resolve, reject) {
6192
+ indexCreations.push(new SyncPromise$1(function (resolve, reject) {
6162
6193
  var escapedIndexToRecreate = sqlQuote('sk_' + escapedStoreNameSQL.slice(1, -1));
6163
6194
  // Chrome erring here if not dropped first; Node does not
6164
6195
  var sql = 'DROP INDEX IF EXISTS ' + escapedIndexToRecreate;
@@ -6173,7 +6204,7 @@
6173
6204
  reject(err);
6174
6205
  });
6175
6206
  }));
6176
- syncPromiseCommonjs.all(indexCreations).then(finish, error)["catch"](function (err) {
6207
+ SyncPromise$1.all(indexCreations).then(finish, error)["catch"](function (err) {
6177
6208
  console.log('Index rename error');
6178
6209
  throw err;
6179
6210
  });
@@ -6642,7 +6673,7 @@
6642
6673
  // idea is to avoid, where possible, unnecessary delays (and
6643
6674
  // consuming code ought to only see a difference in the browser
6644
6675
  // where we can't control the transaction timeout anyways).
6645
- return new syncPromiseCommonjs(function (resolve, reject) {
6676
+ return new SyncPromise$1(function (resolve, reject) {
6646
6677
  var index = me.__indexes[indexName];
6647
6678
  if (
6648
6679
  // `createIndex` was called synchronously after the current insertion was added to
@@ -6693,7 +6724,7 @@
6693
6724
  }
6694
6725
  });
6695
6726
  });
6696
- return syncPromiseCommonjs.all(indexPromises).then(function () {
6727
+ return SyncPromise$1.all(indexPromises).then(function () {
6697
6728
  var sqlStart = ['INSERT INTO', escapeStoreNameForSQL(me.__currentName), '('];
6698
6729
  var sqlEnd = [' VALUES ('];
6699
6730
  var insertSqlValues = [];
@@ -7630,18 +7661,18 @@
7630
7661
  oldVersion: oldVersion,
7631
7662
  newVersion: newVersion
7632
7663
  });
7633
- return new syncPromiseCommonjs(function (resolve) {
7664
+ return new SyncPromise$1(function (resolve) {
7634
7665
  setTimeout(function () {
7635
7666
  entry.dispatchEvent(e); // No need to catch errors
7636
7667
  resolve();
7637
7668
  });
7638
7669
  });
7639
7670
  });
7640
- }, syncPromiseCommonjs.resolve()).then(function () {
7671
+ }, SyncPromise$1.resolve()).then(function () {
7641
7672
  if (connectionsClosed()) {
7642
7673
  return undefined;
7643
7674
  }
7644
- return new syncPromiseCommonjs(function (resolve) {
7675
+ return new SyncPromise$1(function (resolve) {
7645
7676
  var unblocking = {
7646
7677
  check: function check() {
7647
7678
  if (connectionsClosed()) {