indexeddbshim 19.0.3 → 19.0.5

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.
Files changed (35) hide show
  1. package/README.md +1 -6
  2. package/badges/coverage-badge.svg +1 -1
  3. package/badges/tests-badge.svg +1 -1
  4. package/dist/IDBTransaction.d.ts +15 -0
  5. package/dist/IDBTransaction.d.ts.map +1 -1
  6. package/dist/indexeddbshim-Key.js +2 -2
  7. package/dist/indexeddbshim-Key.js.map +1 -1
  8. package/dist/indexeddbshim-Key.min.js +1 -1
  9. package/dist/indexeddbshim-Key.min.js.map +1 -1
  10. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +91 -25
  11. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
  12. package/dist/indexeddbshim-UnicodeIdentifiers.js +89 -24
  13. package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
  14. package/dist/indexeddbshim-UnicodeIdentifiers.min.js +3 -3
  15. package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
  16. package/dist/indexeddbshim-node.cjs +89 -24
  17. package/dist/indexeddbshim-node.cjs.map +1 -1
  18. package/dist/indexeddbshim-noninvasive.js +89 -24
  19. package/dist/indexeddbshim-noninvasive.js.map +1 -1
  20. package/dist/indexeddbshim-noninvasive.min.js +2 -2
  21. package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
  22. package/dist/indexeddbshim.js +89 -24
  23. package/dist/indexeddbshim.js.map +1 -1
  24. package/dist/indexeddbshim.min.js +2 -2
  25. package/dist/indexeddbshim.min.js.map +1 -1
  26. package/dist/node-UnicodeIdentifiers.d.ts.map +1 -1
  27. package/dist/setGlobalVars.d.ts.map +1 -1
  28. package/dist/util.d.ts +0 -6
  29. package/dist/util.d.ts.map +1 -1
  30. package/package.json +22 -18
  31. package/src/CFG.js +1 -1
  32. package/src/IDBTransaction.js +87 -23
  33. package/src/node-UnicodeIdentifiers.js +2 -1
  34. package/src/setGlobalVars.js +2 -1
  35. package/src/util.js +1 -11
@@ -1 +1 @@
1
- {"version":3,"file":"node-UnicodeIdentifiers.d.ts","sourceRoot":"","sources":["../src/node-UnicodeIdentifiers.js"],"names":[],"mappings":";AASA;;;;GAIG;AACH,uCAJW,OAAO,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,kBAC3C,OAAO,CAAC,OAAO,UAAU,EAAE,YAAY,CAAC,GACtC,OAAO,oBAAoB,EAAE,aAAa,GAAC,MAAM,CAe7D"}
1
+ {"version":3,"file":"node-UnicodeIdentifiers.d.ts","sourceRoot":"","sources":["../src/node-UnicodeIdentifiers.js"],"names":[],"mappings":";AASA;;;;GAIG;AACH,uCAJW,OAAO,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,kBAC3C,OAAO,CAAC,OAAO,UAAU,EAAE,YAAY,CAAC,GACtC,OAAO,oBAAoB,EAAE,aAAa,GAAC,MAAM,CAgB7D"}
@@ -1 +1 @@
1
- {"version":3,"file":"setGlobalVars.d.ts","sourceRoot":"","sources":["../src/setGlobalVars.js"],"names":[],"mappings":";;+BAmBW,OAAO,UAAU,EAAE,iBAAiB,GAC1C,OAAO,CAAC,OAAO,UAAU,EAAE,YAAY,CAAC;wBAqChC,CACR,IAAI,EAAE,OAAO,UAAU,EAAE,iBAAiB,KACvC,OAAO,UAAU,EAAE,WAAW;oCAIzB,CAAC,GAAG,EAAE;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAA;CAC1B,KAAK,IAAI;4BAIA,CAAC,UAAU,GAAC,MAAM,CAAC,GAAG;IAC5B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IAChC,WAAW,EAAE,SAAS,CAAC;IACvB,WAAW,EAAE,SAAS,CAAC;IACvB,uBAAuB,EAAE,qBAAqB,CAAC;IAC/C,0BAA0B,EA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AAG;IAC5B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IAChC,WAAW,EAAE,SAAS,CAAC;IACvB,WAAW,EAAE,SAAS,CAAC;IACvB,uBAAuB,EAAE,qBAAqB,CAAC;IAC/C,0BAA0B,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CACtD;sBAIO,MAAM;4BAIN,CAAC,OAAO,UAAU,GAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG;IACtD,SAAS,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAChC,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B;mCA5F+C,mBAAmB;AAoDtE;;;;GAIG;AAEH;;;;;GAKG;AAEH;;;;;;;;;GASG;AAEH;;GAEG;AAEH;;;;;;;;;;;;;GAaG;AAEH;;;;;GAKG;AACH,qCAJW,OAAO,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,kBAC3C,OAAO,CAAC,OAAO,UAAU,EAAE,YAAY,CAAC,GACtC,aAAa,CA2SzB;2BA7Y8C,iBAAiB"}
package/dist/util.d.ts CHANGED
@@ -95,12 +95,6 @@ export function isDate(obj: AnyValue): boolean;
95
95
  * @returns {boolean}
96
96
  */
97
97
  export function isBlob(obj: AnyValue): boolean;
98
- /**
99
- *
100
- * @param {AnyValue} obj
101
- * @returns {boolean}
102
- */
103
- export function isRegExp(obj: AnyValue): boolean;
104
98
  /**
105
99
  *
106
100
  * @param {AnyValue} obj
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.js"],"names":[],"mappings":"sBAKa,MAAM;uBA0PN;IAAC,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAA;CAAC;uBAoTnD,OAAO;AApgBpB;;;;GAIG;AACH,2CAHW,MAAM,GACJ,MAAM,CASlB;AAED;;;GAGG;AACH,4CAHW,MAAM,GACJ,MAAM,CAclB;AAuBD;;;;GAIG;AACH,qDAJW,MAAM,GAEJ,MAAM,CAoClB;AAmBD;;;;GAIG;AACH,uDAHW,MAAM,GACJ,MAAM,CAkClB;AAED;;;GAGG;AACH,6CAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;GAGG;AACH,6CAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;GAGG;AACH,sDAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;GAIG;AACH,mCAHW,MAAM,GACJ,MAAM,CAKlB;AAzID;;;GAGG;AACH,8BAHW,MAAM,GACJ,MAAM,CAIlB;AAqID;;;;;;;;;;;;;GAaG;AACH,+BAJW,MAAM,QACN,MAAM,GACJ,MAAM,CAQlB;AAGD;;GAEG;AAIH;;;;;GAKG;AACH,gCAJW,QAAQ,QACR,QAAQ,GACN,OAAO,CAInB;AAED;;;;GAIG;AACH,2BAHW,QAAQ,GACN,GAAG,IAAI,MAAM,CAIzB;AAED;;;;GAIG;AACH,4BAHW,QAAQ,GACN,OAAO,CAInB;AAED;;;;GAIG;AACH,4BAHW,QAAQ,GACN,OAAO,CAKnB;AAED;;;;GAIG;AACH,8BAHW,QAAQ,GACN,OAAO,CAKnB;AAED;;;;GAIG;AACH,4BAHW,QAAQ,GACN,OAAO,CAKnB;AAED;;;;GAIG;AACH,8BAHW,QAAQ,GACN,OAAO,CAOnB;AAED;;;;GAIG;A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;;;;;GAaG;AACH,uCAHW,MAAM,GACJ,IAAI,CAchB;AAgCD;;;;GAIG;AACH,wCAHW,MAAM,GAAC,MAAM,EAAE,GACb,OAAO,CAWnB;AAED;;;;;GAKG;AACH,qCALW,MAAM,QACN,oBAAoB,GAAC,eAAe,GAElC,MAAM,CAyBlB;AAED;;GAEG;AAEH;;;;GAIG;AACH,sCAJW,QAAQ,gBACR,OAAO,GACL,MAAM,CAIlB;AAcD;;;;GAIG;AACH,gDAHW,QAAQ,GACN,MAAM,GAAC,MAAM,EAAE,CAW3B;AAED;;;GAGG;AACH,6BAHW,QAAQ,GACN,CAAC,IAAI,IAAI,GAAC,SAAS,CAI/B;AA6BD;;;GAGG;AACH,0CAHW,MAAM,IAAI,GACR,IAAI,CAmBhB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "indexeddbshim",
3
- "version": "19.0.3",
3
+ "version": "19.0.5",
4
4
  "type": "module",
5
5
  "author": "Parashuram <code@nparashuram.com>",
6
6
  "contributors": [
@@ -43,13 +43,13 @@
43
43
  "watch": "chokidar \"src/*\" \"node_modules/eventtarget/EventTarget.js\" \"node_modules/websql/lib/websql/WebSQLTransaction.js\" \"node_modules/websql/lib/websql/WebSQLDatabase.js\" -c \"npm run rollup\"",
44
44
  "dev": "run-p start watch",
45
45
  "clean": "run-p clean-sysDB clean-mocha clean-fake clean-mock clean-w3c clean-w3cOld",
46
- "clean-sysDB": "rimraf __sysdb__*",
46
+ "clean-sysDB": "rimraf --glob __sysdb__*",
47
47
  "clean-polyfill": "run-p clean-fake clean-mock clean-w3cOld clean-sysDB",
48
- "clean-mocha": "rimraf D_indexeddbshim_test_database_* D_test.sqlite",
49
- "clean-fake": "rimraf D_test0.*",
50
- "clean-mock": "rimraf D_test_database*",
51
- "clean-w3c": "rimraf D_opaque* D_inbox* D_output* D_*_bucket_* D_^D^B2* D_db* D_test* D_about* D_^I^D^B* D_blank* D_database_name* D_idbtransaction* D_x D_x.sqlite D_y D_y.sqlite D_webworker* D_http*",
52
- "clean-w3cOld": "rimraf D_db.sqlite* D_test* D_database_name* D_idbtransaction*",
48
+ "clean-mocha": "rimraf --glob D_indexeddbshim_test_database_* D_test.sqlite",
49
+ "clean-fake": "rimraf --glob D_test0.*",
50
+ "clean-mock": "rimraf --glob D_test_database*",
51
+ "clean-w3c": "rimraf --glob D_opaque* D_inbox* D_output* D_*_bucket_* D_^D^B2* D_db* D_test* D_about* D_^I^D^B* D_blank* D_database_name* D_idbtransaction* D_x D_x.sqlite D_y D_y.sqlite D_webworker* D_http* && npm run clean-sysDB",
52
+ "clean-w3cOld": "rimraf --glob D_db.sqlite* D_test* D_database_name* D_idbtransaction*",
53
53
  "clean-w3c-built": "rimraf test-support/js",
54
54
  "copy": "copyup node_modules/source-map-support/browser-source-map-support.js node_modules/mocha/mocha.css node_modules/mocha/mocha.js node_modules/chai/chai.js node_modules/sinon/pkg/sinon-no-sourcemaps.js test-support",
55
55
  "fix-permissions": "chmod +x node_modules/npm-run-all/bin/*/index.js",
@@ -63,22 +63,25 @@
63
63
  "tests-polyfill": "run-s clean-polyfill coverage:fake coverage:mock coverage:w3cOld",
64
64
  "mocha": "run-s clean-mocha coverage:mocha clean-mocha",
65
65
  "rollup": "rollup -c",
66
- "coverage:fake": "c8 --silent --no-clean mocha --reporter-options configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+fake --require source-map-support/register tests-polyfill/fakeIndexedDB/test-node.js",
67
- "coverage:mock": "c8 --silent --no-clean mocha --reporter-options configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+mock --require source-map-support/register tests-polyfill/indexedDBmock/test-node.js",
68
- "coverage:w3cOld": "c8 --silent --no-clean mocha --reporter-options configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+w3c --require source-map-support/register tests-polyfill/w3c/test-node.js",
69
- "coverage:w3c": "NODE_OPTIONS=--max_old_space_size=16384 c8 --silent --no-clean npm run w3c-test-only",
66
+ "coverage:fake": "c8 --temp-directory coverage/fake --reporter=none --no-clean mocha --reporter-options configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+fake --require source-map-support/register tests-polyfill/fakeIndexedDB/test-node.js",
67
+ "coverage:mock": "c8 --temp-directory coverage/mock --reporter=none --no-clean mocha --reporter-options configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+mock --require source-map-support/register tests-polyfill/indexedDBmock/test-node.js",
68
+ "coverage:w3cOld": "c8 --reporter=none --no-clean mocha --reporter-options configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+w3c --require source-map-support/register tests-polyfill/w3c/test-node.js",
69
+ "coverage:w3c:test": "npm run delay && NODE_OPTIONS=--max_old_space_size=16384 c8 --temp-directory coverage/w3c --reporter=none --no-clean npm run w3c-test-only && npm run stop",
70
+ "coverage:w3c": "npm run clean-w3c && run-p -r wpt coverage:w3c:test",
70
71
  "test:w3c": "NODE_OPTIONS=--max_old_space_size=16384 NODE_OPTIONS=--trace-warnings node test-support/node-idb-test.js",
71
72
  "w3c-test-only": "NODE_OPTIONS=--max_old_space_size=16384 node --trace-warnings test-support/node-idb-test.js",
72
- "coverage:mocha": "c8 --silent --no-clean mocha --reporter-options configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+mocha --require source-map-support/register tests-mocha/test-node.js",
73
+ "coverage:mocha": "c8 --temp-directory coverage/mocha --reporter=none --no-clean mocha --reporter-options configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+mocha --require source-map-support/register tests-mocha/test-node.js",
73
74
  "coverage-badge": "coveradge badges/coverage-badge",
74
- "coverage:report-only": "c8 report",
75
- "coverage:report": "run-s coverage:report-only",
75
+ "coverage:copy": "cp -r coverage/fake/. coverage/combined/ && cp -r coverage/mock/. coverage/combined/ && cp -r coverage/mocha/. coverage/combined/ && cp -r coverage/w3c/. coverage/combined/",
76
+ "coverage:report-only": "c8 report --temp-directory coverage/combined",
77
+ "coverage:report": "run-s coverage:copy coverage:report-only",
76
78
  "remove-cache": "rimraf node_modules/.cache",
77
79
  "remove-cov": "rimraf .nyc_output ",
78
- "remove-results": "rimraf test-support/results/file*.json",
80
+ "remove-results": "rimraf --glob test-support/results/file*.json",
79
81
  "coverage:polyfill": "run-s coverage:fake coverage:mock coverage:w3cOld",
80
82
  "tests-badge": "mbg --fileGlob \"./test-support/results/file*.json\" --badge_output badges/tests-badge.svg",
81
- "coverage": "run-s -c clean remove-cache remove-cov remove-results coverage:fake coverage:mock coverage:mocha coverage:w3c clean tests-badge coverage-badge coverage:report",
83
+ "coverage": "run-s -c stop clean coverage:empty remove-cache remove-cov remove-results coverage:fake coverage:mock coverage:mocha coverage:w3c clean tests-badge coverage:report coverage-badge",
84
+ "coverage:empty": "rimraf coverage/combined coverage/fake coverage/mock coverage/mocha coverage/w3c && mkdir -p coverage/combined",
82
85
  "open-coverage-only": "open http://127.0.0.1:9999/coverage/lcov-report/",
83
86
  "open-coverage": "run-p start open-coverage-only",
84
87
  "test": "run-s lint coverage",
@@ -90,7 +93,8 @@
90
93
  "web-platform-tests": "cd web-platform-tests && ./wpt serve",
91
94
  "stop-server": "pkill -f \"static -p 9999\" || true",
92
95
  "stop-wpt": "pkill -f \"wpt serve\" || true",
93
- "stop": "run-s stop-server stop-wpt",
96
+ "stop-ports": "kill -9 $(lsof -ti tcp:8000,8443,8444,9000,9999) 2>/dev/null || true",
97
+ "stop": "run-s stop-server stop-wpt stop-ports",
94
98
  "w3c-find-unused": "node test-support/find-unused.js",
95
99
  "w3c": "run-s w3c-test",
96
100
  "w3c-add-wrap": "node test-support/wrap-w3c-tests",
@@ -187,7 +191,7 @@
187
191
  "@types/websql": "^0.0.30",
188
192
  "@unicode/unicode-17.0.0": "^2.0.7",
189
193
  "babel-plugin-add-module-exports": "1.0.4",
190
- "bson": "^7.3.2",
194
+ "bson": "^7.3.3",
191
195
  "builtin-modules": "^5.3.0",
192
196
  "c8": "^12.0.0",
193
197
  "chai": "6.2.2",
package/src/CFG.js CHANGED
@@ -106,7 +106,7 @@ const CFG = /** @type {ConfigValues} */ ({});
106
106
  // In the non-Unicode builds, defaults to /[$0-9A-Z_a-z]/
107
107
  'UnicodeIDContinue',
108
108
 
109
- // Used by SCA.js for optional restructuring of typeson-registry
109
+ // Used by Sca.js for optional restructuring of typeson-registry
110
110
  // Structured Cloning Algorithm; should only be needed for ensuring data
111
111
  // created in 3.* versions of IndexedDBShim continue to work; see the
112
112
  // library `typeson-registry-sca-reverter` to get a function to do this
@@ -56,6 +56,7 @@ const readonlyProperties = ['objectStoreNames', 'mode', 'durability', 'db', 'err
56
56
  * __requestsFinished: boolean,
57
57
  * __transFinishedCb: (err: boolean, cb: ((bool?: boolean) => void)) => void,
58
58
  * __callTransFinishedCb: (err: boolean, cb: ((bool?: boolean) => void)) => void,
59
+ * __usesStandardDriver: () => boolean,
59
60
  * __transactionEndCallback: (() => void)|undefined,
60
61
  * __transactionFinished: boolean,
61
62
  * __completed: boolean,
@@ -192,6 +193,29 @@ IDBTransaction.prototype.__transFinishedCb = function (err, cb) {
192
193
  cb(Boolean(err));
193
194
  };
194
195
 
196
+ /**
197
+ * A standard (3-argument) `transaction()`/`readTransaction()` implementation
198
+ * (browser WebSQL, `cordova-plugin-sqlite-2`, etc.) never invokes the
199
+ * non-standard 4th callback that installs the real `__transFinishedCb`,
200
+ * and finalizes its own underlying SQL transaction synchronously, as soon
201
+ * as it sees no further `executeSql` call already in flight or queued --
202
+ * with no way for it to know a JS-level continuation (e.g. an
203
+ * `await`-deferred follow-up request) is still coming. Detected via
204
+ * arity, checking whichever of the two methods this transaction's own
205
+ * mode actually uses.
206
+ * @this {IDBTransactionFull}
207
+ * @returns {boolean}
208
+ */
209
+ IDBTransaction.prototype.__usesStandardDriver = function () {
210
+ const me = this;
211
+ const dbConn = me.db && me.db.__db;
212
+ const dbMethodName = me.mode === 'readonly' ? 'readTransaction' : 'transaction';
213
+ const supportsNonstandardTransCb = Boolean(
214
+ dbConn && typeof dbConn[dbMethodName] === 'function' && dbConn[dbMethodName].length >= 4
215
+ );
216
+ return !supportsNonstandardTransCb;
217
+ };
218
+
195
219
  /**
196
220
  * In Node, the real (SQL-commit-capable) `__transFinishedCb` is only
197
221
  * installed once the underlying WebSQL driver's own SQL-queue-idle check
@@ -226,19 +250,11 @@ IDBTransaction.prototype.__callTransFinishedCb = function (err, cb) {
226
250
  return;
227
251
  }
228
252
  if (me.__transFinishedCb === IDBTransaction.prototype.__transFinishedCb) {
229
- // Standard (3-argument) `transaction()`/`readTransaction()` implementations
230
- // (browser WebSQL, `cordova-plugin-sqlite-2`, etc.) never invoke the
231
- // non-standard 4th callback that installs the real `__transFinishedCb`,
232
- // so waiting for it here would defer forever. Detect that via arity
233
- // (checking whichever of the two methods this transaction's own mode
234
- // actually uses -- see `__executeRequests`) and, if it's not supported,
235
- // just call the default (the driver auto-commits on its own).
236
- const dbConn = me.db && me.db.__db;
237
- const dbMethodName = me.mode === 'readonly' ? 'readTransaction' : 'transaction';
238
- const supportsNonstandardTransCb = Boolean(
239
- dbConn && typeof dbConn[dbMethodName] === 'function' && dbConn[dbMethodName].length >= 4
240
- );
241
- if (!supportsNonstandardTransCb) {
253
+ // Waiting here for the non-standard 4th callback to install the real
254
+ // `__transFinishedCb` would defer forever on a standard driver, which
255
+ // never invokes it -- call the default instead (the driver auto-commits
256
+ // on its own).
257
+ if (me.__usesStandardDriver()) {
242
258
  me.__transFinishedCbFired = true;
243
259
  me.__transFinishedCb(err, cb);
244
260
  return;
@@ -276,10 +292,56 @@ IDBTransaction.prototype.__executeRequests = function () {
276
292
  me.db.__db[me.mode === 'readonly' ? 'readTransaction' : 'transaction']( // `readTransaction` is optimized, at least in `node-websql`
277
293
  function executeRequests (tx) {
278
294
  me.__tx = tx;
295
+ const isStandardDriver = me.__usesStandardDriver();
279
296
  /** @type {RequestInfo} */
280
297
  let q,
281
298
  i = -1;
282
299
 
300
+ // On a standard driver, `keepAliveAndWait` issues a SQL query, which
301
+ // is a macrotask. Otherwise it issues ten microtasks.
302
+ const keepAliveAttempts = isStandardDriver ? 1 : 10;
303
+
304
+ /**
305
+ * A continuation that must still be able to observe the
306
+ * transaction as safe to extend (e.g., re-checking whether an
307
+ * `await`-based follow-up request has arrived yet, or giving a
308
+ * same-tick microtask scheduled from a handler a chance to run
309
+ * first) can normally just be deferred via `queueMicrotask`.
310
+ * That alone isn't safe on a standard (3-argument) driver,
311
+ * though: it finalizes its own underlying SQL transaction
312
+ * synchronously, as soon as it sees no further `executeSql`
313
+ * call already in flight or queued, and a microtask hop by
314
+ * itself never issues one -- so the driver already considers
315
+ * the transaction done by the time the deferred continuation
316
+ * runs, silently dropping whatever it tries to do next. Issuing
317
+ * a harmless `SELECT 1` instead keeps the driver's own queue
318
+ * non-empty across that same gap, at the cost of a real SQL
319
+ * round trip; Node's driver doesn't need this since its real
320
+ * commit/rollback is already deferred separately, via
321
+ * `nonstandardTransCb`.
322
+ * @param {() => void} cb
323
+ * @returns {void}
324
+ */
325
+ function keepAliveAndWait (cb) {
326
+ if (!isStandardDriver) {
327
+ queueMicrotask(cb);
328
+ return;
329
+ }
330
+ try {
331
+ tx.executeSql('SELECT 1', [], function () {
332
+ cb();
333
+ }, function () {
334
+ cb();
335
+ return false; // Don't roll back the transaction over a keep-alive no-op
336
+ });
337
+ } catch (err) {
338
+ // The driver has already finalized the transaction (or otherwise
339
+ // rejected the call) -- nothing left to hold open. We explicitly
340
+ // abort the transaction here.
341
+ me.__abortTransaction(/** @type {Error|DOMException} */ (err));
342
+ }
343
+ }
344
+
283
345
  /**
284
346
  * @typedef {unknown} IDBRequestResult
285
347
  */
@@ -462,9 +524,9 @@ IDBTransaction.prototype.__executeRequests = function () {
462
524
  * from a microtask -- so if the JS-level queue is merely found
463
525
  * empty here, that doesn't yet mean no more work is coming, only
464
526
  * that none has been queued *yet*. Re-check across a small, bounded
465
- * number of further microtask turns (letting a typical `await`
466
- * chain like `await store.put(...); await store.get(...)` catch
467
- * up) before finally concluding the transaction is genuinely done.
527
+ * number of further turns (see `keepAliveAndWait`, letting a typical
528
+ * `await` chain like `await store.put(...); await store.get(...)`
529
+ * catch up) before finally concluding the transaction is genuinely done.
468
530
  * Applies to `readonly` transactions too, not just `readwrite`/
469
531
  * `versionchange`: a `readonly` transaction's `complete` event
470
532
  * can otherwise fire synchronously, immediately after its last
@@ -472,9 +534,11 @@ IDBTransaction.prototype.__executeRequests = function () {
472
534
  * consumer of that same handler (e.g. one that resolves a
473
535
  * promise from within `onsuccess` and only attaches `oncomplete`
474
536
  * afterward) ever gets a turn to run, so it can miss `complete`
475
- * entirely. `readonly` requests don't hold a real SQL
476
- * transaction open, though, so there's no file-lock/connection
477
- * collision risk in waiting the same bounded amount here.
537
+ * afterward) ever gets a turn to run, so it can miss `complete`
538
+ * entirely. On a non-standard driver, `readonly` requests don't hold
539
+ * a real SQL transaction open, so there's no file-lock/connection
540
+ * collision risk. On a standard driver, the wait now issues real SQL
541
+ * inside the read transaction, so this does carry a slight risk.
478
542
  * @param {number} attemptsLeft
479
543
  * @returns {void}
480
544
  */
@@ -494,7 +558,7 @@ IDBTransaction.prototype.__executeRequests = function () {
494
558
  }
495
559
  return;
496
560
  }
497
- queueMicrotask(() => {
561
+ keepAliveAndWait(() => {
498
562
  checkQueueEntry(attemptsLeft - 1);
499
563
  });
500
564
  }
@@ -509,7 +573,7 @@ IDBTransaction.prototype.__executeRequests = function () {
509
573
  }
510
574
  i++;
511
575
  if (i >= me.__requests.length) {
512
- checkQueueEntry(10);
576
+ checkQueueEntry(keepAliveAttempts);
513
577
  return;
514
578
  }
515
579
  runQueuedRequest();
@@ -546,10 +610,10 @@ IDBTransaction.prototype.__executeRequests = function () {
546
610
  }
547
611
  i++;
548
612
  if (i >= me.__requests.length) {
549
- checkQueueEntry(10);
613
+ checkQueueEntry(keepAliveAttempts);
550
614
  return;
551
615
  }
552
- queueMicrotask(() => {
616
+ keepAliveAndWait(() => {
553
617
  if (me.__errored || me.__requestsFinished) {
554
618
  return;
555
619
  }
@@ -18,10 +18,11 @@ const __setGlobalVars = function (idb, initialConfig = {}) {
18
18
  escapeNULForSQLiteStatements: false,
19
19
  ...initialConfig
20
20
  });
21
- /* istanbul ignore next -- TS guard */
21
+ /* c8 ignore start -- TS guard */
22
22
  if (!obj.shimIndexedDB) {
23
23
  return obj;
24
24
  }
25
+ /* c8 ignore stop -- TS guard */
25
26
  obj.shimIndexedDB.__setUnicodeIdentifiers(UnicodeIdentifiers);
26
27
 
27
28
  return obj;
@@ -290,10 +290,11 @@ function setGlobalVars (idb, initialConfig) {
290
290
  setNonIDBGlobals();
291
291
  }
292
292
  }
293
- /* istanbul ignore next -- TS guard */
293
+ /* c8 ignore start -- TS guard */
294
294
  if (!IDB.shimIndexedDB) {
295
295
  return;
296
296
  }
297
+ /* c8 ignore stop -- TS guard */
297
298
  IDB.shimIndexedDB.__setConnectionQueueOrigin();
298
299
  }
299
300
  };
package/src/util.js CHANGED
@@ -296,16 +296,6 @@ function isBlob (obj) {
296
296
  'slice' in obj && typeof obj.slice === 'function' && !('lastModified' in obj);
297
297
  }
298
298
 
299
- /**
300
- *
301
- * @param {AnyValue} obj
302
- * @returns {boolean}
303
- */
304
- function isRegExp (obj) {
305
- return isObj(obj) && 'flags' in obj && typeof obj.flags === 'string' &&
306
- 'exec' in obj && typeof obj.exec === 'function';
307
- }
308
-
309
299
  /**
310
300
  *
311
301
  * @param {AnyValue} obj
@@ -664,7 +654,7 @@ export {escapeSQLiteStatement, unescapeSQLiteResponse,
664
654
  escapeStoreNameForSQL, escapeIndexNameForSQL, escapeIndexNameForSQLKeyColumn,
665
655
  sqlLIKEEscape, sqlQuote, joinPath,
666
656
  instanceOf,
667
- isObj, isDate, isBlob, isRegExp, isFile, isBinary, isIterable,
657
+ isObj, isDate, isBlob, isFile, isBinary, isIterable,
668
658
  defineOuterInterface, defineReadonlyOuterInterface,
669
659
  defineListenerProperties, defineReadonlyProperties,
670
660
  setOperationNames,