indexeddbshim 13.0.0-pre.1 → 14.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/README.md +1 -1
- package/badges/licenses-badge-dev.svg +1 -1
- package/badges/licenses-badge.svg +1 -1
- package/dist/indexeddbshim-Key.js +152 -151
- 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 +872 -13041
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.js +1165 -1024
- 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 +872 -13041
- package/dist/indexeddbshim-node.cjs.map +1 -1
- package/dist/indexeddbshim-noninvasive.js +1164 -1020
- 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 +1165 -1024
- package/dist/indexeddbshim.js.map +1 -1
- package/dist/indexeddbshim.min.js +2 -2
- package/dist/indexeddbshim.min.js.map +1 -1
- package/index.html +1 -1
- package/package.json +40 -39
- package/src/DOMException.js +3 -4
- package/src/DOMStringList.js +1 -1
- package/src/IDBCursor.js +19 -17
- package/src/IDBDatabase.js +1 -0
- package/src/IDBFactory.js +23 -16
- package/src/IDBIndex.js +17 -23
- package/src/IDBKeyRange.js +4 -4
- package/src/IDBObjectStore.js +29 -26
- package/src/IDBTransaction.js +7 -8
- package/src/Key.d.ts +1 -0
- package/src/Key.js +11 -12
- package/src/setGlobalVars.js +3 -1
- package/src/util.js +1 -0
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="754" height="200"><defs><style>text{font-size:11px;font-family:Verdana,DejaVu Sans,Geneva,sans-serif}text.shadow{fill:#010101;fill-opacity:.3}text.high{fill:#fff}</style><linearGradient id="smooth" x2="0" y2="100%"><stop offset="0" stop-color="#aaa" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="round"><rect width="100%" height="100%" rx="3" fill="#fff"/></mask></defs><g id="bg" mask="url(#round)"><path fill="navy" d="M0 0h88v200H0z"/><path fill="#006400" d="M88 0h183v200H88z"/><path fill="green" d="M271 0h266v200H271z"/><path fill="#cc0" d="M537 0h108v200H537z"/><path fill="#a9a9a9" d="M645 0h109v200H645z"/><path fill="url(#smooth)" d="M0 0h754v200H0z"/></g><g id="fg"><text class="shadow" x="5.5" y="15">License types</text><text class="high" x="5" y="14">License types</text><text class="shadow" x="5.5" y="27">(all devDeps)</text><text class="high" x="5" y="26">(all devDeps)</text><text class="shadow" x="93.5" y="15">Public</text><text class="high" x="93" y="14">Public</text><text class="shadow" x="93.5" y="27">domain</text><text class="high" x="93" y="26">domain</text><text class="shadow" x="93.5" y="51">1. (MIT OR CC0-1.0)</text><text class="high" x="93" y="50">1. (MIT OR CC0-1.0)</text><text class="shadow" x="93.5" y="63">2. (Unlicense OR Apache-2.0)</text><text class="high" x="93" y="62">2. (Unlicense OR Apache-2.0)</text><text class="shadow" x="93.5" y="75">3. CC0-1.0</text><text class="high" x="93" y="74">3. CC0-1.0</text><text class="shadow" x="276.5" y="15">Permissive</text><text class="high" x="276" y="14">Permissive</text><text class="shadow" x="276.5" y="39">1. (BSD-2-Clause OR (MIT OR Apache-2.0))</text><text class="high" x="276" y="38">1. (BSD-2-Clause OR (MIT OR Apache-2.0))</text><text class="shadow" x="276.5" y="51">2. (MIT OR CC0-1.0)</text><text class="high" x="276" y="50">2. (MIT OR CC0-1.0)</text><text class="shadow" x="276.5" y="63">3. (MIT OR WTFPL)</text><text class="high" x="276" y="62">3. (MIT OR WTFPL)</text><text class="shadow" x="276.5" y="75">4. (Unlicense OR Apache-2.0)</text><text class="high" x="276" y="74">4. (Unlicense OR Apache-2.0)</text><text class="shadow" x="276.5" y="87">5. 0BSD</text><text class="high" x="276" y="86">5. 0BSD</text><text class="shadow" x="276.5" y="99">6. Apache-2.0</text><text class="high" x="276" y="98">6. Apache-2.0</text><text class="shadow" x="276.5" y="111">7. BSD-2-Clause</text><text class="high" x="276" y="110">7. BSD-2-Clause</text><text class="shadow" x="276.5" y="123">8. BSD-3-Clause</text><text class="high" x="276" y="122">8. BSD-3-Clause</text><text class="shadow" x="276.5" y="135">9. BlueOak-1.0.0</text><text class="high" x="276" y="134">9. BlueOak-1.0.0</text><text class="shadow" x="276.5" y="147">10. CC-BY-3.0</text><text class="high" x="276" y="146">10. CC-BY-3.0</text><text class="shadow" x="276.5" y="159">11. CC-BY-4.0</text><text class="high" x="276" y="158">11. CC-BY-4.0</text><text class="shadow" x="276.5" y="171">12. ISC</text><text class="high" x="276" y="170">12. ISC</text><text class="shadow" x="276.5" y="183">13. MIT</text><text class="high" x="276" y="182">13. MIT</text><text class="shadow" x="276.5" y="195">14. WTFPL</text><text class="high" x="276" y="194">14. WTFPL</text><text class="shadow" x="542.5" y="15">Weakly</text><text class="high" x="542" y="14">Weakly</text><text class="shadow" x="542.5" y="27">protective</text><text class="high" x="542" y="26">protective</text><text class="shadow" x="542.5" y="51">1. LGPL-3.0-only</text><text class="high" x="542" y="50">1. LGPL-3.0-only</text><text class="shadow" x="542.5" y="63">2. MPL-2.0</text><text class="high" x="542" y="62">2. MPL-2.0</text><text class="shadow" x="650.5" y="15">Uncategorized</text><text class="high" x="650" y="14">Uncategorized</text><text class="shadow" x="650.5" y="39">1. neodoc (2.0.2)</text><text class="high" x="650" y="38">1. neodoc (2.0.2)</text></g></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="676" height="152"><defs><style>text{font-size:11px;font-family:Verdana,DejaVu Sans,Geneva,sans-serif}text.shadow{fill:#010101;fill-opacity:.3}text.high{fill:#fff}</style><linearGradient id="smooth" x2="0" y2="100%"><stop offset="0" stop-color="#aaa" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="round"><rect width="100%" height="100%" rx="3" fill="#fff"/></mask></defs><g id="bg" mask="url(#round)"><path fill="navy" d="M0 0h227v152H0z"/><path fill="#006400" d="M227 0h183v152H227z"/><path fill="green" d="M410 0h266v152H410z"/><path fill="url(#smooth)" d="M0 0h676v152H0z"/></g><g id="fg"><text class="shadow" x="5.5" y="15">License types</text><text class="high" x="5" y="14">License types</text><text class="shadow" x="5.5" y="27">(project, deps, and bundled devDeps)</text><text class="high" x="5" y="26">(project, deps, and bundled devDeps)</text><text class="shadow" x="232.5" y="15">Public</text><text class="high" x="232" y="14">Public</text><text class="shadow" x="232.5" y="27">domain</text><text class="high" x="232" y="26">domain</text><text class="shadow" x="232.5" y="51">1. (Unlicense OR Apache-2.0)</text><text class="high" x="232" y="50">1. (Unlicense OR Apache-2.0)</text><text class="shadow" x="415.5" y="15">Permissive</text><text class="high" x="415" y="14">Permissive</text><text class="shadow" x="415.5" y="39">1. (BSD-2-Clause OR (MIT OR Apache-2.0))</text><text class="high" x="415" y="38">1. (BSD-2-Clause OR (MIT OR Apache-2.0))</text><text class="shadow" x="415.5" y="51">2. (MIT OR Apache-2.0)</text><text class="high" x="415" y="50">2. (MIT OR Apache-2.0)</text><text class="shadow" x="415.5" y="63">3. (MIT OR WTFPL)</text><text class="high" x="415" y="62">3. (MIT OR WTFPL)</text><text class="shadow" x="415.5" y="75">4. (Unlicense OR Apache-2.0)</text><text class="high" x="415" y="74">4. (Unlicense OR Apache-2.0)</text><text class="shadow" x="415.5" y="87">5. Apache-2.0</text><text class="high" x="415" y="86">5. Apache-2.0</text><text class="shadow" x="415.5" y="99">6. BSD-2-Clause</text><text class="high" x="415" y="98">6. BSD-2-Clause</text><text class="shadow" x="415.5" y="111">7. BSD-3-Clause</text><text class="high" x="415" y="110">7. BSD-3-Clause</text><text class="shadow" x="415.5" y="123">8. ISC</text><text class="high" x="415" y="122">8. ISC</text><text class="shadow" x="415.5" y="135">9. MIT</text><text class="high" x="415" y="134">9. MIT</text><text class="shadow" x="415.5" y="147">10. WTFPL</text><text class="high" x="415" y="146">10. WTFPL</text></g></svg>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! indexeddbshim -
|
|
1
|
+
/*! indexeddbshim - v13.0.0 - 7/7/2024 */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -6,127 +6,120 @@
|
|
|
6
6
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.IDBKeyUtils = {}));
|
|
7
7
|
})(this, (function (exports) { 'use strict';
|
|
8
8
|
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
_e,
|
|
14
|
-
_x,
|
|
15
|
-
_r,
|
|
16
|
-
_arr = [],
|
|
17
|
-
_n = !0,
|
|
18
|
-
_d = !1;
|
|
19
|
-
try {
|
|
20
|
-
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
21
|
-
if (Object(_i) !== _i) return;
|
|
22
|
-
_n = !1;
|
|
23
|
-
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
24
|
-
} catch (err) {
|
|
25
|
-
_d = !0, _e = err;
|
|
26
|
-
} finally {
|
|
27
|
-
try {
|
|
28
|
-
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
|
|
29
|
-
} finally {
|
|
30
|
-
if (_d) throw _e;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return _arr;
|
|
34
|
-
}
|
|
9
|
+
function _arrayLikeToArray(r, a) {
|
|
10
|
+
(null == a || a > r.length) && (a = r.length);
|
|
11
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
12
|
+
return n;
|
|
35
13
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
40
|
-
return typeof obj;
|
|
41
|
-
} : function (obj) {
|
|
42
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
43
|
-
}, _typeof(obj);
|
|
44
|
-
}
|
|
45
|
-
function _slicedToArray(arr, i) {
|
|
46
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
47
|
-
}
|
|
48
|
-
function _toConsumableArray(arr) {
|
|
49
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
50
|
-
}
|
|
51
|
-
function _arrayWithoutHoles(arr) {
|
|
52
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
14
|
+
function _arrayWithHoles(r) {
|
|
15
|
+
if (Array.isArray(r)) return r;
|
|
53
16
|
}
|
|
54
|
-
function
|
|
55
|
-
if (Array.isArray(
|
|
17
|
+
function _arrayWithoutHoles(r) {
|
|
18
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
56
19
|
}
|
|
57
|
-
function
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
65
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
66
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
67
|
-
}
|
|
68
|
-
function _arrayLikeToArray(arr, len) {
|
|
69
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
70
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
71
|
-
return arr2;
|
|
72
|
-
}
|
|
73
|
-
function _nonIterableSpread() {
|
|
74
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
75
|
-
}
|
|
76
|
-
function _nonIterableRest() {
|
|
77
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
78
|
-
}
|
|
79
|
-
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
80
|
-
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
81
|
-
if (!it) {
|
|
82
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
83
|
-
if (it) o = it;
|
|
84
|
-
var i = 0;
|
|
85
|
-
var F = function () {};
|
|
20
|
+
function _createForOfIteratorHelper(r, e) {
|
|
21
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
22
|
+
if (!t) {
|
|
23
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e ) {
|
|
24
|
+
t && (r = t);
|
|
25
|
+
var n = 0,
|
|
26
|
+
F = function () {};
|
|
86
27
|
return {
|
|
87
28
|
s: F,
|
|
88
29
|
n: function () {
|
|
89
|
-
|
|
90
|
-
done:
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
value: o[i++]
|
|
30
|
+
return n >= r.length ? {
|
|
31
|
+
done: !0
|
|
32
|
+
} : {
|
|
33
|
+
done: !1,
|
|
34
|
+
value: r[n++]
|
|
95
35
|
};
|
|
96
36
|
},
|
|
97
|
-
e: function (
|
|
98
|
-
throw
|
|
37
|
+
e: function (r) {
|
|
38
|
+
throw r;
|
|
99
39
|
},
|
|
100
40
|
f: F
|
|
101
41
|
};
|
|
102
42
|
}
|
|
103
43
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
104
44
|
}
|
|
105
|
-
var
|
|
106
|
-
|
|
107
|
-
|
|
45
|
+
var o,
|
|
46
|
+
a = !0,
|
|
47
|
+
u = !1;
|
|
108
48
|
return {
|
|
109
49
|
s: function () {
|
|
110
|
-
|
|
50
|
+
t = t.call(r);
|
|
111
51
|
},
|
|
112
52
|
n: function () {
|
|
113
|
-
var
|
|
114
|
-
|
|
115
|
-
return step;
|
|
53
|
+
var r = t.next();
|
|
54
|
+
return a = r.done, r;
|
|
116
55
|
},
|
|
117
|
-
e: function (
|
|
118
|
-
|
|
119
|
-
err = e;
|
|
56
|
+
e: function (r) {
|
|
57
|
+
u = !0, o = r;
|
|
120
58
|
},
|
|
121
59
|
f: function () {
|
|
122
60
|
try {
|
|
123
|
-
|
|
61
|
+
a || null == t.return || t.return();
|
|
124
62
|
} finally {
|
|
125
|
-
if (
|
|
63
|
+
if (u) throw o;
|
|
126
64
|
}
|
|
127
65
|
}
|
|
128
66
|
};
|
|
129
67
|
}
|
|
68
|
+
function _iterableToArray(r) {
|
|
69
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
70
|
+
}
|
|
71
|
+
function _iterableToArrayLimit(r, l) {
|
|
72
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
73
|
+
if (null != t) {
|
|
74
|
+
var e,
|
|
75
|
+
n,
|
|
76
|
+
i,
|
|
77
|
+
u,
|
|
78
|
+
a = [],
|
|
79
|
+
f = !0,
|
|
80
|
+
o = !1;
|
|
81
|
+
try {
|
|
82
|
+
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
83
|
+
} catch (r) {
|
|
84
|
+
o = !0, n = r;
|
|
85
|
+
} finally {
|
|
86
|
+
try {
|
|
87
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
88
|
+
} finally {
|
|
89
|
+
if (o) throw n;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return a;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function _nonIterableRest() {
|
|
96
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
97
|
+
}
|
|
98
|
+
function _nonIterableSpread() {
|
|
99
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
100
|
+
}
|
|
101
|
+
function _slicedToArray(r, e) {
|
|
102
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
103
|
+
}
|
|
104
|
+
function _toConsumableArray(r) {
|
|
105
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
106
|
+
}
|
|
107
|
+
function _typeof(o) {
|
|
108
|
+
"@babel/helpers - typeof";
|
|
109
|
+
|
|
110
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
111
|
+
return typeof o;
|
|
112
|
+
} : function (o) {
|
|
113
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
114
|
+
}, _typeof(o);
|
|
115
|
+
}
|
|
116
|
+
function _unsupportedIterableToArray(r, a) {
|
|
117
|
+
if (r) {
|
|
118
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
119
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
120
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
130
123
|
|
|
131
124
|
/* eslint-disable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/147 */
|
|
132
125
|
/**
|
|
@@ -463,7 +456,7 @@
|
|
|
463
456
|
function DOMException(message, name) {
|
|
464
457
|
// const err = Error.prototype.constructor.call(this, message); // Any use to this? Won't set this.message
|
|
465
458
|
this[Symbol.toStringTag] = 'DOMException';
|
|
466
|
-
this._code = name in codes ? codes[/** @type {Code} */name] : legacyCodes[/** @type {LegacyCode} */name] || 0;
|
|
459
|
+
this._code = name in codes ? codes[( /** @type {Code} */name)] : legacyCodes[( /** @type {LegacyCode} */name)] || 0;
|
|
467
460
|
this._name = name || 'Error';
|
|
468
461
|
// We avoid `String()` in this next line as it converts Symbols
|
|
469
462
|
this._message = message === undefined ? '' : '' + message; // eslint-disable-line no-implicit-coercion
|
|
@@ -600,10 +593,12 @@
|
|
|
600
593
|
*/
|
|
601
594
|
function logError(name, message, error) {
|
|
602
595
|
if (CFG.DEBUG) {
|
|
603
|
-
var msg = error && _typeof(error) === 'object' && error.message ? error.message : /** @type {string} */error;
|
|
596
|
+
var msg = error && _typeof(error) === 'object' && error.message ? error.message : ( /** @type {string} */error);
|
|
604
597
|
var method = typeof console.error === 'function' ? 'error' : 'log';
|
|
605
598
|
console[method](name + ': ' + message + '. ' + (msg || ''));
|
|
606
|
-
|
|
599
|
+
if (console.trace) {
|
|
600
|
+
console.trace();
|
|
601
|
+
}
|
|
607
602
|
}
|
|
608
603
|
}
|
|
609
604
|
|
|
@@ -632,7 +627,7 @@
|
|
|
632
627
|
}
|
|
633
628
|
} catch (e) {}
|
|
634
629
|
var createDOMException = useNativeDOMException
|
|
635
|
-
// eslint-disable-next-line operator-linebreak -- Need JSDoc
|
|
630
|
+
// eslint-disable-next-line @stylistic/operator-linebreak -- Need JSDoc
|
|
636
631
|
?
|
|
637
632
|
/**
|
|
638
633
|
* @param {string} name
|
|
@@ -644,7 +639,7 @@
|
|
|
644
639
|
logError(name, message, error);
|
|
645
640
|
return createNativeDOMException(name, message);
|
|
646
641
|
}
|
|
647
|
-
// eslint-disable-next-line operator-linebreak -- Need JSDoc
|
|
642
|
+
// eslint-disable-next-line @stylistic/operator-linebreak -- Need JSDoc
|
|
648
643
|
:
|
|
649
644
|
/**
|
|
650
645
|
* @param {string} name
|
|
@@ -865,17 +860,15 @@
|
|
|
865
860
|
var types = {
|
|
866
861
|
invalid: {
|
|
867
862
|
/**
|
|
868
|
-
* @param {AnyValue} _key
|
|
869
863
|
* @returns {string}
|
|
870
864
|
*/
|
|
871
|
-
encode: function encode(
|
|
865
|
+
encode: function encode() {
|
|
872
866
|
return keyTypeToEncodedChar.invalid + '-';
|
|
873
867
|
},
|
|
874
868
|
/**
|
|
875
|
-
* @param {string} _key
|
|
876
869
|
* @returns {undefined}
|
|
877
870
|
*/
|
|
878
|
-
decode: function decode(
|
|
871
|
+
decode: function decode() {
|
|
879
872
|
return undefined;
|
|
880
873
|
}
|
|
881
874
|
},
|
|
@@ -1213,11 +1206,17 @@
|
|
|
1213
1206
|
* @returns {KeyType|"invalid"}
|
|
1214
1207
|
*/
|
|
1215
1208
|
function getKeyType(key) {
|
|
1216
|
-
if (Array.isArray(key))
|
|
1217
|
-
|
|
1218
|
-
|
|
1209
|
+
if (Array.isArray(key)) {
|
|
1210
|
+
return 'array';
|
|
1211
|
+
}
|
|
1212
|
+
if (isDate(key)) {
|
|
1213
|
+
return 'date';
|
|
1214
|
+
}
|
|
1215
|
+
if (isBinary(key)) {
|
|
1216
|
+
return 'binary';
|
|
1217
|
+
}
|
|
1219
1218
|
var keyType = _typeof(key);
|
|
1220
|
-
return ['string', 'number'].includes(keyType) ? /** @type {"string"|"number"} */keyType : 'invalid';
|
|
1219
|
+
return ['string', 'number'].includes(keyType) ? ( /** @type {"string"|"number"} */keyType) : 'invalid';
|
|
1221
1220
|
}
|
|
1222
1221
|
|
|
1223
1222
|
/**
|
|
@@ -1314,13 +1313,11 @@
|
|
|
1314
1313
|
value: 0
|
|
1315
1314
|
};
|
|
1316
1315
|
}
|
|
1317
|
-
return
|
|
1318
|
-
);
|
|
1316
|
+
return /** @type {{type: KeyType; value: Value}} */ret;
|
|
1319
1317
|
}
|
|
1320
1318
|
case 'string':
|
|
1321
1319
|
{
|
|
1322
|
-
return
|
|
1323
|
-
);
|
|
1320
|
+
return /** @type {{type: KeyType; value: Value}} */ret;
|
|
1324
1321
|
}
|
|
1325
1322
|
case 'binary':
|
|
1326
1323
|
{
|
|
@@ -1343,48 +1340,49 @@
|
|
|
1343
1340
|
/** @type {(KeyValueObject|Value)[]} */
|
|
1344
1341
|
var keys = [];
|
|
1345
1342
|
var _loop = function _loop() {
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
return {
|
|
1349
|
-
v: {
|
|
1350
|
-
type: type,
|
|
1351
|
-
invalid: true,
|
|
1352
|
-
message: 'Does not have own index property'
|
|
1353
|
-
}
|
|
1354
|
-
};
|
|
1355
|
-
}
|
|
1356
|
-
try {
|
|
1357
|
-
var entry = arr[i];
|
|
1358
|
-
var key = convertValueToKeyValueDecoded(entry, seen, false, fullKeys); // Though steps do not list rethrowing, the next is returnifabrupt when not multiEntry
|
|
1359
|
-
if (key.invalid) {
|
|
1360
|
-
if (multiEntry) {
|
|
1361
|
-
return "continue";
|
|
1362
|
-
}
|
|
1343
|
+
// We cannot iterate here with array extras as we must ensure sparse arrays are invalidated
|
|
1344
|
+
if (!multiEntry && !Object.hasOwn(arr, i)) {
|
|
1363
1345
|
return {
|
|
1364
1346
|
v: {
|
|
1365
1347
|
type: type,
|
|
1366
1348
|
invalid: true,
|
|
1367
|
-
message: '
|
|
1349
|
+
message: 'Does not have own index property'
|
|
1368
1350
|
}
|
|
1369
1351
|
};
|
|
1370
1352
|
}
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1353
|
+
try {
|
|
1354
|
+
var entry = arr[i];
|
|
1355
|
+
var key = convertValueToKeyValueDecoded(entry, seen, false, fullKeys); // Though steps do not list rethrowing, the next is returnifabrupt when not multiEntry
|
|
1356
|
+
if (key.invalid) {
|
|
1357
|
+
if (multiEntry) {
|
|
1358
|
+
return 0; // continue
|
|
1359
|
+
}
|
|
1360
|
+
return {
|
|
1361
|
+
v: {
|
|
1362
|
+
type: type,
|
|
1363
|
+
invalid: true,
|
|
1364
|
+
message: 'Bad array entry value-to-key conversion'
|
|
1365
|
+
}
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
if (!multiEntry || !fullKeys && keys.every(function (k) {
|
|
1369
|
+
return cmp(k, key.value) !== 0;
|
|
1370
|
+
}) || fullKeys && keys.every(function (k) {
|
|
1371
|
+
return cmp(k, key) !== 0;
|
|
1372
|
+
})) {
|
|
1373
|
+
keys.push(fullKeys ? key : key.value);
|
|
1374
|
+
}
|
|
1375
|
+
} catch (err) {
|
|
1376
|
+
if (!multiEntry) {
|
|
1377
|
+
throw err;
|
|
1378
|
+
}
|
|
1381
1379
|
}
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1380
|
+
},
|
|
1381
|
+
_ret;
|
|
1384
1382
|
for (var i = 0; i < len; i++) {
|
|
1385
|
-
|
|
1386
|
-
if (_ret ===
|
|
1387
|
-
if (
|
|
1383
|
+
_ret = _loop();
|
|
1384
|
+
if (_ret === 0) continue;
|
|
1385
|
+
if (_ret) return _ret.v;
|
|
1388
1386
|
}
|
|
1389
1387
|
return {
|
|
1390
1388
|
type: type,
|
|
@@ -1546,7 +1544,7 @@
|
|
|
1546
1544
|
};
|
|
1547
1545
|
}
|
|
1548
1546
|
var identifiers = keyPath.split('.');
|
|
1549
|
-
return identifiers.some(function (idntfr
|
|
1547
|
+
return identifiers.some(function (idntfr) {
|
|
1550
1548
|
if (idntfr === 'length' && (typeof value === 'string' || Array.isArray(value))) {
|
|
1551
1549
|
value = value.length;
|
|
1552
1550
|
} else if (isBlob(value)) {
|
|
@@ -1597,7 +1595,7 @@
|
|
|
1597
1595
|
}
|
|
1598
1596
|
value = value[identifier];
|
|
1599
1597
|
});
|
|
1600
|
-
value[/** @type {string} */last] = key; // key is already a `keyValue` in our processing so no need to convert
|
|
1598
|
+
value[( /** @type {string} */last)] = key; // key is already a `keyValue` in our processing so no need to convert
|
|
1601
1599
|
}
|
|
1602
1600
|
|
|
1603
1601
|
/**
|
|
@@ -1769,6 +1767,7 @@
|
|
|
1769
1767
|
return null;
|
|
1770
1768
|
}
|
|
1771
1769
|
// array, date, number, string, binary (should already have detected "invalid")
|
|
1770
|
+
// @ts-expect-error Argument may be ignored
|
|
1772
1771
|
return types[getKeyType(key)].encode(key, inArray);
|
|
1773
1772
|
}
|
|
1774
1773
|
|
|
@@ -1830,7 +1829,7 @@
|
|
|
1830
1829
|
}
|
|
1831
1830
|
}, function (tx, error) {
|
|
1832
1831
|
sqlFailCb(createDOMException('DataError', 'Could not get the auto increment value for key', error));
|
|
1833
|
-
return
|
|
1832
|
+
return false;
|
|
1834
1833
|
});
|
|
1835
1834
|
}
|
|
1836
1835
|
|
|
@@ -1846,12 +1845,14 @@
|
|
|
1846
1845
|
function assignCurrentNumber(tx, store, num, successCb, failCb) {
|
|
1847
1846
|
var sql = 'UPDATE __sys__ SET "currNum" = ? WHERE "name" = ?';
|
|
1848
1847
|
var sqlValues = [num, escapeSQLiteStatement(store.__currentName)];
|
|
1849
|
-
CFG.DEBUG
|
|
1850
|
-
|
|
1848
|
+
if (CFG.DEBUG) {
|
|
1849
|
+
console.log(sql, sqlValues);
|
|
1850
|
+
}
|
|
1851
|
+
tx.executeSql(sql, sqlValues, function () {
|
|
1851
1852
|
successCb(num);
|
|
1852
1853
|
}, function (tx, err) {
|
|
1853
1854
|
failCb(createDOMException('UnknownError', 'Could not set the auto increment value for key', err));
|
|
1854
|
-
return
|
|
1855
|
+
return false;
|
|
1855
1856
|
});
|
|
1856
1857
|
}
|
|
1857
1858
|
|