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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! indexeddbshim - v11.0.0 - 4/
|
|
1
|
+
/*! indexeddbshim - v11.0.0 - 4/29/2023 */
|
|
2
2
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -6,86 +6,6 @@ var fs$1 = require('node:fs');
|
|
|
6
6
|
var path = require('path');
|
|
7
7
|
var customOpenDatabase = require('websql/custom/index.js');
|
|
8
8
|
|
|
9
|
-
function ownKeys$1(object, enumerableOnly) {
|
|
10
|
-
var keys = Object.keys(object);
|
|
11
|
-
if (Object.getOwnPropertySymbols) {
|
|
12
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
13
|
-
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
14
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
15
|
-
})), keys.push.apply(keys, symbols);
|
|
16
|
-
}
|
|
17
|
-
return keys;
|
|
18
|
-
}
|
|
19
|
-
function _objectSpread2$1(target) {
|
|
20
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
21
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
22
|
-
i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) {
|
|
23
|
-
_defineProperty$1(target, key, source[key]);
|
|
24
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) {
|
|
25
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
return target;
|
|
29
|
-
}
|
|
30
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
31
|
-
try {
|
|
32
|
-
var info = gen[key](arg);
|
|
33
|
-
var value = info.value;
|
|
34
|
-
} catch (error) {
|
|
35
|
-
reject(error);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (info.done) {
|
|
39
|
-
resolve(value);
|
|
40
|
-
} else {
|
|
41
|
-
Promise.resolve(value).then(_next, _throw);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function _asyncToGenerator(fn) {
|
|
45
|
-
return function () {
|
|
46
|
-
var self = this,
|
|
47
|
-
args = arguments;
|
|
48
|
-
return new Promise(function (resolve, reject) {
|
|
49
|
-
var gen = fn.apply(self, args);
|
|
50
|
-
function _next(value) {
|
|
51
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
52
|
-
}
|
|
53
|
-
function _throw(err) {
|
|
54
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
55
|
-
}
|
|
56
|
-
_next(undefined);
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
function _defineProperty$1(obj, key, value) {
|
|
61
|
-
key = _toPropertyKey$1(key);
|
|
62
|
-
if (key in obj) {
|
|
63
|
-
Object.defineProperty(obj, key, {
|
|
64
|
-
value: value,
|
|
65
|
-
enumerable: true,
|
|
66
|
-
configurable: true,
|
|
67
|
-
writable: true
|
|
68
|
-
});
|
|
69
|
-
} else {
|
|
70
|
-
obj[key] = value;
|
|
71
|
-
}
|
|
72
|
-
return obj;
|
|
73
|
-
}
|
|
74
|
-
function _toPrimitive(input, hint) {
|
|
75
|
-
if (typeof input !== "object" || input === null) return input;
|
|
76
|
-
var prim = input[Symbol.toPrimitive];
|
|
77
|
-
if (prim !== undefined) {
|
|
78
|
-
var res = prim.call(input, hint || "default");
|
|
79
|
-
if (typeof res !== "object") return res;
|
|
80
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
81
|
-
}
|
|
82
|
-
return (hint === "string" ? String : Number)(input);
|
|
83
|
-
}
|
|
84
|
-
function _toPropertyKey$1(arg) {
|
|
85
|
-
var key = _toPrimitive(arg, "string");
|
|
86
|
-
return typeof key === "symbol" ? key : String(key);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
9
|
function _typeof$1(obj) {
|
|
90
10
|
"@babel/helpers - typeof";
|
|
91
11
|
|
|
@@ -929,7 +849,11 @@ const CFG = {};
|
|
|
929
849
|
});
|
|
930
850
|
});
|
|
931
851
|
|
|
852
|
+
function getDefaultExportFromCjs$1(x) {
|
|
853
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
854
|
+
}
|
|
932
855
|
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]/;
|
|
856
|
+
var regex$1 = /*@__PURE__*/getDefaultExportFromCjs$1(regex);
|
|
933
857
|
|
|
934
858
|
function escapeUnmatchedSurrogates(arg) {
|
|
935
859
|
// http://stackoverflow.com/a/6701665/271577
|
|
@@ -986,7 +910,7 @@ function escapeDatabaseNameForSQLAndFiles(db) {
|
|
|
986
910
|
db = 'D' + escapeNameForSQLiteIdentifier(db);
|
|
987
911
|
if (CFG.escapeNFDForDatabaseNames !== false) {
|
|
988
912
|
// ES6 copying of regex with different flags
|
|
989
|
-
db = db.replace(new RegExp(regex, 'gu'), function (expandable) {
|
|
913
|
+
db = db.replace(new RegExp(regex$1, 'gu'), function (expandable) {
|
|
990
914
|
return '^4' + expandable.codePointAt().toString(16).padStart(6, '0');
|
|
991
915
|
});
|
|
992
916
|
}
|
|
@@ -1661,6 +1585,10 @@ Object.defineProperty(IDBOpenDBRequest, 'prototype', {
|
|
|
1661
1585
|
writable: false
|
|
1662
1586
|
});
|
|
1663
1587
|
|
|
1588
|
+
function getDefaultExportFromCjs (x) {
|
|
1589
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1664
1592
|
// Since [immediate](https://github.com/calvinmetcalf/immediate) is
|
|
1665
1593
|
// not doing the trick for our WebSQL transactions (at least in Node),
|
|
1666
1594
|
// we are forced to make the promises run fully synchronously.
|
|
@@ -1809,6 +1737,7 @@ SyncPromise.reject = function (val) {
|
|
|
1809
1737
|
});
|
|
1810
1738
|
};
|
|
1811
1739
|
var syncPromiseCommonjs = SyncPromise;
|
|
1740
|
+
var SyncPromise$1 = /*@__PURE__*/getDefaultExportFromCjs(syncPromiseCommonjs);
|
|
1812
1741
|
|
|
1813
1742
|
/**
|
|
1814
1743
|
* Compares two keys.
|
|
@@ -2107,13 +2036,13 @@ function flipBase32(encoded) {
|
|
|
2107
2036
|
function pow32(mantissa, exponent) {
|
|
2108
2037
|
exponent = Number.parseInt(exponent, 32);
|
|
2109
2038
|
if (exponent < 0) {
|
|
2110
|
-
return roundToPrecision(Number.parseInt(mantissa, 32) *
|
|
2039
|
+
return roundToPrecision(Number.parseInt(mantissa, 32) * 32 ** (exponent - 10));
|
|
2111
2040
|
}
|
|
2112
2041
|
if (exponent < 11) {
|
|
2113
2042
|
let whole = mantissa.slice(0, exponent);
|
|
2114
2043
|
whole = Number.parseInt(whole, 32);
|
|
2115
2044
|
let fraction = mantissa.slice(exponent);
|
|
2116
|
-
fraction = Number.parseInt(fraction, 32) *
|
|
2045
|
+
fraction = Number.parseInt(fraction, 32) * 32 ** (exponent - 11);
|
|
2117
2046
|
return roundToPrecision(whole + fraction);
|
|
2118
2047
|
}
|
|
2119
2048
|
const expansion = mantissa + zeros(exponent - 11);
|
|
@@ -2254,6 +2183,15 @@ function convertValueToKeyValueDecoded(input, seen, multiEntry, fullKeys) {
|
|
|
2254
2183
|
invalid: true
|
|
2255
2184
|
};
|
|
2256
2185
|
}
|
|
2186
|
+
|
|
2187
|
+
// https://github.com/w3c/IndexedDB/issues/375
|
|
2188
|
+
// https://github.com/w3c/IndexedDB/pull/386
|
|
2189
|
+
if (Object.is(input, -0)) {
|
|
2190
|
+
return {
|
|
2191
|
+
type,
|
|
2192
|
+
value: 0
|
|
2193
|
+
};
|
|
2194
|
+
}
|
|
2257
2195
|
return ret;
|
|
2258
2196
|
}
|
|
2259
2197
|
case 'string':
|
|
@@ -3621,14 +3559,14 @@ IDBTransaction.prototype.__abortTransaction = function (err) {
|
|
|
3621
3559
|
bubbles: true,
|
|
3622
3560
|
cancelable: true
|
|
3623
3561
|
});
|
|
3624
|
-
return new
|
|
3562
|
+
return new SyncPromise$1(function (resolve) {
|
|
3625
3563
|
setTimeout(() => {
|
|
3626
3564
|
q.req.dispatchEvent(reqEvt); // No need to catch errors
|
|
3627
3565
|
resolve();
|
|
3628
3566
|
});
|
|
3629
3567
|
});
|
|
3630
3568
|
});
|
|
3631
|
-
},
|
|
3569
|
+
}, SyncPromise$1.resolve()).then(function () {
|
|
3632
3570
|
// Also works when there are no pending requests
|
|
3633
3571
|
const evt = createEvent('abort', err, {
|
|
3634
3572
|
bubbles: true,
|
|
@@ -4119,7 +4057,7 @@ var u = function () {
|
|
|
4119
4057
|
type: o
|
|
4120
4058
|
}));
|
|
4121
4059
|
} : null;
|
|
4122
|
-
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 = {
|
|
4060
|
+
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 = {
|
|
4123
4061
|
replaced: h
|
|
4124
4062
|
}) : h = r, O && O(), h;
|
|
4125
4063
|
if (null === r) return O && O(), r;
|
|
@@ -4505,24 +4443,19 @@ const O = {
|
|
|
4505
4443
|
const A = {
|
|
4506
4444
|
cryptokey: {
|
|
4507
4445
|
test: e => "CryptoKey" === toStringTag(e) && e.extractable,
|
|
4508
|
-
replaceAsync: t => new e(
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
usages: t.usages
|
|
4520
|
-
});
|
|
4446
|
+
replaceAsync: t => new e(async (e, r) => {
|
|
4447
|
+
let n;
|
|
4448
|
+
try {
|
|
4449
|
+
n = await crypto.subtle.exportKey("jwk", t);
|
|
4450
|
+
} catch (e) {
|
|
4451
|
+
return void r(e);
|
|
4452
|
+
}
|
|
4453
|
+
e({
|
|
4454
|
+
jwk: n,
|
|
4455
|
+
algorithm: t.algorithm,
|
|
4456
|
+
usages: t.usages
|
|
4521
4457
|
});
|
|
4522
|
-
|
|
4523
|
-
return _ref.apply(this, arguments);
|
|
4524
|
-
};
|
|
4525
|
-
}()),
|
|
4458
|
+
}),
|
|
4526
4459
|
revive: ({
|
|
4527
4460
|
jwk: e,
|
|
4528
4461
|
algorithm: t,
|
|
@@ -4778,7 +4711,14 @@ const N = {
|
|
|
4778
4711
|
revive: e => Number.NEGATIVE_INFINITY
|
|
4779
4712
|
}
|
|
4780
4713
|
},
|
|
4781
|
-
|
|
4714
|
+
F = {
|
|
4715
|
+
negativeZero: {
|
|
4716
|
+
test: e => Object.is(e, -0),
|
|
4717
|
+
replace: e => 0,
|
|
4718
|
+
revive: e => -0
|
|
4719
|
+
}
|
|
4720
|
+
},
|
|
4721
|
+
M = {
|
|
4782
4722
|
StringObject: {
|
|
4783
4723
|
test: e => "String" === toStringTag(e) && "object" == typeof e,
|
|
4784
4724
|
replace: String,
|
|
@@ -4795,7 +4735,7 @@ const N = {
|
|
|
4795
4735
|
revive: e => new Number(e)
|
|
4796
4736
|
}
|
|
4797
4737
|
},
|
|
4798
|
-
|
|
4738
|
+
$ = {
|
|
4799
4739
|
regexp: {
|
|
4800
4740
|
test: e => "RegExp" === toStringTag(e),
|
|
4801
4741
|
replace: e => ({
|
|
@@ -4808,26 +4748,26 @@ const N = {
|
|
|
4808
4748
|
}) => new RegExp(e, t)
|
|
4809
4749
|
}
|
|
4810
4750
|
},
|
|
4811
|
-
|
|
4751
|
+
Y = {
|
|
4812
4752
|
set: {
|
|
4813
4753
|
test: e => "Set" === toStringTag(e),
|
|
4814
4754
|
replace: e => [...e.values()],
|
|
4815
4755
|
revive: e => new Set(e)
|
|
4816
4756
|
}
|
|
4817
4757
|
},
|
|
4818
|
-
|
|
4758
|
+
q = {};
|
|
4819
4759
|
"function" == typeof Int8Array && [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array].forEach(e => function create$1(e) {
|
|
4820
4760
|
const t = e.name;
|
|
4821
|
-
|
|
4761
|
+
q[t.toLowerCase()] = {
|
|
4822
4762
|
test: e => toStringTag(e) === t,
|
|
4823
4763
|
replace: e => (0 === e.byteOffset && e.byteLength === e.buffer.byteLength ? e : e.slice(0)).buffer,
|
|
4824
4764
|
revive: t => "ArrayBuffer" === toStringTag(t) ? new e(t) : t
|
|
4825
4765
|
};
|
|
4826
4766
|
}(e));
|
|
4827
|
-
const
|
|
4767
|
+
const W = {};
|
|
4828
4768
|
"function" == typeof Int8Array && [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array].forEach(e => function create(e) {
|
|
4829
4769
|
const t = e.name;
|
|
4830
|
-
|
|
4770
|
+
W[t.toLowerCase()] = {
|
|
4831
4771
|
test: e => toStringTag(e) === t,
|
|
4832
4772
|
replace({
|
|
4833
4773
|
buffer: e,
|
|
@@ -4859,21 +4799,23 @@ const q = {};
|
|
|
4859
4799
|
}
|
|
4860
4800
|
};
|
|
4861
4801
|
}(e));
|
|
4862
|
-
const
|
|
4802
|
+
const G = {
|
|
4863
4803
|
undef: {
|
|
4864
4804
|
test: (e, t) => void 0 === e && (t.ownKeys || !("ownKeys" in t)),
|
|
4865
4805
|
replace: e => 0,
|
|
4866
4806
|
revive: e => new l()
|
|
4867
4807
|
}
|
|
4868
4808
|
},
|
|
4869
|
-
|
|
4809
|
+
H = {
|
|
4870
4810
|
userObject: {
|
|
4871
4811
|
test: (e, t) => isUserObject(e),
|
|
4872
|
-
replace: e =>
|
|
4812
|
+
replace: e => ({
|
|
4813
|
+
...e
|
|
4814
|
+
}),
|
|
4873
4815
|
revive: e => e
|
|
4874
4816
|
}
|
|
4875
4817
|
},
|
|
4876
|
-
|
|
4818
|
+
X = [{
|
|
4877
4819
|
arrayNonindexKeys: {
|
|
4878
4820
|
testPlainObjects: !0,
|
|
4879
4821
|
test: (e, t) => !!Array.isArray(e) && (Object.keys(e).some(e => String(Number.parseInt(e)) !== e) && (t.iterateIn = "object", t.addLength = !0), !0),
|
|
@@ -4894,9 +4836,9 @@ const W = {
|
|
|
4894
4836
|
revive(e) {}
|
|
4895
4837
|
}
|
|
4896
4838
|
}],
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
var
|
|
4839
|
+
Z = [K, x, L, F],
|
|
4840
|
+
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] : []);
|
|
4841
|
+
var ne = re.concat({
|
|
4900
4842
|
checkDataCloneException: {
|
|
4901
4843
|
test(e) {
|
|
4902
4844
|
const t = {}.toString.call(e).slice(8, -1);
|
|
@@ -4908,9 +4850,9 @@ var re = te.concat({
|
|
|
4908
4850
|
|
|
4909
4851
|
// See: http://stackoverflow.com/questions/42170826/categories-for-rejection-by-the-structured-cloning-algorithm
|
|
4910
4852
|
|
|
4911
|
-
let typeson = new u().register(
|
|
4853
|
+
let typeson = new u().register(ne);
|
|
4912
4854
|
function register(func) {
|
|
4913
|
-
typeson = new u().register(func(
|
|
4855
|
+
typeson = new u().register(func(ne));
|
|
4914
4856
|
}
|
|
4915
4857
|
|
|
4916
4858
|
// We are keeping the callback approach for now in case we wish to reexpose
|
|
@@ -5395,7 +5337,7 @@ IDBIndex.prototype.__renameIndex = function (store, oldName, newName, colInfoToP
|
|
|
5395
5337
|
return;
|
|
5396
5338
|
}
|
|
5397
5339
|
const indexCreations = colNamesToPreserve.slice(2) // Doing `key` separately and no need for index on `value`
|
|
5398
|
-
.map(escapedIndexNameSQL => new
|
|
5340
|
+
.map(escapedIndexNameSQL => new SyncPromise$1(function (resolve, reject) {
|
|
5399
5341
|
const escapedIndexToRecreate = sqlQuote(escapedStoreNameSQL.slice(1, -1) + '^5' + escapedIndexNameSQL.slice(1, -1));
|
|
5400
5342
|
// const sql = 'DROP INDEX IF EXISTS ' + escapedIndexToRecreate;
|
|
5401
5343
|
// CFG.DEBUG && console.log(sql);
|
|
@@ -5410,7 +5352,7 @@ IDBIndex.prototype.__renameIndex = function (store, oldName, newName, colInfoToP
|
|
|
5410
5352
|
// });
|
|
5411
5353
|
}));
|
|
5412
5354
|
|
|
5413
|
-
indexCreations.push(new
|
|
5355
|
+
indexCreations.push(new SyncPromise$1(function (resolve, reject) {
|
|
5414
5356
|
const escapedIndexToRecreate = sqlQuote('sk_' + escapedStoreNameSQL.slice(1, -1));
|
|
5415
5357
|
// Chrome erring here if not dropped first; Node does not
|
|
5416
5358
|
const sql = 'DROP INDEX IF EXISTS ' + escapedIndexToRecreate;
|
|
@@ -5425,7 +5367,7 @@ IDBIndex.prototype.__renameIndex = function (store, oldName, newName, colInfoToP
|
|
|
5425
5367
|
reject(err);
|
|
5426
5368
|
});
|
|
5427
5369
|
}));
|
|
5428
|
-
|
|
5370
|
+
SyncPromise$1.all(indexCreations).then(finish, error).catch(err => {
|
|
5429
5371
|
console.log('Index rename error');
|
|
5430
5372
|
throw err;
|
|
5431
5373
|
});
|
|
@@ -5888,7 +5830,7 @@ IDBObjectStore.prototype.__insertData = function (tx, encoded, value, clonedKeyO
|
|
|
5888
5830
|
// idea is to avoid, where possible, unnecessary delays (and
|
|
5889
5831
|
// consuming code ought to only see a difference in the browser
|
|
5890
5832
|
// where we can't control the transaction timeout anyways).
|
|
5891
|
-
return new
|
|
5833
|
+
return new SyncPromise$1((resolve, reject) => {
|
|
5892
5834
|
const index = me.__indexes[indexName];
|
|
5893
5835
|
if (
|
|
5894
5836
|
// `createIndex` was called synchronously after the current insertion was added to
|
|
@@ -5939,7 +5881,7 @@ IDBObjectStore.prototype.__insertData = function (tx, encoded, value, clonedKeyO
|
|
|
5939
5881
|
}
|
|
5940
5882
|
});
|
|
5941
5883
|
});
|
|
5942
|
-
return
|
|
5884
|
+
return SyncPromise$1.all(indexPromises).then(() => {
|
|
5943
5885
|
const sqlStart = ['INSERT INTO', escapeStoreNameForSQL(me.__currentName), '('];
|
|
5944
5886
|
const sqlEnd = [' VALUES ('];
|
|
5945
5887
|
const insertSqlValues = [];
|
|
@@ -6407,7 +6349,9 @@ IDBDatabase.prototype.createObjectStore = function (storeName /* , createOptions
|
|
|
6407
6349
|
IDBTransaction.__assertVersionChange(this.__versionTransaction); // this.__versionTransaction may not exist if called mistakenly by user in onsuccess
|
|
6408
6350
|
this.throwIfUpgradeTransactionNull();
|
|
6409
6351
|
IDBTransaction.__assertActive(this.__versionTransaction);
|
|
6410
|
-
createOptions =
|
|
6352
|
+
createOptions = {
|
|
6353
|
+
...createOptions
|
|
6354
|
+
};
|
|
6411
6355
|
let {
|
|
6412
6356
|
keyPath
|
|
6413
6357
|
} = createOptions;
|
|
@@ -6638,18 +6582,18 @@ function triggerAnyVersionChangeAndBlockedEvents(openConnections, req, oldVersio
|
|
|
6638
6582
|
oldVersion,
|
|
6639
6583
|
newVersion
|
|
6640
6584
|
});
|
|
6641
|
-
return new
|
|
6585
|
+
return new SyncPromise$1(function (resolve) {
|
|
6642
6586
|
setTimeout(() => {
|
|
6643
6587
|
entry.dispatchEvent(e); // No need to catch errors
|
|
6644
6588
|
resolve();
|
|
6645
6589
|
});
|
|
6646
6590
|
});
|
|
6647
6591
|
});
|
|
6648
|
-
},
|
|
6592
|
+
}, SyncPromise$1.resolve()).then(function () {
|
|
6649
6593
|
if (connectionsClosed()) {
|
|
6650
6594
|
return undefined;
|
|
6651
6595
|
}
|
|
6652
|
-
return new
|
|
6596
|
+
return new SyncPromise$1(function (resolve) {
|
|
6653
6597
|
const unblocking = {
|
|
6654
6598
|
check() {
|
|
6655
6599
|
if (connectionsClosed()) {
|
|
@@ -8178,9 +8122,10 @@ SQLiteDatabase.prototype.exec = function exec(queries, readOnly, callback) {
|
|
|
8178
8122
|
doNext();
|
|
8179
8123
|
};
|
|
8180
8124
|
var SQLiteDatabase_1 = SQLiteDatabase;
|
|
8125
|
+
var SQLiteDatabase$1 = /*@__PURE__*/getDefaultExportFromCjs(SQLiteDatabase_1);
|
|
8181
8126
|
|
|
8182
8127
|
function wrappedSQLiteDatabase(name) {
|
|
8183
|
-
const db = new
|
|
8128
|
+
const db = new SQLiteDatabase$1(name);
|
|
8184
8129
|
if (CFG.sqlBusyTimeout) {
|
|
8185
8130
|
db._db.configure('busyTimeout', CFG.sqlBusyTimeout); // Default is 1000
|
|
8186
8131
|
}
|
|
@@ -8211,9 +8156,10 @@ CFG.win = {
|
|
|
8211
8156
|
openDatabase: nodeWebSQL
|
|
8212
8157
|
};
|
|
8213
8158
|
const __setGlobalVars = function (idb, initialConfig = {}) {
|
|
8214
|
-
const obj = setGlobalVars(idb,
|
|
8215
|
-
fs: fs$1
|
|
8216
|
-
|
|
8159
|
+
const obj = setGlobalVars(idb, {
|
|
8160
|
+
fs: fs$1,
|
|
8161
|
+
...initialConfig
|
|
8162
|
+
});
|
|
8217
8163
|
obj.shimIndexedDB.__setUnicodeIdentifiers(UnicodeIdentifiers);
|
|
8218
8164
|
return obj;
|
|
8219
8165
|
};
|