indexeddbshim 19.0.2 → 19.0.4
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 -6
- package/badges/coverage-badge.svg +1 -1
- package/badges/licenses-badge-dev.svg +1 -1
- package/badges/licenses-badge.svg +1 -1
- package/badges/tests-badge.svg +1 -1
- package/dist/IDBTransaction.d.ts +15 -0
- package/dist/IDBTransaction.d.ts.map +1 -1
- package/dist/indexeddbshim-Key.js +2 -2
- package/dist/indexeddbshim-Key.js.map +1 -1
- package/dist/indexeddbshim-Key.min.js +1 -1
- package/dist/indexeddbshim-Key.min.js.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +123 -73
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.js +123 -74
- package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js +3 -3
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
- package/dist/indexeddbshim-node.cjs +121 -72
- package/dist/indexeddbshim-node.cjs.map +1 -1
- package/dist/indexeddbshim-noninvasive.js +123 -74
- package/dist/indexeddbshim-noninvasive.js.map +1 -1
- package/dist/indexeddbshim-noninvasive.min.js +3 -3
- package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
- package/dist/indexeddbshim.js +123 -74
- package/dist/indexeddbshim.js.map +1 -1
- package/dist/indexeddbshim.min.js +3 -3
- package/dist/indexeddbshim.min.js.map +1 -1
- package/dist/node-UnicodeIdentifiers.d.ts.map +1 -1
- package/dist/setGlobalVars.d.ts.map +1 -1
- package/dist/unicode-regex.d.ts +1 -1
- package/dist/unicode-regex.d.ts.map +1 -1
- package/dist/util.d.ts +0 -6
- package/dist/util.d.ts.map +1 -1
- package/package.json +100 -95
- package/src/CFG.js +1 -1
- package/src/IDBTransaction.js +76 -18
- package/src/node-UnicodeIdentifiers.js +2 -1
- package/src/setGlobalVars.js +2 -1
- package/src/unicode-regex.js +1 -16
- package/src/util.js +1 -11
- package/licenseInfo.json +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! indexeddbshim - v19.0.
|
|
1
|
+
/*! indexeddbshim - v19.0.4 - 9/17/2026 */
|
|
2
2
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -1446,7 +1446,7 @@ const CFG = /** @type {ConfigValues} */{};
|
|
|
1446
1446
|
'UnicodeIDStart',
|
|
1447
1447
|
// In the non-Unicode builds, defaults to /[$0-9A-Z_a-z]/
|
|
1448
1448
|
'UnicodeIDContinue',
|
|
1449
|
-
// Used by
|
|
1449
|
+
// Used by Sca.js for optional restructuring of typeson-registry
|
|
1450
1450
|
// Structured Cloning Algorithm; should only be needed for ensuring data
|
|
1451
1451
|
// created in 3.* versions of IndexedDBShim continue to work; see the
|
|
1452
1452
|
// library `typeson-registry-sca-reverter` to get a function to do this
|
|
@@ -1565,19 +1565,7 @@ val => {
|
|
|
1565
1565
|
|
|
1566
1566
|
// @ts-nocheck
|
|
1567
1567
|
|
|
1568
|
-
|
|
1569
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
1570
|
-
}
|
|
1571
|
-
var regex$1;
|
|
1572
|
-
var hasRequiredRegex;
|
|
1573
|
-
function requireRegex() {
|
|
1574
|
-
if (hasRequiredRegex) return regex$1;
|
|
1575
|
-
hasRequiredRegex = 1;
|
|
1576
|
-
regex$1 = /[\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]|\uD801[\uDDC9\uDDE4]|\uD804[\uDC9A\uDC9C\uDCAB\uDD2E\uDD2F\uDF4B\uDF4C\uDF83\uDF85\uDF8E\uDF91\uDFC5\uDFC7\uDFC8]|\uD805[\uDCBB\uDCBC\uDCBE\uDDBA\uDDBB]|\uD806\uDD38|\uD818[\uDD21-\uDD28]|\uD81B[\uDD68-\uDD6A]|\uD834[\uDD5E-\uDD64\uDDBB-\uDDC0]/;
|
|
1577
|
-
return regex$1;
|
|
1578
|
-
}
|
|
1579
|
-
var regexExports = requireRegex();
|
|
1580
|
-
var regex = /*@__PURE__*/getDefaultExportFromCjs(regexExports);
|
|
1568
|
+
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]|\uD801[\uDDC9\uDDE4]|\uD804[\uDC9A\uDC9C\uDCAB\uDD2E\uDD2F\uDF4B\uDF4C\uDF83\uDF85\uDF8E\uDF91\uDFC5\uDFC7\uDFC8]|\uD805[\uDCBB\uDCBC\uDCBE\uDDBA\uDDBB]|\uD806\uDD38|\uD818[\uDD21-\uDD28]|\uD81B[\uDD68-\uDD6A]|\uD834[\uDD5E-\uDD64\uDDBB-\uDDC0]/;
|
|
1581
1569
|
|
|
1582
1570
|
/* eslint-disable new-cap -- ToString is how it is defined */
|
|
1583
1571
|
|
|
@@ -4953,6 +4941,7 @@ const readonlyProperties$4 = ['objectStoreNames', 'mode', 'durability', 'db', 'e
|
|
|
4953
4941
|
* __requestsFinished: boolean,
|
|
4954
4942
|
* __transFinishedCb: (err: boolean, cb: ((bool?: boolean) => void)) => void,
|
|
4955
4943
|
* __callTransFinishedCb: (err: boolean, cb: ((bool?: boolean) => void)) => void,
|
|
4944
|
+
* __usesStandardDriver: () => boolean,
|
|
4956
4945
|
* __transactionEndCallback: (() => void)|undefined,
|
|
4957
4946
|
* __transactionFinished: boolean,
|
|
4958
4947
|
* __completed: boolean,
|
|
@@ -5090,6 +5079,27 @@ IDBTransaction.prototype.__transFinishedCb = function (err, cb) {
|
|
|
5090
5079
|
cb(Boolean(err));
|
|
5091
5080
|
};
|
|
5092
5081
|
|
|
5082
|
+
/**
|
|
5083
|
+
* A standard (3-argument) `transaction()`/`readTransaction()` implementation
|
|
5084
|
+
* (browser WebSQL, `cordova-plugin-sqlite-2`, etc.) never invokes the
|
|
5085
|
+
* non-standard 4th callback that installs the real `__transFinishedCb`,
|
|
5086
|
+
* and finalizes its own underlying SQL transaction synchronously, as soon
|
|
5087
|
+
* as it sees no further `executeSql` call already in flight or queued --
|
|
5088
|
+
* with no way for it to know a JS-level continuation (e.g. an
|
|
5089
|
+
* `await`-deferred follow-up request) is still coming. Detected via
|
|
5090
|
+
* arity, checking whichever of the two methods this transaction's own
|
|
5091
|
+
* mode actually uses.
|
|
5092
|
+
* @this {IDBTransactionFull}
|
|
5093
|
+
* @returns {boolean}
|
|
5094
|
+
*/
|
|
5095
|
+
IDBTransaction.prototype.__usesStandardDriver = function () {
|
|
5096
|
+
const me = this;
|
|
5097
|
+
const dbConn = me.db && me.db.__db;
|
|
5098
|
+
const dbMethodName = me.mode === 'readonly' ? 'readTransaction' : 'transaction';
|
|
5099
|
+
const supportsNonstandardTransCb = Boolean(dbConn && typeof dbConn[dbMethodName] === 'function' && dbConn[dbMethodName].length >= 4);
|
|
5100
|
+
return !supportsNonstandardTransCb;
|
|
5101
|
+
};
|
|
5102
|
+
|
|
5093
5103
|
/**
|
|
5094
5104
|
* In Node, the real (SQL-commit-capable) `__transFinishedCb` is only
|
|
5095
5105
|
* installed once the underlying WebSQL driver's own SQL-queue-idle check
|
|
@@ -5124,17 +5134,11 @@ IDBTransaction.prototype.__callTransFinishedCb = function (err, cb) {
|
|
|
5124
5134
|
return;
|
|
5125
5135
|
}
|
|
5126
5136
|
if (me.__transFinishedCb === IDBTransaction.prototype.__transFinishedCb) {
|
|
5127
|
-
//
|
|
5128
|
-
//
|
|
5129
|
-
//
|
|
5130
|
-
//
|
|
5131
|
-
|
|
5132
|
-
// actually uses -- see `__executeRequests`) and, if it's not supported,
|
|
5133
|
-
// just call the default (the driver auto-commits on its own).
|
|
5134
|
-
const dbConn = me.db && me.db.__db;
|
|
5135
|
-
const dbMethodName = me.mode === 'readonly' ? 'readTransaction' : 'transaction';
|
|
5136
|
-
const supportsNonstandardTransCb = Boolean(dbConn && typeof dbConn[dbMethodName] === 'function' && dbConn[dbMethodName].length >= 4);
|
|
5137
|
-
if (!supportsNonstandardTransCb) {
|
|
5137
|
+
// Waiting here for the non-standard 4th callback to install the real
|
|
5138
|
+
// `__transFinishedCb` would defer forever on a standard driver, which
|
|
5139
|
+
// never invokes it -- call the default instead (the driver auto-commits
|
|
5140
|
+
// on its own).
|
|
5141
|
+
if (me.__usesStandardDriver()) {
|
|
5138
5142
|
me.__transFinishedCbFired = true;
|
|
5139
5143
|
me.__transFinishedCb(err, cb);
|
|
5140
5144
|
return;
|
|
@@ -5173,10 +5177,52 @@ IDBTransaction.prototype.__executeRequests = function () {
|
|
|
5173
5177
|
// `readTransaction` is optimized, at least in `node-websql`
|
|
5174
5178
|
function executeRequests(tx) {
|
|
5175
5179
|
me.__tx = tx;
|
|
5180
|
+
const isStandardDriver = me.__usesStandardDriver();
|
|
5176
5181
|
/** @type {RequestInfo} */
|
|
5177
5182
|
let q,
|
|
5178
5183
|
i = -1;
|
|
5179
5184
|
|
|
5185
|
+
/**
|
|
5186
|
+
* A continuation that must still be able to observe the
|
|
5187
|
+
* transaction as safe to extend (e.g., re-checking whether an
|
|
5188
|
+
* `await`-based follow-up request has arrived yet, or giving a
|
|
5189
|
+
* same-tick microtask scheduled from a handler a chance to run
|
|
5190
|
+
* first) can normally just be deferred via `queueMicrotask`.
|
|
5191
|
+
* That alone isn't safe on a standard (3-argument) driver,
|
|
5192
|
+
* though: it finalizes its own underlying SQL transaction
|
|
5193
|
+
* synchronously, as soon as it sees no further `executeSql`
|
|
5194
|
+
* call already in flight or queued, and a microtask hop by
|
|
5195
|
+
* itself never issues one -- so the driver already considers
|
|
5196
|
+
* the transaction done by the time the deferred continuation
|
|
5197
|
+
* runs, silently dropping whatever it tries to do next. Issuing
|
|
5198
|
+
* a harmless `SELECT 1` instead keeps the driver's own queue
|
|
5199
|
+
* non-empty across that same gap, at the cost of a real SQL
|
|
5200
|
+
* round trip; Node's driver doesn't need this since its real
|
|
5201
|
+
* commit/rollback is already deferred separately, via
|
|
5202
|
+
* `nonstandardTransCb`.
|
|
5203
|
+
* @param {() => void} cb
|
|
5204
|
+
* @returns {void}
|
|
5205
|
+
*/
|
|
5206
|
+
function keepAliveAndWait(cb) {
|
|
5207
|
+
if (!isStandardDriver) {
|
|
5208
|
+
queueMicrotask(cb);
|
|
5209
|
+
return;
|
|
5210
|
+
}
|
|
5211
|
+
try {
|
|
5212
|
+
tx.executeSql('SELECT 1', [], function () {
|
|
5213
|
+
cb();
|
|
5214
|
+
}, function () {
|
|
5215
|
+
cb();
|
|
5216
|
+
return false; // Don't roll back the transaction over a keep-alive no-op
|
|
5217
|
+
});
|
|
5218
|
+
} catch (err) {
|
|
5219
|
+
// The driver has already finalized the transaction (or otherwise
|
|
5220
|
+
// rejected the call) -- nothing left to hold open, so fall back
|
|
5221
|
+
// to a plain microtask hop for the continuation itself.
|
|
5222
|
+
queueMicrotask(cb);
|
|
5223
|
+
}
|
|
5224
|
+
}
|
|
5225
|
+
|
|
5180
5226
|
/**
|
|
5181
5227
|
* @typedef {unknown} IDBRequestResult
|
|
5182
5228
|
*/
|
|
@@ -5365,9 +5411,9 @@ IDBTransaction.prototype.__executeRequests = function () {
|
|
|
5365
5411
|
* from a microtask -- so if the JS-level queue is merely found
|
|
5366
5412
|
* empty here, that doesn't yet mean no more work is coming, only
|
|
5367
5413
|
* that none has been queued *yet*. Re-check across a small, bounded
|
|
5368
|
-
* number of further
|
|
5369
|
-
* chain like `await store.put(...); await store.get(...)`
|
|
5370
|
-
* up) before finally concluding the transaction is genuinely done.
|
|
5414
|
+
* number of further turns (see `keepAliveAndWait`, letting a typical
|
|
5415
|
+
* `await` chain like `await store.put(...); await store.get(...)`
|
|
5416
|
+
* catch up) before finally concluding the transaction is genuinely done.
|
|
5371
5417
|
* Applies to `readonly` transactions too, not just `readwrite`/
|
|
5372
5418
|
* `versionchange`: a `readonly` transaction's `complete` event
|
|
5373
5419
|
* can otherwise fire synchronously, immediately after its last
|
|
@@ -5397,7 +5443,7 @@ IDBTransaction.prototype.__executeRequests = function () {
|
|
|
5397
5443
|
}
|
|
5398
5444
|
return;
|
|
5399
5445
|
}
|
|
5400
|
-
|
|
5446
|
+
keepAliveAndWait(() => {
|
|
5401
5447
|
checkQueueEntry(attemptsLeft - 1);
|
|
5402
5448
|
});
|
|
5403
5449
|
}
|
|
@@ -5452,7 +5498,7 @@ IDBTransaction.prototype.__executeRequests = function () {
|
|
|
5452
5498
|
checkQueueEntry(10);
|
|
5453
5499
|
return;
|
|
5454
5500
|
}
|
|
5455
|
-
|
|
5501
|
+
keepAliveAndWait(() => {
|
|
5456
5502
|
if (me.__errored || me.__requestsFinished) {
|
|
5457
5503
|
return;
|
|
5458
5504
|
}
|
|
@@ -6223,8 +6269,8 @@ class Typeson {
|
|
|
6223
6269
|
y = {},
|
|
6224
6270
|
p = [],
|
|
6225
6271
|
f = [],
|
|
6226
|
-
|
|
6227
|
-
|
|
6272
|
+
m = [],
|
|
6273
|
+
d = !("cyclic" in c) || c.cyclic,
|
|
6228
6274
|
{
|
|
6229
6275
|
encapsulateObserver: h,
|
|
6230
6276
|
encapsulateError: b
|
|
@@ -6266,18 +6312,18 @@ class Typeson {
|
|
|
6266
6312
|
e[t] = n[r];
|
|
6267
6313
|
});
|
|
6268
6314
|
},
|
|
6269
|
-
_encapsulate = (e, t, a, i, l,
|
|
6315
|
+
_encapsulate = (e, t, a, i, l, m, d) => {
|
|
6270
6316
|
let g,
|
|
6271
6317
|
v = {};
|
|
6272
6318
|
const w = h ? function (r) {
|
|
6273
|
-
const n =
|
|
6319
|
+
const n = d ?? i.type ?? getJSONType(t);
|
|
6274
6320
|
h(Object.assign(r ?? v, {
|
|
6275
6321
|
keypath: e,
|
|
6276
6322
|
value: t,
|
|
6277
6323
|
cyclic: a,
|
|
6278
6324
|
stateObj: i,
|
|
6279
6325
|
promisesData: l,
|
|
6280
|
-
resolvingTypesonPromise:
|
|
6326
|
+
resolvingTypesonPromise: m,
|
|
6281
6327
|
awaitingTypesonPromise: hasConstructorOf(t, TypesonPromise)
|
|
6282
6328
|
}, {
|
|
6283
6329
|
type: n
|
|
@@ -6286,11 +6332,11 @@ class Typeson {
|
|
|
6286
6332
|
getEncapsulatedValue = (e, t, r) => {
|
|
6287
6333
|
try {
|
|
6288
6334
|
return {
|
|
6289
|
-
value: _encapsulate(e, t[r], Boolean(a), i, l,
|
|
6335
|
+
value: _encapsulate(e, t[r], Boolean(a), i, l, m)
|
|
6290
6336
|
};
|
|
6291
6337
|
} catch (n) {
|
|
6292
6338
|
if (!b) throw n;
|
|
6293
|
-
const o =
|
|
6339
|
+
const o = d ?? i.type ?? getJSONType(t),
|
|
6294
6340
|
a = b({
|
|
6295
6341
|
keypath: e,
|
|
6296
6342
|
error: n,
|
|
@@ -6308,7 +6354,7 @@ class Typeson {
|
|
|
6308
6354
|
throw n;
|
|
6309
6355
|
}
|
|
6310
6356
|
};
|
|
6311
|
-
if (["string", "boolean", "number", "undefined"].includes(typeof t)) return void 0 === t || t === 1 / 0 || 0 === t || t === -1 / 0 || Number.isNaN(t) ? (g = i.replaced ? t : replace(e, t, i, l, false,
|
|
6357
|
+
if (["string", "boolean", "number", "undefined"].includes(typeof t)) return void 0 === t || t === 1 / 0 || 0 === t || t === -1 / 0 || Number.isNaN(t) ? (g = i.replaced ? t : replace(e, t, i, l, false, m, w), g !== t && (v = {
|
|
6312
6358
|
replaced: g
|
|
6313
6359
|
})) : g = t, w && w(), g;
|
|
6314
6360
|
if (null === t) return w && w(), t;
|
|
@@ -6385,13 +6431,13 @@ class Typeson {
|
|
|
6385
6431
|
o.push(u);
|
|
6386
6432
|
const p = o.length - 1,
|
|
6387
6433
|
f = `$symbolKeys.${escapeKeyPathComponent(e)}.${String(p)}.value`,
|
|
6388
|
-
|
|
6434
|
+
m = {
|
|
6389
6435
|
value: t[r]
|
|
6390
6436
|
};
|
|
6391
6437
|
_adaptBuiltinStateObjectProperties(i, {
|
|
6392
6438
|
ownKeys: true
|
|
6393
6439
|
}, () => {
|
|
6394
|
-
const e = getEncapsulatedValue(f,
|
|
6440
|
+
const e = getEncapsulatedValue(f, m, "value"),
|
|
6395
6441
|
t = e && e.value;
|
|
6396
6442
|
hasConstructorOf(t, TypesonPromise) ? l.push([f, t, Boolean(a), i, u, "value", i.type]) : e && (void 0 !== t || "substitute" in e) && setOwnEnumerable(u, "value", t);
|
|
6397
6443
|
});
|
|
@@ -6407,7 +6453,7 @@ class Typeson {
|
|
|
6407
6453
|
_adaptBuiltinStateObjectProperties(i, {
|
|
6408
6454
|
ownKeys: false
|
|
6409
6455
|
}, () => {
|
|
6410
|
-
const e = _encapsulate(r, void 0, Boolean(a), i, l,
|
|
6456
|
+
const e = _encapsulate(r, void 0, Boolean(a), i, l, m);
|
|
6411
6457
|
hasConstructorOf(e, TypesonPromise) ? l.push([r, e, Boolean(a), i, S, n, i.type]) : void 0 !== e && setOwnEnumerable(S, n, e);
|
|
6412
6458
|
});
|
|
6413
6459
|
}
|
|
@@ -6436,7 +6482,7 @@ class Typeson {
|
|
|
6436
6482
|
replaced: true
|
|
6437
6483
|
}), (l || !o.replaceAsync) && !o.replace) return s && s({
|
|
6438
6484
|
typeDetected: true
|
|
6439
|
-
}), _encapsulate(e, t,
|
|
6485
|
+
}), _encapsulate(e, t, d && "readonly", r, n, a, i);
|
|
6440
6486
|
let c;
|
|
6441
6487
|
if (s && s({
|
|
6442
6488
|
replacing: true
|
|
@@ -6444,15 +6490,15 @@ class Typeson {
|
|
|
6444
6490
|
if (void 0 === o.replace) throw new TypeError("Missing replacer");
|
|
6445
6491
|
c = o.replace(t, r);
|
|
6446
6492
|
} else c = o.replaceAsync(t, r);
|
|
6447
|
-
return _encapsulate(e, c,
|
|
6493
|
+
return _encapsulate(e, c, d && "readonly", r, n, a, i);
|
|
6448
6494
|
}
|
|
6449
6495
|
}
|
|
6450
6496
|
return t;
|
|
6451
6497
|
},
|
|
6452
|
-
g = _encapsulate("", e,
|
|
6453
|
-
if (
|
|
6498
|
+
g = _encapsulate("", e, d, t ?? {}, m);
|
|
6499
|
+
if (m.length) return l && c.throwOnBadSyncType ? (() => {
|
|
6454
6500
|
throw new TypeError("Sync method requested but async result obtained");
|
|
6455
|
-
})() : Promise.resolve(checkPromises(g,
|
|
6501
|
+
})() : Promise.resolve(checkPromises(g, m)).then(finish);
|
|
6456
6502
|
if (!l && c.throwOnBadSyncType) throw new TypeError("Async method requested but sync result obtained");
|
|
6457
6503
|
return l && c.stringification ? [finish(g)] : l ? finish(g) : Promise.resolve(finish(g));
|
|
6458
6504
|
}
|
|
@@ -6496,8 +6542,8 @@ class Typeson {
|
|
|
6496
6542
|
const y = [],
|
|
6497
6543
|
p = Object.create(null),
|
|
6498
6544
|
f = {};
|
|
6499
|
-
let
|
|
6500
|
-
c.$ && isPlainObject(c.$) && (e = e.$, c = c.$,
|
|
6545
|
+
let m = true;
|
|
6546
|
+
c.$ && isPlainObject(c.$) && (e = e.$, c = c.$, m = false, u = false, void 0 !== l && isObject(e) && !n(e, "$symbolKeys") && (e.$symbolKeys = l, u = true));
|
|
6501
6547
|
const executeReviver = (e, t) => {
|
|
6502
6548
|
const [r] = this.revivers[e] ?? [];
|
|
6503
6549
|
if (!r) throw new Error("Unregistered type: " + e);
|
|
@@ -6506,7 +6552,7 @@ class Typeson {
|
|
|
6506
6552
|
if (r.revive) return r.revive(t, f);
|
|
6507
6553
|
throw new Error("Missing reviver");
|
|
6508
6554
|
},
|
|
6509
|
-
|
|
6555
|
+
d = [];
|
|
6510
6556
|
function checkUndefined(e) {
|
|
6511
6557
|
return hasConstructorOf(e, Undefined) ? void 0 : e;
|
|
6512
6558
|
}
|
|
@@ -6570,8 +6616,8 @@ class Typeson {
|
|
|
6570
6616
|
})();
|
|
6571
6617
|
let b;
|
|
6572
6618
|
return hasConstructorOf(h, TypesonPromise) ? b = h.then(() => e) : (b = function _revive(e, t, a, s, l) {
|
|
6573
|
-
if (
|
|
6574
|
-
const u =
|
|
6619
|
+
if (m && "$types" === e) return;
|
|
6620
|
+
const u = d.length,
|
|
6575
6621
|
f = n(c, e) ? c[e] : void 0,
|
|
6576
6622
|
h = o(t);
|
|
6577
6623
|
if (h || isPlainObject(t)) {
|
|
@@ -6579,7 +6625,7 @@ class Typeson {
|
|
|
6579
6625
|
for (r(t).forEach(r => {
|
|
6580
6626
|
const n = _revive(e + (e ? "." : "") + escapeKeyPathComponent(r), t[r], a ?? o, o, r),
|
|
6581
6627
|
set = e => (hasConstructorOf(e, Undefined) ? setOwnEnumerable(o, r, void 0) : void 0 !== e && setOwnEnumerable(o, r, e), e);
|
|
6582
|
-
hasConstructorOf(n, TypesonPromise) ?
|
|
6628
|
+
hasConstructorOf(n, TypesonPromise) ? d.push(n.then(e => set(e))) : set(n);
|
|
6583
6629
|
}), t = o; y.length;) {
|
|
6584
6630
|
const [[e, t, r, o]] = y,
|
|
6585
6631
|
a = n(p, t),
|
|
@@ -6603,8 +6649,8 @@ class Typeson {
|
|
|
6603
6649
|
}, t);
|
|
6604
6650
|
return hasConstructorOf(r, TypesonPromise) ? r.then(t => (p[e] = t, t)) : (p[e] = r, r);
|
|
6605
6651
|
};
|
|
6606
|
-
return !i &&
|
|
6607
|
-
}("", e, null),
|
|
6652
|
+
return !i && d.length > u ? TypesonPromise.all(d.slice(u)).then(() => applyType(t)) : applyType(t);
|
|
6653
|
+
}("", e, null), d.length && (b = TypesonPromise.resolve(b).then(e => TypesonPromise.all([e, ...d])).then(([e]) => e))), l && (isThenable(b) ? b = b.then(e => (reHomeSymbolKeys(e), e)) : reHomeSymbolKeys(b)), isThenable(b) ? i && a.throwOnBadSyncType ? (() => {
|
|
6608
6654
|
throw new TypeError("Sync method requested but async result obtained");
|
|
6609
6655
|
})() : hasConstructorOf(b, TypesonPromise) ? b.p.then(checkUndefined) : b : !i && a.throwOnBadSyncType ? (() => {
|
|
6610
6656
|
throw new TypeError("Async method requested but sync result obtained");
|
|
@@ -6719,7 +6765,7 @@ const f = {
|
|
|
6719
6765
|
}
|
|
6720
6766
|
}
|
|
6721
6767
|
},
|
|
6722
|
-
|
|
6768
|
+
m = {
|
|
6723
6769
|
audiodata: {
|
|
6724
6770
|
test: e => "AudioData" === toStringTag(e),
|
|
6725
6771
|
replace(e) {
|
|
@@ -6773,7 +6819,7 @@ const f = {
|
|
|
6773
6819
|
})
|
|
6774
6820
|
}
|
|
6775
6821
|
},
|
|
6776
|
-
|
|
6822
|
+
d = {
|
|
6777
6823
|
bigintObject: {
|
|
6778
6824
|
test: e => "object" == typeof e && hasConstructorOf(e, BigInt),
|
|
6779
6825
|
replace: String,
|
|
@@ -7070,7 +7116,7 @@ const x = {
|
|
|
7070
7116
|
}
|
|
7071
7117
|
}
|
|
7072
7118
|
},
|
|
7073
|
-
|
|
7119
|
+
I = {
|
|
7074
7120
|
error: {
|
|
7075
7121
|
test: e => "Error" === toStringTag(e),
|
|
7076
7122
|
replace: ({
|
|
@@ -7096,9 +7142,9 @@ const x = {
|
|
|
7096
7142
|
}
|
|
7097
7143
|
}
|
|
7098
7144
|
},
|
|
7099
|
-
|
|
7145
|
+
B = {};
|
|
7100
7146
|
function create$2(e) {
|
|
7101
|
-
|
|
7147
|
+
B[e.name.toLowerCase()] = {
|
|
7102
7148
|
test: t => hasConstructorOf(t, e),
|
|
7103
7149
|
replace: ({
|
|
7104
7150
|
name: e,
|
|
@@ -7126,7 +7172,7 @@ function create$2(e) {
|
|
|
7126
7172
|
};
|
|
7127
7173
|
}
|
|
7128
7174
|
[TypeError, RangeError, SyntaxError, ReferenceError, EvalError, URIError].forEach(e => create$2(e)), "undefined" != typeof AggregateError && create$2(AggregateError), "function" == typeof InternalError && create$2(InternalError);
|
|
7129
|
-
const
|
|
7175
|
+
const C = {
|
|
7130
7176
|
file: {
|
|
7131
7177
|
test: e => "File" === toStringTag(e),
|
|
7132
7178
|
replace(e) {
|
|
@@ -7164,7 +7210,7 @@ const I = {
|
|
|
7164
7210
|
}
|
|
7165
7211
|
},
|
|
7166
7212
|
U = {
|
|
7167
|
-
file:
|
|
7213
|
+
file: C.file,
|
|
7168
7214
|
filelist: {
|
|
7169
7215
|
test: e => "FileList" === toStringTag(e),
|
|
7170
7216
|
replace(e) {
|
|
@@ -7190,7 +7236,7 @@ const I = {
|
|
|
7190
7236
|
},
|
|
7191
7237
|
k = {
|
|
7192
7238
|
imagebitmap: {
|
|
7193
|
-
test: e => "ImageBitmap" === toStringTag(e)
|
|
7239
|
+
test: e => "ImageBitmap" === toStringTag(e),
|
|
7194
7240
|
replace(e) {
|
|
7195
7241
|
const t = document.createElement("canvas");
|
|
7196
7242
|
return t.getContext("2d").drawImage(e, 0, 0), {
|
|
@@ -7204,7 +7250,9 @@ const I = {
|
|
|
7204
7250
|
r = t.getContext("2d"),
|
|
7205
7251
|
n = document.createElement("img");
|
|
7206
7252
|
return n.addEventListener("load", function () {
|
|
7207
|
-
|
|
7253
|
+
try {
|
|
7254
|
+
r.drawImage(n, 0, 0);
|
|
7255
|
+
} catch {}
|
|
7208
7256
|
}), n.src = e.dataURL, "undefined" == typeof OffscreenCanvas ? t : t.transferToImageBitmap();
|
|
7209
7257
|
},
|
|
7210
7258
|
reviveAsync(e) {
|
|
@@ -7223,7 +7271,7 @@ const I = {
|
|
|
7223
7271
|
}
|
|
7224
7272
|
}
|
|
7225
7273
|
},
|
|
7226
|
-
|
|
7274
|
+
R = {
|
|
7227
7275
|
imagedata: {
|
|
7228
7276
|
test: e => "ImageData" === toStringTag(e),
|
|
7229
7277
|
replace(e) {
|
|
@@ -7254,14 +7302,14 @@ const I = {
|
|
|
7254
7302
|
}
|
|
7255
7303
|
}
|
|
7256
7304
|
},
|
|
7257
|
-
|
|
7305
|
+
M = {
|
|
7258
7306
|
infinity: {
|
|
7259
7307
|
test: e => e === 1 / 0,
|
|
7260
7308
|
replace: () => "Infinity",
|
|
7261
7309
|
revive: () => 1 / 0
|
|
7262
7310
|
}
|
|
7263
7311
|
},
|
|
7264
|
-
|
|
7312
|
+
L = {
|
|
7265
7313
|
map: {
|
|
7266
7314
|
test: e => "Map" === toStringTag(e),
|
|
7267
7315
|
replace: e => e.entries().toArray(),
|
|
@@ -7282,7 +7330,7 @@ const I = {
|
|
|
7282
7330
|
revive: () => -1 / 0
|
|
7283
7331
|
}
|
|
7284
7332
|
},
|
|
7285
|
-
|
|
7333
|
+
W = {
|
|
7286
7334
|
negativeZero: {
|
|
7287
7335
|
test: e => Object.is(e, -0),
|
|
7288
7336
|
replace: () => 0,
|
|
@@ -7552,13 +7600,13 @@ const te = {
|
|
|
7552
7600
|
revive() {}
|
|
7553
7601
|
}
|
|
7554
7602
|
}],
|
|
7555
|
-
se = [K,
|
|
7556
|
-
ye = [re, te, ae, z, se, A, H,
|
|
7603
|
+
se = [K, M, $, W],
|
|
7604
|
+
ye = [re, te, ae, z, se, A, H, R, k, C, U, b, I, B].concat("function" == typeof Map ? L : [], "function" == typeof Set ? X : [], "function" == typeof ArrayBuffer ? f : [], "function" == typeof Uint8Array ? ee : [], "function" == typeof DataView ? O : [], "undefined" != typeof crypto ? w : [], "undefined" != typeof BigInt ? [h, d] : [], "undefined" != typeof DOMException ? T : [], "undefined" != typeof QuotaExceededError ? J : [], "undefined" != typeof WebTransportError ? oe : [], "undefined" != typeof DOMRect ? N : [], "undefined" != typeof DOMPoint ? P : [], "undefined" != typeof DOMQuad ? E : [], "undefined" != typeof DOMMatrix ? S : [], "undefined" != typeof AudioData ? m : [], "undefined" != typeof EncodedAudioChunk ? x : [], "undefined" != typeof EncodedVideoChunk ? j : [], "undefined" != typeof VideoFrame ? ne : []);
|
|
7557
7605
|
const pe = ye.concat({
|
|
7558
7606
|
checkDataCloneException: {
|
|
7559
7607
|
test(e) {
|
|
7560
7608
|
const t = {}.toString.call(e).slice(8, -1);
|
|
7561
|
-
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) {
|
|
7609
|
+
if (["symbol", "function"].includes(typeof e) || ["Arguments", "Module", "Promise", "WeakMap", "WeakSet", "WeakRef", "FinalizationRegistry", "Generator", "AsyncGenerator", "String Iterator", "Array Iterator", "Map Iterator", "Set Iterator", "RegExp String Iterator", "Intl.Collator", "Intl.DateTimeFormat", "Intl.DisplayNames", "Intl.DurationFormat", "Intl.ListFormat", "Intl.Locale", "Intl.NumberFormat", "Intl.PluralRules", "Intl.RelativeTimeFormat", "Intl.Segmenter", "Event", "MessageChannel", "MessagePort", "ReadableStream", "WritableStream", "TransformStream", "OffscreenCanvas"].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) {
|
|
7562
7610
|
if ("boolean" == typeof e.detached) return e.detached;
|
|
7563
7611
|
if (0 !== e.byteLength) return false;
|
|
7564
7612
|
try {
|
|
@@ -13064,10 +13112,11 @@ function setGlobalVars(idb, initialConfig) {
|
|
|
13064
13112
|
setNonIDBGlobals();
|
|
13065
13113
|
}
|
|
13066
13114
|
}
|
|
13067
|
-
/*
|
|
13115
|
+
/* c8 ignore start -- TS guard */
|
|
13068
13116
|
if (!IDB.shimIndexedDB) {
|
|
13069
13117
|
return;
|
|
13070
13118
|
}
|
|
13119
|
+
/* c8 ignore stop -- TS guard */
|
|
13071
13120
|
IDB.shimIndexedDB.__setConnectionQueueOrigin();
|
|
13072
13121
|
}
|
|
13073
13122
|
};
|
|
@@ -13234,10 +13283,11 @@ const __setGlobalVars = function (idb, initialConfig = {}) {
|
|
|
13234
13283
|
escapeNULForSQLiteStatements: false,
|
|
13235
13284
|
...initialConfig
|
|
13236
13285
|
});
|
|
13237
|
-
/*
|
|
13286
|
+
/* c8 ignore start -- TS guard */
|
|
13238
13287
|
if (!obj.shimIndexedDB) {
|
|
13239
13288
|
return obj;
|
|
13240
13289
|
}
|
|
13290
|
+
/* c8 ignore stop -- TS guard */
|
|
13241
13291
|
obj.shimIndexedDB.__setUnicodeIdentifiers(UnicodeIdentifiers);
|
|
13242
13292
|
return obj;
|
|
13243
13293
|
};
|