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 (factory) {
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -1431,7 +1431,11 @@
1431
1431
  });
1432
1432
  });
1433
1433
 
1434
+ function getDefaultExportFromCjs$1(x) {
1435
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
1436
+ }
1434
1437
  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]/;
1438
+ var regex$1 = /*@__PURE__*/getDefaultExportFromCjs$1(regex);
1435
1439
 
1436
1440
  function escapeUnmatchedSurrogates(arg) {
1437
1441
  // http://stackoverflow.com/a/6701665/271577
@@ -1488,7 +1492,7 @@
1488
1492
  db = 'D' + escapeNameForSQLiteIdentifier(db);
1489
1493
  if (CFG.escapeNFDForDatabaseNames !== false) {
1490
1494
  // ES6 copying of regex with different flags
1491
- db = db.replace(new RegExp(regex, 'gu'), function (expandable) {
1495
+ db = db.replace(new RegExp(regex$1, 'gu'), function (expandable) {
1492
1496
  return '^4' + expandable.codePointAt().toString(16).padStart(6, '0');
1493
1497
  });
1494
1498
  }
@@ -2166,6 +2170,10 @@
2166
2170
  writable: false
2167
2171
  });
2168
2172
 
2173
+ function getDefaultExportFromCjs (x) {
2174
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
2175
+ }
2176
+
2169
2177
  // Since [immediate](https://github.com/calvinmetcalf/immediate) is
2170
2178
  // not doing the trick for our WebSQL transactions (at least in Node),
2171
2179
  // we are forced to make the promises run fully synchronously.
@@ -2314,6 +2322,7 @@
2314
2322
  });
2315
2323
  };
2316
2324
  var syncPromiseCommonjs = SyncPromise;
2325
+ var SyncPromise$1 = /*@__PURE__*/getDefaultExportFromCjs(syncPromiseCommonjs);
2317
2326
 
2318
2327
  /**
2319
2328
  * Compares two keys.
@@ -2784,6 +2793,15 @@
2784
2793
  invalid: true
2785
2794
  };
2786
2795
  }
2796
+
2797
+ // https://github.com/w3c/IndexedDB/issues/375
2798
+ // https://github.com/w3c/IndexedDB/pull/386
2799
+ if (Object.is(input, -0)) {
2800
+ return {
2801
+ type: type,
2802
+ value: 0
2803
+ };
2804
+ }
2787
2805
  return ret;
2788
2806
  }
2789
2807
  case 'string':
@@ -4197,14 +4215,14 @@
4197
4215
  bubbles: true,
4198
4216
  cancelable: true
4199
4217
  });
4200
- return new syncPromiseCommonjs(function (resolve) {
4218
+ return new SyncPromise$1(function (resolve) {
4201
4219
  setTimeout(function () {
4202
4220
  q.req.dispatchEvent(reqEvt); // No need to catch errors
4203
4221
  resolve();
4204
4222
  });
4205
4223
  });
4206
4224
  });
4207
- }, syncPromiseCommonjs.resolve()).then(function () {
4225
+ }, SyncPromise$1.resolve()).then(function () {
4208
4226
  // Also works when there are no pending requests
4209
4227
  var evt = createEvent('abort', err, {
4210
4228
  bubbles: true,
@@ -4695,7 +4713,7 @@
4695
4713
  type: o
4696
4714
  }));
4697
4715
  } : null;
4698
- 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 = {
4716
+ 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 = {
4699
4717
  replaced: h
4700
4718
  }) : h = r, O && O(), h;
4701
4719
  if (null === r) return O && O(), r;
@@ -5462,7 +5480,20 @@
5462
5480
  }
5463
5481
  }
5464
5482
  },
5465
- D = {
5483
+ F = {
5484
+ negativeZero: {
5485
+ test: function test(e) {
5486
+ return Object.is(e, -0);
5487
+ },
5488
+ replace: function replace(e) {
5489
+ return 0;
5490
+ },
5491
+ revive: function revive(e) {
5492
+ return -0;
5493
+ }
5494
+ }
5495
+ },
5496
+ M = {
5466
5497
  StringObject: {
5467
5498
  test: function test(e) {
5468
5499
  return "String" === toStringTag(e) && "object" == _typeof$2(e);
@@ -5491,7 +5522,7 @@
5491
5522
  }
5492
5523
  }
5493
5524
  },
5494
- M = {
5525
+ $ = {
5495
5526
  regexp: {
5496
5527
  test: function test(e) {
5497
5528
  return "RegExp" === toStringTag(e);
@@ -5509,7 +5540,7 @@
5509
5540
  }
5510
5541
  }
5511
5542
  },
5512
- J = {
5543
+ Y = {
5513
5544
  set: {
5514
5545
  test: function test(e) {
5515
5546
  return "Set" === toStringTag(e);
@@ -5522,11 +5553,11 @@
5522
5553
  }
5523
5554
  }
5524
5555
  },
5525
- Y = {};
5556
+ q = {};
5526
5557
  "function" == typeof Int8Array && [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array].forEach(function (e) {
5527
5558
  return function create$1(e) {
5528
5559
  var t = e.name;
5529
- Y[t.toLowerCase()] = {
5560
+ q[t.toLowerCase()] = {
5530
5561
  test: function test(e) {
5531
5562
  return toStringTag(e) === t;
5532
5563
  },
@@ -5539,11 +5570,11 @@
5539
5570
  };
5540
5571
  }(e);
5541
5572
  });
5542
- var q = {};
5573
+ var W = {};
5543
5574
  "function" == typeof Int8Array && [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array].forEach(function (e) {
5544
5575
  return function create(e) {
5545
5576
  var t = e.name;
5546
- q[t.toLowerCase()] = {
5577
+ W[t.toLowerCase()] = {
5547
5578
  test: function test(e) {
5548
5579
  return toStringTag(e) === t;
5549
5580
  },
@@ -5575,7 +5606,7 @@
5575
5606
  };
5576
5607
  }(e);
5577
5608
  });
5578
- var W = {
5609
+ var G = {
5579
5610
  undef: {
5580
5611
  test: function test(e, t) {
5581
5612
  return void 0 === e && (t.ownKeys || !("ownKeys" in t));
@@ -5588,7 +5619,7 @@
5588
5619
  }
5589
5620
  }
5590
5621
  },
5591
- G = {
5622
+ H = {
5592
5623
  userObject: {
5593
5624
  test: function test(e, t) {
5594
5625
  return isUserObject(e);
@@ -5601,7 +5632,7 @@
5601
5632
  }
5602
5633
  }
5603
5634
  },
5604
- H = [{
5635
+ X = [{
5605
5636
  arrayNonindexKeys: {
5606
5637
  testPlainObjects: !0,
5607
5638
  test: function test(e, t) {
@@ -5632,9 +5663,9 @@
5632
5663
  revive: function revive(e) {}
5633
5664
  }
5634
5665
  }],
5635
- X = [K, x, L],
5636
- 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] : []);
5637
- var re = te.concat({
5666
+ Z = [K, x, L, F],
5667
+ 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] : []);
5668
+ var ne = re.concat({
5638
5669
  checkDataCloneException: {
5639
5670
  test: function test(e) {
5640
5671
  var t = {}.toString.call(e).slice(8, -1);
@@ -5646,9 +5677,9 @@
5646
5677
 
5647
5678
  // See: http://stackoverflow.com/questions/42170826/categories-for-rejection-by-the-structured-cloning-algorithm
5648
5679
 
5649
- var typeson = new u().register(re);
5680
+ var typeson = new u().register(ne);
5650
5681
  function register(func) {
5651
- typeson = new u().register(func(re));
5682
+ typeson = new u().register(func(ne));
5652
5683
  }
5653
5684
 
5654
5685
  // We are keeping the callback approach for now in case we wish to reexpose
@@ -6147,7 +6178,7 @@
6147
6178
  }
6148
6179
  var indexCreations = colNamesToPreserve.slice(2) // Doing `key` separately and no need for index on `value`
6149
6180
  .map(function (escapedIndexNameSQL) {
6150
- return new syncPromiseCommonjs(function (resolve, reject) {
6181
+ return new SyncPromise$1(function (resolve, reject) {
6151
6182
  var escapedIndexToRecreate = sqlQuote(escapedStoreNameSQL.slice(1, -1) + '^5' + escapedIndexNameSQL.slice(1, -1));
6152
6183
  // const sql = 'DROP INDEX IF EXISTS ' + escapedIndexToRecreate;
6153
6184
  // CFG.DEBUG && console.log(sql);
@@ -6163,7 +6194,7 @@
6163
6194
  });
6164
6195
  });
6165
6196
 
6166
- indexCreations.push(new syncPromiseCommonjs(function (resolve, reject) {
6197
+ indexCreations.push(new SyncPromise$1(function (resolve, reject) {
6167
6198
  var escapedIndexToRecreate = sqlQuote('sk_' + escapedStoreNameSQL.slice(1, -1));
6168
6199
  // Chrome erring here if not dropped first; Node does not
6169
6200
  var sql = 'DROP INDEX IF EXISTS ' + escapedIndexToRecreate;
@@ -6178,7 +6209,7 @@
6178
6209
  reject(err);
6179
6210
  });
6180
6211
  }));
6181
- syncPromiseCommonjs.all(indexCreations).then(finish, error)["catch"](function (err) {
6212
+ SyncPromise$1.all(indexCreations).then(finish, error)["catch"](function (err) {
6182
6213
  console.log('Index rename error');
6183
6214
  throw err;
6184
6215
  });
@@ -6647,7 +6678,7 @@
6647
6678
  // idea is to avoid, where possible, unnecessary delays (and
6648
6679
  // consuming code ought to only see a difference in the browser
6649
6680
  // where we can't control the transaction timeout anyways).
6650
- return new syncPromiseCommonjs(function (resolve, reject) {
6681
+ return new SyncPromise$1(function (resolve, reject) {
6651
6682
  var index = me.__indexes[indexName];
6652
6683
  if (
6653
6684
  // `createIndex` was called synchronously after the current insertion was added to
@@ -6698,7 +6729,7 @@
6698
6729
  }
6699
6730
  });
6700
6731
  });
6701
- return syncPromiseCommonjs.all(indexPromises).then(function () {
6732
+ return SyncPromise$1.all(indexPromises).then(function () {
6702
6733
  var sqlStart = ['INSERT INTO', escapeStoreNameForSQL(me.__currentName), '('];
6703
6734
  var sqlEnd = [' VALUES ('];
6704
6735
  var insertSqlValues = [];
@@ -7635,18 +7666,18 @@
7635
7666
  oldVersion: oldVersion,
7636
7667
  newVersion: newVersion
7637
7668
  });
7638
- return new syncPromiseCommonjs(function (resolve) {
7669
+ return new SyncPromise$1(function (resolve) {
7639
7670
  setTimeout(function () {
7640
7671
  entry.dispatchEvent(e); // No need to catch errors
7641
7672
  resolve();
7642
7673
  });
7643
7674
  });
7644
7675
  });
7645
- }, syncPromiseCommonjs.resolve()).then(function () {
7676
+ }, SyncPromise$1.resolve()).then(function () {
7646
7677
  if (connectionsClosed()) {
7647
7678
  return undefined;
7648
7679
  }
7649
- return new syncPromiseCommonjs(function (resolve) {
7680
+ return new SyncPromise$1(function (resolve) {
7650
7681
  var unblocking = {
7651
7682
  check: function check() {
7652
7683
  if (connectionsClosed()) {