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.
- package/badges/licenses-badge.svg +1 -1
- package/dist/indexeddbshim-Key.js +10 -1
- package/dist/indexeddbshim-Key.js.map +1 -1
- package/dist/indexeddbshim-Key.min.js +2 -2
- package/dist/indexeddbshim-Key.min.js.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +79 -133
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.js +59 -28
- package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js +2 -2
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
- package/dist/indexeddbshim-node.cjs +79 -133
- package/dist/indexeddbshim-node.cjs.map +1 -1
- package/dist/indexeddbshim-noninvasive.js +59 -28
- package/dist/indexeddbshim-noninvasive.js.map +1 -1
- package/dist/indexeddbshim-noninvasive.min.js +2 -2
- package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
- package/dist/indexeddbshim.js +59 -28
- package/dist/indexeddbshim.js.map +1 -1
- package/dist/indexeddbshim.min.js +2 -2
- package/dist/indexeddbshim.min.js.map +1 -1
- package/package.json +15 -15
- package/src/Key.js +6 -0
- package/src/unicode-regex.js +7 -1
package/dist/indexeddbshim.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! indexeddbshim - v11.0.0 - 4/
|
|
1
|
+
/*! indexeddbshim - v11.0.0 - 4/29/2023 */
|
|
2
2
|
|
|
3
3
|
(function (factory) {
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -1419,7 +1419,11 @@
|
|
|
1419
1419
|
});
|
|
1420
1420
|
});
|
|
1421
1421
|
|
|
1422
|
+
function getDefaultExportFromCjs$1(x) {
|
|
1423
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
1424
|
+
}
|
|
1422
1425
|
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]/;
|
|
1426
|
+
var regex$1 = /*@__PURE__*/getDefaultExportFromCjs$1(regex);
|
|
1423
1427
|
|
|
1424
1428
|
function escapeUnmatchedSurrogates(arg) {
|
|
1425
1429
|
// http://stackoverflow.com/a/6701665/271577
|
|
@@ -1476,7 +1480,7 @@
|
|
|
1476
1480
|
db = 'D' + escapeNameForSQLiteIdentifier(db);
|
|
1477
1481
|
if (CFG.escapeNFDForDatabaseNames !== false) {
|
|
1478
1482
|
// ES6 copying of regex with different flags
|
|
1479
|
-
db = db.replace(new RegExp(regex, 'gu'), function (expandable) {
|
|
1483
|
+
db = db.replace(new RegExp(regex$1, 'gu'), function (expandable) {
|
|
1480
1484
|
return '^4' + expandable.codePointAt().toString(16).padStart(6, '0');
|
|
1481
1485
|
});
|
|
1482
1486
|
}
|
|
@@ -2154,6 +2158,10 @@
|
|
|
2154
2158
|
writable: false
|
|
2155
2159
|
});
|
|
2156
2160
|
|
|
2161
|
+
function getDefaultExportFromCjs (x) {
|
|
2162
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2157
2165
|
// Since [immediate](https://github.com/calvinmetcalf/immediate) is
|
|
2158
2166
|
// not doing the trick for our WebSQL transactions (at least in Node),
|
|
2159
2167
|
// we are forced to make the promises run fully synchronously.
|
|
@@ -2302,6 +2310,7 @@
|
|
|
2302
2310
|
});
|
|
2303
2311
|
};
|
|
2304
2312
|
var syncPromiseCommonjs = SyncPromise;
|
|
2313
|
+
var SyncPromise$1 = /*@__PURE__*/getDefaultExportFromCjs(syncPromiseCommonjs);
|
|
2305
2314
|
|
|
2306
2315
|
/**
|
|
2307
2316
|
* Compares two keys.
|
|
@@ -2772,6 +2781,15 @@
|
|
|
2772
2781
|
invalid: true
|
|
2773
2782
|
};
|
|
2774
2783
|
}
|
|
2784
|
+
|
|
2785
|
+
// https://github.com/w3c/IndexedDB/issues/375
|
|
2786
|
+
// https://github.com/w3c/IndexedDB/pull/386
|
|
2787
|
+
if (Object.is(input, -0)) {
|
|
2788
|
+
return {
|
|
2789
|
+
type: type,
|
|
2790
|
+
value: 0
|
|
2791
|
+
};
|
|
2792
|
+
}
|
|
2775
2793
|
return ret;
|
|
2776
2794
|
}
|
|
2777
2795
|
case 'string':
|
|
@@ -4185,14 +4203,14 @@
|
|
|
4185
4203
|
bubbles: true,
|
|
4186
4204
|
cancelable: true
|
|
4187
4205
|
});
|
|
4188
|
-
return new
|
|
4206
|
+
return new SyncPromise$1(function (resolve) {
|
|
4189
4207
|
setTimeout(function () {
|
|
4190
4208
|
q.req.dispatchEvent(reqEvt); // No need to catch errors
|
|
4191
4209
|
resolve();
|
|
4192
4210
|
});
|
|
4193
4211
|
});
|
|
4194
4212
|
});
|
|
4195
|
-
},
|
|
4213
|
+
}, SyncPromise$1.resolve()).then(function () {
|
|
4196
4214
|
// Also works when there are no pending requests
|
|
4197
4215
|
var evt = createEvent('abort', err, {
|
|
4198
4216
|
bubbles: true,
|
|
@@ -4683,7 +4701,7 @@
|
|
|
4683
4701
|
type: o
|
|
4684
4702
|
}));
|
|
4685
4703
|
} : null;
|
|
4686
|
-
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 = {
|
|
4704
|
+
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 = {
|
|
4687
4705
|
replaced: h
|
|
4688
4706
|
}) : h = r, O && O(), h;
|
|
4689
4707
|
if (null === r) return O && O(), r;
|
|
@@ -5450,7 +5468,20 @@
|
|
|
5450
5468
|
}
|
|
5451
5469
|
}
|
|
5452
5470
|
},
|
|
5453
|
-
|
|
5471
|
+
F = {
|
|
5472
|
+
negativeZero: {
|
|
5473
|
+
test: function test(e) {
|
|
5474
|
+
return Object.is(e, -0);
|
|
5475
|
+
},
|
|
5476
|
+
replace: function replace(e) {
|
|
5477
|
+
return 0;
|
|
5478
|
+
},
|
|
5479
|
+
revive: function revive(e) {
|
|
5480
|
+
return -0;
|
|
5481
|
+
}
|
|
5482
|
+
}
|
|
5483
|
+
},
|
|
5484
|
+
M = {
|
|
5454
5485
|
StringObject: {
|
|
5455
5486
|
test: function test(e) {
|
|
5456
5487
|
return "String" === toStringTag(e) && "object" == _typeof$2(e);
|
|
@@ -5479,7 +5510,7 @@
|
|
|
5479
5510
|
}
|
|
5480
5511
|
}
|
|
5481
5512
|
},
|
|
5482
|
-
|
|
5513
|
+
$ = {
|
|
5483
5514
|
regexp: {
|
|
5484
5515
|
test: function test(e) {
|
|
5485
5516
|
return "RegExp" === toStringTag(e);
|
|
@@ -5497,7 +5528,7 @@
|
|
|
5497
5528
|
}
|
|
5498
5529
|
}
|
|
5499
5530
|
},
|
|
5500
|
-
|
|
5531
|
+
Y = {
|
|
5501
5532
|
set: {
|
|
5502
5533
|
test: function test(e) {
|
|
5503
5534
|
return "Set" === toStringTag(e);
|
|
@@ -5510,11 +5541,11 @@
|
|
|
5510
5541
|
}
|
|
5511
5542
|
}
|
|
5512
5543
|
},
|
|
5513
|
-
|
|
5544
|
+
q = {};
|
|
5514
5545
|
"function" == typeof Int8Array && [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array].forEach(function (e) {
|
|
5515
5546
|
return function create$1(e) {
|
|
5516
5547
|
var t = e.name;
|
|
5517
|
-
|
|
5548
|
+
q[t.toLowerCase()] = {
|
|
5518
5549
|
test: function test(e) {
|
|
5519
5550
|
return toStringTag(e) === t;
|
|
5520
5551
|
},
|
|
@@ -5527,11 +5558,11 @@
|
|
|
5527
5558
|
};
|
|
5528
5559
|
}(e);
|
|
5529
5560
|
});
|
|
5530
|
-
var
|
|
5561
|
+
var W = {};
|
|
5531
5562
|
"function" == typeof Int8Array && [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array].forEach(function (e) {
|
|
5532
5563
|
return function create(e) {
|
|
5533
5564
|
var t = e.name;
|
|
5534
|
-
|
|
5565
|
+
W[t.toLowerCase()] = {
|
|
5535
5566
|
test: function test(e) {
|
|
5536
5567
|
return toStringTag(e) === t;
|
|
5537
5568
|
},
|
|
@@ -5563,7 +5594,7 @@
|
|
|
5563
5594
|
};
|
|
5564
5595
|
}(e);
|
|
5565
5596
|
});
|
|
5566
|
-
var
|
|
5597
|
+
var G = {
|
|
5567
5598
|
undef: {
|
|
5568
5599
|
test: function test(e, t) {
|
|
5569
5600
|
return void 0 === e && (t.ownKeys || !("ownKeys" in t));
|
|
@@ -5576,7 +5607,7 @@
|
|
|
5576
5607
|
}
|
|
5577
5608
|
}
|
|
5578
5609
|
},
|
|
5579
|
-
|
|
5610
|
+
H = {
|
|
5580
5611
|
userObject: {
|
|
5581
5612
|
test: function test(e, t) {
|
|
5582
5613
|
return isUserObject(e);
|
|
@@ -5589,7 +5620,7 @@
|
|
|
5589
5620
|
}
|
|
5590
5621
|
}
|
|
5591
5622
|
},
|
|
5592
|
-
|
|
5623
|
+
X = [{
|
|
5593
5624
|
arrayNonindexKeys: {
|
|
5594
5625
|
testPlainObjects: !0,
|
|
5595
5626
|
test: function test(e, t) {
|
|
@@ -5620,9 +5651,9 @@
|
|
|
5620
5651
|
revive: function revive(e) {}
|
|
5621
5652
|
}
|
|
5622
5653
|
}],
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
var
|
|
5654
|
+
Z = [K, x, L, F],
|
|
5655
|
+
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] : []);
|
|
5656
|
+
var ne = re.concat({
|
|
5626
5657
|
checkDataCloneException: {
|
|
5627
5658
|
test: function test(e) {
|
|
5628
5659
|
var t = {}.toString.call(e).slice(8, -1);
|
|
@@ -5634,9 +5665,9 @@
|
|
|
5634
5665
|
|
|
5635
5666
|
// See: http://stackoverflow.com/questions/42170826/categories-for-rejection-by-the-structured-cloning-algorithm
|
|
5636
5667
|
|
|
5637
|
-
var typeson = new u().register(
|
|
5668
|
+
var typeson = new u().register(ne);
|
|
5638
5669
|
function register(func) {
|
|
5639
|
-
typeson = new u().register(func(
|
|
5670
|
+
typeson = new u().register(func(ne));
|
|
5640
5671
|
}
|
|
5641
5672
|
|
|
5642
5673
|
// We are keeping the callback approach for now in case we wish to reexpose
|
|
@@ -6135,7 +6166,7 @@
|
|
|
6135
6166
|
}
|
|
6136
6167
|
var indexCreations = colNamesToPreserve.slice(2) // Doing `key` separately and no need for index on `value`
|
|
6137
6168
|
.map(function (escapedIndexNameSQL) {
|
|
6138
|
-
return new
|
|
6169
|
+
return new SyncPromise$1(function (resolve, reject) {
|
|
6139
6170
|
var escapedIndexToRecreate = sqlQuote(escapedStoreNameSQL.slice(1, -1) + '^5' + escapedIndexNameSQL.slice(1, -1));
|
|
6140
6171
|
// const sql = 'DROP INDEX IF EXISTS ' + escapedIndexToRecreate;
|
|
6141
6172
|
// CFG.DEBUG && console.log(sql);
|
|
@@ -6151,7 +6182,7 @@
|
|
|
6151
6182
|
});
|
|
6152
6183
|
});
|
|
6153
6184
|
|
|
6154
|
-
indexCreations.push(new
|
|
6185
|
+
indexCreations.push(new SyncPromise$1(function (resolve, reject) {
|
|
6155
6186
|
var escapedIndexToRecreate = sqlQuote('sk_' + escapedStoreNameSQL.slice(1, -1));
|
|
6156
6187
|
// Chrome erring here if not dropped first; Node does not
|
|
6157
6188
|
var sql = 'DROP INDEX IF EXISTS ' + escapedIndexToRecreate;
|
|
@@ -6166,7 +6197,7 @@
|
|
|
6166
6197
|
reject(err);
|
|
6167
6198
|
});
|
|
6168
6199
|
}));
|
|
6169
|
-
|
|
6200
|
+
SyncPromise$1.all(indexCreations).then(finish, error)["catch"](function (err) {
|
|
6170
6201
|
console.log('Index rename error');
|
|
6171
6202
|
throw err;
|
|
6172
6203
|
});
|
|
@@ -6635,7 +6666,7 @@
|
|
|
6635
6666
|
// idea is to avoid, where possible, unnecessary delays (and
|
|
6636
6667
|
// consuming code ought to only see a difference in the browser
|
|
6637
6668
|
// where we can't control the transaction timeout anyways).
|
|
6638
|
-
return new
|
|
6669
|
+
return new SyncPromise$1(function (resolve, reject) {
|
|
6639
6670
|
var index = me.__indexes[indexName];
|
|
6640
6671
|
if (
|
|
6641
6672
|
// `createIndex` was called synchronously after the current insertion was added to
|
|
@@ -6686,7 +6717,7 @@
|
|
|
6686
6717
|
}
|
|
6687
6718
|
});
|
|
6688
6719
|
});
|
|
6689
|
-
return
|
|
6720
|
+
return SyncPromise$1.all(indexPromises).then(function () {
|
|
6690
6721
|
var sqlStart = ['INSERT INTO', escapeStoreNameForSQL(me.__currentName), '('];
|
|
6691
6722
|
var sqlEnd = [' VALUES ('];
|
|
6692
6723
|
var insertSqlValues = [];
|
|
@@ -7623,18 +7654,18 @@
|
|
|
7623
7654
|
oldVersion: oldVersion,
|
|
7624
7655
|
newVersion: newVersion
|
|
7625
7656
|
});
|
|
7626
|
-
return new
|
|
7657
|
+
return new SyncPromise$1(function (resolve) {
|
|
7627
7658
|
setTimeout(function () {
|
|
7628
7659
|
entry.dispatchEvent(e); // No need to catch errors
|
|
7629
7660
|
resolve();
|
|
7630
7661
|
});
|
|
7631
7662
|
});
|
|
7632
7663
|
});
|
|
7633
|
-
},
|
|
7664
|
+
}, SyncPromise$1.resolve()).then(function () {
|
|
7634
7665
|
if (connectionsClosed()) {
|
|
7635
7666
|
return undefined;
|
|
7636
7667
|
}
|
|
7637
|
-
return new
|
|
7668
|
+
return new SyncPromise$1(function (resolve) {
|
|
7638
7669
|
var unblocking = {
|
|
7639
7670
|
check: function check() {
|
|
7640
7671
|
if (connectionsClosed()) {
|