indexeddbshim 17.3.0 → 17.3.2
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/dist/IDBFactory.d.ts.map +1 -1
- package/dist/IDBObjectStore.d.ts +28 -0
- package/dist/IDBObjectStore.d.ts.map +1 -1
- package/dist/indexeddbshim-Key.js +1 -1
- package/dist/indexeddbshim-Key.min.js +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +198 -66
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.js +200 -68
- 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 +198 -66
- package/dist/indexeddbshim-node.cjs.map +1 -1
- package/dist/indexeddbshim-noninvasive.js +200 -68
- 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 +200 -68
- package/dist/indexeddbshim.js.map +1 -1
- package/dist/indexeddbshim.min.js +2 -2
- package/dist/indexeddbshim.min.js.map +1 -1
- package/dist/setGlobalVars.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/IDBFactory.js +16 -1
- package/src/IDBObjectStore.js +103 -1
- package/src/IDBRecord.js +8 -0
- package/src/setGlobalVars.js +18 -2
package/dist/indexeddbshim.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! indexeddbshim - v17.3.
|
|
1
|
+
/*! indexeddbshim - v17.3.2 - 8/24/2026 */
|
|
2
2
|
|
|
3
3
|
(function (factory) {
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -6594,22 +6594,22 @@
|
|
|
6594
6594
|
sync: true
|
|
6595
6595
|
}, this.options), s),
|
|
6596
6596
|
c = i.sync,
|
|
6597
|
-
|
|
6598
|
-
|
|
6597
|
+
u = {},
|
|
6598
|
+
y = [],
|
|
6599
6599
|
l = [],
|
|
6600
6600
|
p = [],
|
|
6601
6601
|
f = !("cyclic" in i) || i.cyclic,
|
|
6602
6602
|
d = i.encapsulateObserver,
|
|
6603
6603
|
m = i.encapsulateError,
|
|
6604
6604
|
finish = function finish(e) {
|
|
6605
|
-
var t = Object.values(
|
|
6605
|
+
var t = Object.values(u);
|
|
6606
6606
|
if (i.iterateNone) return t.length ? t[0] : getJSONType(e);
|
|
6607
6607
|
if (t.length) {
|
|
6608
6608
|
if (i.returnTypeNames) return _toConsumableArray(new Set(t));
|
|
6609
|
-
e && isPlainObject(e) && !n(e, "$types") ? e.$types =
|
|
6609
|
+
e && isPlainObject(e) && !n(e, "$types") ? e.$types = u : e = {
|
|
6610
6610
|
$: e,
|
|
6611
6611
|
$types: {
|
|
6612
|
-
$:
|
|
6612
|
+
$: u
|
|
6613
6613
|
}
|
|
6614
6614
|
};
|
|
6615
6615
|
} else isObject(e) && n(e, "$types") && (e = {
|
|
@@ -6633,18 +6633,18 @@
|
|
|
6633
6633
|
_context2.n = 2;
|
|
6634
6634
|
return Promise.all(r.map(/*#__PURE__*/function () {
|
|
6635
6635
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(r) {
|
|
6636
|
-
var n, _t$splice, _t$splice2, a, _a, o, s, i, c,
|
|
6636
|
+
var n, _t$splice, _t$splice2, a, _a, o, s, i, c, u, y, l, p, _t, _t2, _t3, _t4;
|
|
6637
6637
|
return _regenerator().w(function (_context) {
|
|
6638
6638
|
while (1) switch (_context.n) {
|
|
6639
6639
|
case 0:
|
|
6640
|
-
n = [], _t$splice = t.splice(0, 1), _t$splice2 = _slicedToArray(_t$splice, 1), a = _t$splice2[0], _a = _slicedToArray(a, 7), o = _a[0], s = _a[2], i = _a[3], c = _a[4],
|
|
6640
|
+
n = [], _t$splice = t.splice(0, 1), _t$splice2 = _slicedToArray(_t$splice, 1), a = _t$splice2[0], _a = _slicedToArray(a, 7), o = _a[0], s = _a[2], i = _a[3], c = _a[4], u = _a[5], y = _a[6], l = _encapsulate2(o, r, s, i, n, true, y), p = hasConstructorOf(l, TypesonPromise);
|
|
6641
6641
|
if (!(o && p)) {
|
|
6642
6642
|
_context.n = 2;
|
|
6643
6643
|
break;
|
|
6644
6644
|
}
|
|
6645
6645
|
_t2 = setOwnEnumerable;
|
|
6646
6646
|
_t3 = c;
|
|
6647
|
-
_t4 =
|
|
6647
|
+
_t4 = u;
|
|
6648
6648
|
_context.n = 1;
|
|
6649
6649
|
return l.p;
|
|
6650
6650
|
case 1:
|
|
@@ -6653,7 +6653,7 @@
|
|
|
6653
6653
|
_context.n = 3;
|
|
6654
6654
|
break;
|
|
6655
6655
|
case 2:
|
|
6656
|
-
_t = (o ? setOwnEnumerable(c,
|
|
6656
|
+
_t = (o ? setOwnEnumerable(c, u, l) : e = p ? l.p : l, _checkPromises(e, n));
|
|
6657
6657
|
case 3:
|
|
6658
6658
|
return _context.a(2, _t);
|
|
6659
6659
|
}
|
|
@@ -6732,11 +6732,11 @@
|
|
|
6732
6732
|
})) : h = t, b && b(), h;
|
|
6733
6733
|
if (null === t) return b && b(), t;
|
|
6734
6734
|
if (o && t && "object" == _typeof(t) && !s.iterateIn && !s.iterateUnsetNumeric) {
|
|
6735
|
-
var _r2 =
|
|
6736
|
-
if (-1 !== _r2) return
|
|
6735
|
+
var _r2 = y.indexOf(t);
|
|
6736
|
+
if (-1 !== _r2) return u[e] = "#", b && b({
|
|
6737
6737
|
cyclicKeypath: l[_r2]
|
|
6738
6738
|
}), "#" + l[_r2];
|
|
6739
|
-
true === o && (
|
|
6739
|
+
true === o && (y.push(t), l.push(e));
|
|
6740
6740
|
}
|
|
6741
6741
|
var v = isPlainObject(t),
|
|
6742
6742
|
w = a(t),
|
|
@@ -6806,14 +6806,14 @@
|
|
|
6806
6806
|
},
|
|
6807
6807
|
replace = function replace(e, t, r, n, a, o, s) {
|
|
6808
6808
|
var i = a ? _this2.plainObjectReplacers : _this2.nonplainObjectReplacers;
|
|
6809
|
-
var
|
|
6810
|
-
for (;
|
|
6811
|
-
var _a3 = i[
|
|
6809
|
+
var y = i.length;
|
|
6810
|
+
for (; y--;) {
|
|
6811
|
+
var _a3 = i[y];
|
|
6812
6812
|
if (_a3.test(t, r)) {
|
|
6813
6813
|
var _i2 = _a3.type;
|
|
6814
6814
|
if (Object.hasOwn(_this2.revivers, _i2)) {
|
|
6815
|
-
var _t5 =
|
|
6816
|
-
|
|
6815
|
+
var _t5 = u[e];
|
|
6816
|
+
u[e] = _t5 ? [_i2].concat(_t5) : _i2;
|
|
6817
6817
|
}
|
|
6818
6818
|
if (Object.assign(r, {
|
|
6819
6819
|
type: _i2,
|
|
@@ -6821,14 +6821,14 @@
|
|
|
6821
6821
|
}), (c || !_a3.replaceAsync) && !_a3.replace) return s && s({
|
|
6822
6822
|
typeDetected: true
|
|
6823
6823
|
}), _encapsulate2(e, t, f && "readonly", r, n, o, _i2);
|
|
6824
|
-
var
|
|
6824
|
+
var _y = void 0;
|
|
6825
6825
|
if (s && s({
|
|
6826
6826
|
replacing: true
|
|
6827
6827
|
}), c || !_a3.replaceAsync) {
|
|
6828
6828
|
if (void 0 === _a3.replace) throw new TypeError("Missing replacer");
|
|
6829
|
-
|
|
6830
|
-
} else
|
|
6831
|
-
return _encapsulate2(e,
|
|
6829
|
+
_y = _a3.replace(t, r);
|
|
6830
|
+
} else _y = _a3.replaceAsync(t, r);
|
|
6831
|
+
return _encapsulate2(e, _y, f && "readonly", r, n, o, _i2);
|
|
6832
6832
|
}
|
|
6833
6833
|
}
|
|
6834
6834
|
return t;
|
|
@@ -6876,8 +6876,8 @@
|
|
|
6876
6876
|
if (true === i) return finishRevival(e.$);
|
|
6877
6877
|
if (!i || "object" != _typeof(i) || Array.isArray(i)) return finishRevival(e);
|
|
6878
6878
|
var c = [],
|
|
6879
|
-
|
|
6880
|
-
|
|
6879
|
+
u = Object.create(null),
|
|
6880
|
+
y = {};
|
|
6881
6881
|
var l = true;
|
|
6882
6882
|
i.$ && isPlainObject(i.$) && (e = e.$, i = i.$, l = false);
|
|
6883
6883
|
var executeReviver = function executeReviver(e, t) {
|
|
@@ -6887,8 +6887,8 @@
|
|
|
6887
6887
|
r = _ref5[0];
|
|
6888
6888
|
if (!r) throw new Error("Unregistered type: " + e);
|
|
6889
6889
|
if (s && !("revive" in r)) return t;
|
|
6890
|
-
if (!s && r.reviveAsync) return r.reviveAsync(t,
|
|
6891
|
-
if (r.revive) return r.revive(t,
|
|
6890
|
+
if (!s && r.reviveAsync) return r.reviveAsync(t, y);
|
|
6891
|
+
if (r.revive) return r.revive(t, y);
|
|
6892
6892
|
throw new Error("Missing reviver");
|
|
6893
6893
|
},
|
|
6894
6894
|
p = [];
|
|
@@ -6933,7 +6933,7 @@
|
|
|
6933
6933
|
var d;
|
|
6934
6934
|
return hasConstructorOf(f, TypesonPromise) ? d = f.then(function () {
|
|
6935
6935
|
return e;
|
|
6936
|
-
}) : (d = function _revive(e, t, o,
|
|
6936
|
+
}) : (d = function _revive(e, t, o, y, f) {
|
|
6937
6937
|
if (l && "$types" === e) return;
|
|
6938
6938
|
var d = p.length,
|
|
6939
6939
|
m = n(i, e) ? i[e] : void 0,
|
|
@@ -6954,18 +6954,18 @@
|
|
|
6954
6954
|
_t6 = _c$[1],
|
|
6955
6955
|
_r5 = _c$[2],
|
|
6956
6956
|
_a5 = _c$[3],
|
|
6957
|
-
_o2 = n(
|
|
6958
|
-
_s = _o2 ?
|
|
6957
|
+
_o2 = n(u, _t6),
|
|
6958
|
+
_s = _o2 ? u[_t6] : getByKeyPath(_e2, _t6);
|
|
6959
6959
|
if (!_o2 && void 0 === _s) break;
|
|
6960
6960
|
setOwnEnumerable(_r5, _a5, _s), c.shift();
|
|
6961
6961
|
}
|
|
6962
6962
|
}
|
|
6963
|
-
if (!m) return
|
|
6963
|
+
if (!m) return u[e] = t, t;
|
|
6964
6964
|
if ("#" === m) {
|
|
6965
6965
|
var _e3 = t.slice(1),
|
|
6966
|
-
_r6 = n(
|
|
6967
|
-
_a6 = _r6 ?
|
|
6968
|
-
return _r6 || void 0 !== _a6 || c.push([o, _e3,
|
|
6966
|
+
_r6 = n(u, _e3),
|
|
6967
|
+
_a6 = _r6 ? u[_e3] : getByKeyPath(o, _e3);
|
|
6968
|
+
return _r6 || void 0 !== _a6 || c.push([o, _e3, y, f]), _a6;
|
|
6969
6969
|
}
|
|
6970
6970
|
var applyType = function applyType(t) {
|
|
6971
6971
|
var r = [].concat(m).reduce(function reducer(e, t) {
|
|
@@ -6976,8 +6976,8 @@
|
|
|
6976
6976
|
return executeReviver(t, e);
|
|
6977
6977
|
}, t);
|
|
6978
6978
|
return hasConstructorOf(r, TypesonPromise) ? r.then(function (t) {
|
|
6979
|
-
return
|
|
6980
|
-
}) : (
|
|
6979
|
+
return u[e] = t, t;
|
|
6980
|
+
}) : (u[e] = r, r);
|
|
6981
6981
|
};
|
|
6982
6982
|
return !s && p.length > d ? TypesonPromise.all(p.slice(d)).then(function () {
|
|
6983
6983
|
return applyType(t);
|
|
@@ -7082,8 +7082,8 @@
|
|
|
7082
7082
|
});
|
|
7083
7083
|
Undefined.__typeson__type__ = "TypesonUndefined";
|
|
7084
7084
|
var s = ["null", "boolean", "number", "string", "array", "object"];
|
|
7085
|
-
for (var i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", c = new Uint8Array(256),
|
|
7086
|
-
var
|
|
7085
|
+
for (var i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", c = new Uint8Array(256), u = 0; u < 64; u++) c[i.codePointAt(u)] = u;
|
|
7086
|
+
var y = function encode(e, t, r) {
|
|
7087
7087
|
null == r && (r = e.byteLength);
|
|
7088
7088
|
for (var n = new Uint8Array(e, 0, r), a = n.length, o = "", s = 0; s < a; s += 3) o += i[n[s] >> 2], o += i[(3 & n[s]) << 4 | n[s + 1] >> 4], o += i[(15 & n[s + 1]) << 2 | n[s + 2] >> 6], o += i[63 & n[s + 2]];
|
|
7089
7089
|
return a % 3 == 2 ? o = o.slice(0, -1) + "=" : a % 3 == 1 && (o = o.slice(0, -2) + "=="), o;
|
|
@@ -7096,10 +7096,10 @@
|
|
|
7096
7096
|
o,
|
|
7097
7097
|
s,
|
|
7098
7098
|
i = .75 * e.length,
|
|
7099
|
-
|
|
7099
|
+
u = 0;
|
|
7100
7100
|
"=" === e[e.length - 1] && (i--, "=" === e[e.length - 2] && i--);
|
|
7101
|
-
for (var
|
|
7102
|
-
return
|
|
7101
|
+
for (var y = new ArrayBuffer(i, t), l = new Uint8Array(y), p = 0; p < r; p += 4) n = c[e.codePointAt(p)], a = c[e.codePointAt(p + 1)], o = c[e.codePointAt(p + 2)], s = c[e.codePointAt(p + 3)], l[u++] = n << 2 | a >> 4, l[u++] = (15 & a) << 4 | o >> 2, l[u++] = (3 & o) << 6 | 63 & s;
|
|
7102
|
+
return y;
|
|
7103
7103
|
};
|
|
7104
7104
|
var p = {
|
|
7105
7105
|
arraybuffer: {
|
|
@@ -7112,7 +7112,7 @@
|
|
|
7112
7112
|
return -1 !== r ? {
|
|
7113
7113
|
index: r
|
|
7114
7114
|
} : (t.buffers.push(e), {
|
|
7115
|
-
s:
|
|
7115
|
+
s: y(e),
|
|
7116
7116
|
maxByteLength: e.maxByteLength,
|
|
7117
7117
|
resizable: e.resizable
|
|
7118
7118
|
});
|
|
@@ -7146,13 +7146,13 @@
|
|
|
7146
7146
|
});
|
|
7147
7147
|
i.push(_r0), c += _r0;
|
|
7148
7148
|
}
|
|
7149
|
-
var
|
|
7150
|
-
var
|
|
7149
|
+
var u = new ArrayBuffer(c);
|
|
7150
|
+
var y = 0;
|
|
7151
7151
|
for (var _t9 = 0; _t9 < s; _t9++) {
|
|
7152
|
-
var _r1 = new Uint8Array(
|
|
7152
|
+
var _r1 = new Uint8Array(u, y, i[_t9]);
|
|
7153
7153
|
e.copyTo(_r1, {
|
|
7154
7154
|
planeIndex: _t9
|
|
7155
|
-
}),
|
|
7155
|
+
}), y += i[_t9];
|
|
7156
7156
|
}
|
|
7157
7157
|
return {
|
|
7158
7158
|
format: t,
|
|
@@ -7160,7 +7160,7 @@
|
|
|
7160
7160
|
numberOfFrames: n,
|
|
7161
7161
|
numberOfChannels: a,
|
|
7162
7162
|
timestamp: o,
|
|
7163
|
-
data:
|
|
7163
|
+
data: u
|
|
7164
7164
|
};
|
|
7165
7165
|
},
|
|
7166
7166
|
revive: function revive(_ref11) {
|
|
@@ -7311,7 +7311,7 @@
|
|
|
7311
7311
|
byteOffset: t,
|
|
7312
7312
|
byteLength: r
|
|
7313
7313
|
} : (n.buffers.push(e), {
|
|
7314
|
-
encoded:
|
|
7314
|
+
encoded: y(e),
|
|
7315
7315
|
maxByteLength: e.maxByteLength,
|
|
7316
7316
|
resizable: e.resizable,
|
|
7317
7317
|
byteOffset: t,
|
|
@@ -7943,7 +7943,7 @@
|
|
|
7943
7943
|
} : (n.buffers.push(e), {
|
|
7944
7944
|
maxByteLength: e.maxByteLength,
|
|
7945
7945
|
resizable: e.resizable,
|
|
7946
|
-
encoded:
|
|
7946
|
+
encoded: y(e),
|
|
7947
7947
|
byteOffset: t,
|
|
7948
7948
|
length: r
|
|
7949
7949
|
});
|
|
@@ -7956,10 +7956,10 @@
|
|
|
7956
7956
|
s = t.index,
|
|
7957
7957
|
i = t.maxByteLength,
|
|
7958
7958
|
c = t.resizable;
|
|
7959
|
-
var
|
|
7960
|
-
return "index" in t ?
|
|
7959
|
+
var u;
|
|
7960
|
+
return "index" in t ? u = r.buffers[s] : (u = l(o, c ? {
|
|
7961
7961
|
maxByteLength: i
|
|
7962
|
-
} : void 0), r.buffers.push(
|
|
7962
|
+
} : void 0), r.buffers.push(u)), new e(u, n, a);
|
|
7963
7963
|
}
|
|
7964
7964
|
};
|
|
7965
7965
|
}(e);
|
|
@@ -7998,12 +7998,12 @@
|
|
|
7998
7998
|
replaceAsync: function replaceAsync(e) {
|
|
7999
7999
|
return new TypesonPromise(/*#__PURE__*/function () {
|
|
8000
8000
|
var _ref29 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(t, r) {
|
|
8001
|
-
var _r12, _n3, _a7, _o3, _s2, _i3, _c,
|
|
8001
|
+
var _r12, _n3, _a7, _o3, _s2, _i3, _c, _u, _y2, _l, _t14;
|
|
8002
8002
|
return _regenerator().w(function (_context6) {
|
|
8003
8003
|
while (1) switch (_context6.p = _context6.n) {
|
|
8004
8004
|
case 0:
|
|
8005
8005
|
_context6.p = 0;
|
|
8006
|
-
_r12 = e.format, _n3 = e.codedWidth, _a7 = e.codedHeight, _o3 = e.timestamp, _s2 = e.duration, _i3 = e.visibleRect, _c = e.displayWidth,
|
|
8006
|
+
_r12 = e.format, _n3 = e.codedWidth, _a7 = e.codedHeight, _o3 = e.timestamp, _s2 = e.duration, _i3 = e.visibleRect, _c = e.displayWidth, _u = e.displayHeight, _y2 = e.colorSpace, _l = new ArrayBuffer(e.allocationSize());
|
|
8007
8007
|
_context6.n = 1;
|
|
8008
8008
|
return e.copyTo(_l);
|
|
8009
8009
|
case 1:
|
|
@@ -8020,12 +8020,12 @@
|
|
|
8020
8020
|
height: _i3.height
|
|
8021
8021
|
},
|
|
8022
8022
|
displayWidth: _c,
|
|
8023
|
-
displayHeight:
|
|
8023
|
+
displayHeight: _u,
|
|
8024
8024
|
colorSpace: {
|
|
8025
|
-
primaries:
|
|
8026
|
-
transfer:
|
|
8027
|
-
matrix:
|
|
8028
|
-
fullRange:
|
|
8025
|
+
primaries: _y2.primaries,
|
|
8026
|
+
transfer: _y2.transfer,
|
|
8027
|
+
matrix: _y2.matrix,
|
|
8028
|
+
fullRange: _y2.fullRange
|
|
8029
8029
|
},
|
|
8030
8030
|
data: _l
|
|
8031
8031
|
});
|
|
@@ -8055,8 +8055,8 @@
|
|
|
8055
8055
|
s = _ref30.displayWidth,
|
|
8056
8056
|
i = _ref30.displayHeight,
|
|
8057
8057
|
c = _ref30.colorSpace,
|
|
8058
|
-
|
|
8059
|
-
return new VideoFrame(new Uint8Array(
|
|
8058
|
+
u = _ref30.data;
|
|
8059
|
+
return new VideoFrame(new Uint8Array(u), {
|
|
8060
8060
|
format: e,
|
|
8061
8061
|
codedWidth: t,
|
|
8062
8062
|
codedHeight: r,
|
|
@@ -8128,11 +8128,11 @@
|
|
|
8128
8128
|
}],
|
|
8129
8129
|
ne = [D, M, L, F],
|
|
8130
8130
|
ce = [Z, Y, re, K, ne, O, z, U, _, B, I, h, N, C].concat("function" == typeof Map ? k : [], "function" == typeof Set ? H : [], "function" == typeof ArrayBuffer ? p : [], "function" == typeof Uint8Array ? X : [], "function" == typeof DataView ? w : [], "undefined" != typeof crypto ? v : [], "undefined" != typeof BigInt ? [m, d] : [], "undefined" != typeof DOMException ? A : [], "undefined" != typeof QuotaExceededError ? W : [], "undefined" != typeof WebTransportError ? te : [], "undefined" != typeof DOMRect ? x : [], "undefined" != typeof DOMPoint ? S : [], "undefined" != typeof DOMQuad ? P : [], "undefined" != typeof DOMMatrix ? T : [], "undefined" != typeof AudioData ? f : [], "undefined" != typeof EncodedAudioChunk ? E : [], "undefined" != typeof EncodedVideoChunk ? j : [], "undefined" != typeof VideoFrame ? ee : []);
|
|
8131
|
-
var
|
|
8131
|
+
var ue = ce.concat({
|
|
8132
8132
|
checkDataCloneException: {
|
|
8133
8133
|
test: function test(e) {
|
|
8134
8134
|
var t = {}.toString.call(e).slice(8, -1);
|
|
8135
|
-
if (["symbol", "function"].includes(_typeof(e)) || ["Arguments", "Module", "Promise", "WeakMap", "WeakSet", "Event", "MessageChannel"].includes(t) || ["ArrayBuffer", "DataView", "Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array", "Float64Array", "BigInt64Array", "BigUint64Array"].includes(t) && function isBufferDetached(e) {
|
|
8135
|
+
if (["symbol", "function"].includes(_typeof(e)) || ["Arguments", "Module", "Promise", "WeakMap", "WeakSet", "Event", "MessageChannel", "MessagePort"].includes(t) || e && e.constructor && ["MessageChannel", "MessagePort"].includes(e.constructor.name) || ["ArrayBuffer", "DataView", "Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array", "Float64Array", "BigInt64Array", "BigUint64Array"].includes(t) && function isBufferDetached(e) {
|
|
8136
8136
|
if ("boolean" == typeof e.detached) return e.detached;
|
|
8137
8137
|
if (0 !== e.byteLength) return false;
|
|
8138
8138
|
try {
|
|
@@ -8148,7 +8148,7 @@
|
|
|
8148
8148
|
|
|
8149
8149
|
// See: https://stackoverflow.com/questions/42170826/categories-for-rejection-by-the-structured-cloning-algorithm
|
|
8150
8150
|
|
|
8151
|
-
var typeson = new Typeson().register(
|
|
8151
|
+
var typeson = new Typeson().register(ue);
|
|
8152
8152
|
|
|
8153
8153
|
/**
|
|
8154
8154
|
* @param {(preset: import('typeson-registry').Preset) =>
|
|
@@ -8157,7 +8157,7 @@
|
|
|
8157
8157
|
*/
|
|
8158
8158
|
function register(func) {
|
|
8159
8159
|
// eslint-disable-next-line unicorn/no-top-level-assignment-in-function -- Should be one-time cache
|
|
8160
|
-
typeson = new Typeson().register(func(
|
|
8160
|
+
typeson = new Typeson().register(func(ue));
|
|
8161
8161
|
}
|
|
8162
8162
|
|
|
8163
8163
|
/**
|
|
@@ -9220,6 +9220,11 @@
|
|
|
9220
9220
|
* success: (key: import('./Key.js').Key, cn?: Integer) => void,
|
|
9221
9221
|
* failCb: import('./Key.js').SQLFailureCallback
|
|
9222
9222
|
* ) => void,
|
|
9223
|
+
* __checkIndexConstraints: (
|
|
9224
|
+
* tx: WebSQLTransaction,
|
|
9225
|
+
* value: import('./Key.js').Value,
|
|
9226
|
+
* excludeKey: import('./Key.js').Key|Integer|undefined
|
|
9227
|
+
* ) => SyncPromise,
|
|
9223
9228
|
* __insertData: (
|
|
9224
9229
|
* tx: WebSQLTransaction,
|
|
9225
9230
|
* encoded: string,
|
|
@@ -9638,6 +9643,69 @@
|
|
|
9638
9643
|
}
|
|
9639
9644
|
};
|
|
9640
9645
|
|
|
9646
|
+
/**
|
|
9647
|
+
* Validates `value`'s unique index entries against the table's *current*
|
|
9648
|
+
* state without mutating anything -- used by `__storingRecordObjectStore`
|
|
9649
|
+
* to check a `put()`'s constraints *before* `__overwrite` deletes the
|
|
9650
|
+
* existing row for that key, so a rejected `put()` can't end up losing
|
|
9651
|
+
* the record it was trying to replace (see
|
|
9652
|
+
* `idbobjectstore-put-unique-index-constraint-is-atomic.any.js`).
|
|
9653
|
+
* `excludeKey`, when given, treats a conflicting record as a non-conflict
|
|
9654
|
+
* if it's the very record being overwritten (its own current entry would
|
|
9655
|
+
* otherwise self-conflict on every no-op `put()` of an unchanged value).
|
|
9656
|
+
* `__insertData` below still runs its own (now redundant, but harmless --
|
|
9657
|
+
* the old row is gone by then) equivalent check as its first step; this
|
|
9658
|
+
* isn't merged into it because `__insertData` also performs the actual
|
|
9659
|
+
* `INSERT`, which cannot safely run before `__overwrite`'s `DELETE` when
|
|
9660
|
+
* overwriting an existing key.
|
|
9661
|
+
* @param {WebSQLTransaction} tx
|
|
9662
|
+
* @param {import('./Key.js').Value} value
|
|
9663
|
+
* @param {import('./Key.js').Key|Integer|undefined} excludeKey
|
|
9664
|
+
* @this {IDBObjectStoreFull}
|
|
9665
|
+
* @returns {SyncPromise}
|
|
9666
|
+
*/
|
|
9667
|
+
IDBObjectStore.prototype.__checkIndexConstraints = function (tx, value, excludeKey) {
|
|
9668
|
+
var me = this;
|
|
9669
|
+
var indexPromises = Object.keys(me.__indexes).map(function (indexName) {
|
|
9670
|
+
return new SyncPromise(function (resolve, reject) {
|
|
9671
|
+
var index = me.__indexes[indexName];
|
|
9672
|
+
if (index.__pendingCreate || index.__deleted || !index.unique) {
|
|
9673
|
+
resolve(undefined);
|
|
9674
|
+
return;
|
|
9675
|
+
}
|
|
9676
|
+
/**
|
|
9677
|
+
* @type {import('./Key.js').KeyValueObject|
|
|
9678
|
+
* import('./Key.js').KeyPathEvaluateValue}
|
|
9679
|
+
*/
|
|
9680
|
+
var indexKey;
|
|
9681
|
+
try {
|
|
9682
|
+
indexKey = extractKeyValueDecodedFromValueUsingKeyPath(value, index.keyPath, index.multiEntry);
|
|
9683
|
+
if ('invalid' in indexKey && indexKey.invalid || 'failure' in indexKey && indexKey.failure) {
|
|
9684
|
+
throw new Error('Go to catch');
|
|
9685
|
+
}
|
|
9686
|
+
} catch (err) {
|
|
9687
|
+
resolve(undefined);
|
|
9688
|
+
return;
|
|
9689
|
+
}
|
|
9690
|
+
indexKey = indexKey.value;
|
|
9691
|
+
if (indexKey === undefined) {
|
|
9692
|
+
resolve(undefined);
|
|
9693
|
+
return;
|
|
9694
|
+
}
|
|
9695
|
+
var multiCheck = index.multiEntry && Array.isArray(indexKey);
|
|
9696
|
+
var fetchArgs = buildFetchIndexDataSQL(true, index, indexKey, 'key', multiCheck);
|
|
9697
|
+
executeFetchIndexData.apply(void 0, [null].concat(_toConsumableArray(fetchArgs), [tx, null, function success(key) {
|
|
9698
|
+
if (key === undefined || excludeKey !== undefined && cmp(key, excludeKey) === 0) {
|
|
9699
|
+
resolve(undefined);
|
|
9700
|
+
return;
|
|
9701
|
+
}
|
|
9702
|
+
reject(createDOMException('ConstraintError', 'Index already contains a record equal to ' + (multiCheck ? 'one of the subkeys of' : '') + '`indexKey`'));
|
|
9703
|
+
}, reject]));
|
|
9704
|
+
});
|
|
9705
|
+
});
|
|
9706
|
+
return SyncPromise.all(indexPromises);
|
|
9707
|
+
};
|
|
9708
|
+
|
|
9641
9709
|
/**
|
|
9642
9710
|
*
|
|
9643
9711
|
* @param {WebSQLTransaction} tx
|
|
@@ -9899,7 +9967,32 @@
|
|
|
9899
9967
|
}, error);
|
|
9900
9968
|
}
|
|
9901
9969
|
if (!noOverwrite) {
|
|
9902
|
-
|
|
9970
|
+
// Validate unique index constraints *before* `__overwrite`
|
|
9971
|
+
// deletes the existing row at this key -- otherwise a
|
|
9972
|
+
// `put()` that ends up rejected still permanently loses
|
|
9973
|
+
// the record it was trying to replace (see
|
|
9974
|
+
// `idbobjectstore-put-unique-index-constraint-is-atomic.any.js`).
|
|
9975
|
+
store.__checkIndexConstraints(tx, value, clonedKeyOrCurrentNumber).then(function () {
|
|
9976
|
+
store.__overwrite(tx, clonedKeyOrCurrentNumber, insert, error);
|
|
9977
|
+
return undefined;
|
|
9978
|
+
/**
|
|
9979
|
+
* @param {Error|DOMException} err
|
|
9980
|
+
* @returns {null}
|
|
9981
|
+
*/
|
|
9982
|
+
}).catch(function (err) {
|
|
9983
|
+
/**
|
|
9984
|
+
* @returns {void}
|
|
9985
|
+
*/
|
|
9986
|
+
function fail() {
|
|
9987
|
+
error(err);
|
|
9988
|
+
}
|
|
9989
|
+
if (typeof oldCn === 'number') {
|
|
9990
|
+
assignCurrentNumber(tx, store, oldCn, fail, fail);
|
|
9991
|
+
return null;
|
|
9992
|
+
}
|
|
9993
|
+
fail();
|
|
9994
|
+
return null;
|
|
9995
|
+
});
|
|
9903
9996
|
return;
|
|
9904
9997
|
}
|
|
9905
9998
|
insert(tx);
|
|
@@ -11464,7 +11557,22 @@
|
|
|
11464
11557
|
// open/close the transaction's active-handler window itself.
|
|
11465
11558
|
req.transaction.__handlerActive = true;
|
|
11466
11559
|
req.dispatchEvent(e);
|
|
11467
|
-
|
|
11560
|
+
// Give any same-tick microtask scheduled from within the
|
|
11561
|
+
// `upgradeneeded` handler (e.g. a plain
|
|
11562
|
+
// `Promise.resolve().then(...)`) a chance to run -- and still
|
|
11563
|
+
// observe the transaction as active -- before we deactivate it
|
|
11564
|
+
// again, per https://github.com/w3c/IndexedDB/issues/87. Only
|
|
11565
|
+
// the flag reset itself is deferred here -- unlike
|
|
11566
|
+
// `IDBTransaction.js`'s `advanceAfterDispatch`, `finished()`
|
|
11567
|
+
// (this transaction's own queue-advancement/completion signal)
|
|
11568
|
+
// still runs synchronously, at exactly its previous timing: an
|
|
11569
|
+
// earlier attempt at deferring `finished()` too raced against
|
|
11570
|
+
// unrelated test setup that assumed a freshly deleted/created
|
|
11571
|
+
// database's upgrade transaction had already fully completed by
|
|
11572
|
+
// the time this function returns.
|
|
11573
|
+
queueMicrotask(function () {
|
|
11574
|
+
req.transaction.__handlerActive = false;
|
|
11575
|
+
});
|
|
11468
11576
|
if (e.__legacyOutputDidListenersThrowError) {
|
|
11469
11577
|
logError('Error', 'An error occurred in an upgradeneeded handler attached to request chain', /** @type {Error} */e.__legacyOutputDidListenersThrowError); // We do nothing else with this error as per spec
|
|
11470
11578
|
req.transaction.__abortTransaction(createDOMException('AbortError', 'A request was aborted.'));
|
|
@@ -12035,6 +12143,14 @@
|
|
|
12035
12143
|
// We must resort to this to get "get <name>" as the function `name` for
|
|
12036
12144
|
// proper IDL.
|
|
12037
12145
|
var o = _defineAccessor("get", {}, prop, function () {
|
|
12146
|
+
// This is defined on the *shared* prototype (see above), so,
|
|
12147
|
+
// unlike a per-instance getter, it's reachable by calling it
|
|
12148
|
+
// directly on `IDBRecord.prototype` itself (not a real
|
|
12149
|
+
// instance) -- WebIDL requires that to throw.
|
|
12150
|
+
if (!(this instanceof IDBRecordAlias)) {
|
|
12151
|
+
throw new TypeError('Illegal invocation');
|
|
12152
|
+
}
|
|
12153
|
+
// @ts-ignore `this` is a real instance past the check above (not an issue in TS7)
|
|
12038
12154
|
return this['__' + prop];
|
|
12039
12155
|
});
|
|
12040
12156
|
var desc = /** @type {PropertyDescriptor} */
|
|
@@ -13535,8 +13651,24 @@
|
|
|
13535
13651
|
Object.setPrototypeOf(IDBRequest, EventTarget);
|
|
13536
13652
|
Object.setPrototypeOf(IDBTransaction, EventTarget);
|
|
13537
13653
|
Object.setPrototypeOf(IDBVersionChangeEvent, ShimEvent);
|
|
13538
|
-
|
|
13539
|
-
|
|
13654
|
+
// `ShimDOMException` is the real native `DOMException` when one
|
|
13655
|
+
// is available (see `DOMException.js`'s `useNativeDOMException`)
|
|
13656
|
+
// -- which, unlike the shim classes above, is a single,
|
|
13657
|
+
// process-wide singleton shared by reference across every
|
|
13658
|
+
// sandbox this library gets installed into (see
|
|
13659
|
+
// `node-idb-test.js`'s `sandboxObj`). A native `DOMException`
|
|
13660
|
+
// already has the correct prototype chain out of the box
|
|
13661
|
+
// (`Object.getPrototypeOf(DOMException) === Function.prototype`,
|
|
13662
|
+
// not `Error`), so forcing it here isn't just unneeded but
|
|
13663
|
+
// actively wrong -- and, because it's shared, permanently
|
|
13664
|
+
// wrong for every later use of `DOMException` in the same
|
|
13665
|
+
// process (e.g. a later WPT test file's own idlharness-style
|
|
13666
|
+
// check that `DOMException` does *not* inherit from `Error`
|
|
13667
|
+
// on the class side), not just this one shim install.
|
|
13668
|
+
if (typeof DOMException === 'undefined' || ShimDOMException !== DOMException) {
|
|
13669
|
+
Object.setPrototypeOf(ShimDOMException, Error);
|
|
13670
|
+
Object.setPrototypeOf(ShimDOMException.prototype, Error.prototype);
|
|
13671
|
+
}
|
|
13540
13672
|
}
|
|
13541
13673
|
if (IDB.indexedDB && !IDB.indexedDB.toString().includes('[native code]')) {
|
|
13542
13674
|
if (CFG.addNonIDBGlobals) {
|