indexeddbshim 19.0.5 → 19.0.7

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 (62) hide show
  1. package/README.md +2 -0
  2. package/badges/coverage-badge.svg +1 -1
  3. package/badges/tests-badge.svg +1 -1
  4. package/dist/CFG.d.ts +1 -1
  5. package/dist/CFG.d.ts.map +1 -1
  6. package/dist/DOMException.d.ts.map +1 -1
  7. package/dist/IDBCursor.d.ts.map +1 -1
  8. package/dist/IDBDatabase.d.ts.map +1 -1
  9. package/dist/IDBFactory.d.ts +1 -2
  10. package/dist/IDBFactory.d.ts.map +1 -1
  11. package/dist/IDBIndex.d.ts +2 -6
  12. package/dist/IDBIndex.d.ts.map +1 -1
  13. package/dist/IDBKeyRange.d.ts.map +1 -1
  14. package/dist/IDBObjectStore.d.ts.map +1 -1
  15. package/dist/IDBRecord.d.ts.map +1 -1
  16. package/dist/IDBRequest.d.ts.map +1 -1
  17. package/dist/IDBTransaction.d.ts.map +1 -1
  18. package/dist/Key.d.ts.map +1 -1
  19. package/dist/Sca.d.ts.map +1 -1
  20. package/dist/indexeddbshim-Key.js +73 -33
  21. package/dist/indexeddbshim-Key.js.map +1 -1
  22. package/dist/indexeddbshim-Key.min.js +2 -2
  23. package/dist/indexeddbshim-Key.min.js.map +1 -1
  24. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +543 -221
  25. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
  26. package/dist/indexeddbshim-UnicodeIdentifiers.js +572 -249
  27. package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
  28. package/dist/indexeddbshim-UnicodeIdentifiers.min.js +3 -3
  29. package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
  30. package/dist/indexeddbshim-node.cjs +543 -221
  31. package/dist/indexeddbshim-node.cjs.map +1 -1
  32. package/dist/indexeddbshim-noninvasive.js +572 -249
  33. package/dist/indexeddbshim-noninvasive.js.map +1 -1
  34. package/dist/indexeddbshim-noninvasive.min.js +3 -3
  35. package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
  36. package/dist/indexeddbshim.js +572 -249
  37. package/dist/indexeddbshim.js.map +1 -1
  38. package/dist/indexeddbshim.min.js +3 -3
  39. package/dist/indexeddbshim.min.js.map +1 -1
  40. package/dist/nodeWebSQL.d.ts.map +1 -1
  41. package/dist/setGlobalVars.d.ts +1 -1
  42. package/dist/setGlobalVars.d.ts.map +1 -1
  43. package/dist/util.d.ts.map +1 -1
  44. package/licenseInfo.json +8 -0
  45. package/package.json +106 -102
  46. package/src/CFG.js +18 -4
  47. package/src/DOMException.js +6 -0
  48. package/src/DOMStringList.js +3 -0
  49. package/src/IDBCursor.js +36 -3
  50. package/src/IDBDatabase.js +26 -10
  51. package/src/IDBFactory.js +105 -5
  52. package/src/IDBIndex.js +49 -32
  53. package/src/IDBKeyRange.js +8 -7
  54. package/src/IDBObjectStore.js +25 -2
  55. package/src/IDBRecord.js +2 -0
  56. package/src/IDBRequest.js +7 -4
  57. package/src/IDBTransaction.js +97 -26
  58. package/src/Key.js +53 -22
  59. package/src/Sca.js +9 -4
  60. package/src/nodeWebSQL.js +1 -0
  61. package/src/setGlobalVars.js +86 -77
  62. package/src/util.js +5 -6
@@ -1 +1 @@
1
- {"version":3,"file":"nodeWebSQL.d.ts","sourceRoot":"","sources":["../src/nodeWebSQL.js"],"names":[],"mappings":";qCAKa;IACR,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,CAAA,OAAO,cAAc,EAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA;CACjD;;;;;;;;;;;wCAYS,KACR,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,kDAAkD,EAAE,qBAAqB,KACpF,sBAAsB;AAgC9B,qHAAsK;2BAtD3I,kDAAkD"}
1
+ {"version":3,"file":"nodeWebSQL.d.ts","sourceRoot":"","sources":["../src/nodeWebSQL.js"],"names":[],"mappings":";qCAKa;IACR,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,CAAA,OAAO,cAAc,EAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA;CACjD;;;;;;;;;;;wCAYS,KACR,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,kDAAkD,EAAE,qBAAqB,KACpF,sBAAsB;AAiC9B,qHAAsK;2BAvD3I,kDAAkD"}
@@ -1,6 +1,6 @@
1
1
  export { createDOMException };
2
2
  export default setGlobalVars;
3
- export type SetConfig = (prop: import("./CFG.js").KeyofConfigValues | Partial<import("./CFG.js").ConfigValues>, val?: import("./CFG.js").ConfigValue | undefined) => any;
3
+ export type SetConfig = (prop: import("./CFG.js").KeyofConfigValues | Partial<import("./CFG.js").ConfigValues>, val?: import("./CFG.js").ConfigValue) => any;
4
4
  export type GetConfig = (prop: import("./CFG.js").KeyofConfigValues) => import("./CFG.js").ConfigValue;
5
5
  export type SetUnicodeIdentifiers = (cfg: {
6
6
  UnicodeIDStart: string;
@@ -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,qBAAq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AQ,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"}
@@ -0,0 +1,8 @@
1
+ {
2
+ "bundledRootPackages": [
3
+ "mocha", "chai", "sinon", "source-map-support",
4
+ "web-platform-tests"
5
+ ],
6
+ "filesByLicense": {
7
+ }
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "indexeddbshim",
3
- "version": "19.0.5",
3
+ "version": "19.0.7",
4
4
  "type": "module",
5
5
  "author": "Parashuram <code@nparashuram.com>",
6
6
  "contributors": [
@@ -15,6 +15,11 @@
15
15
  "json-summary",
16
16
  "lcov"
17
17
  ],
18
+ "check-coverage": true,
19
+ "lines": 100,
20
+ "statements": 100,
21
+ "functions": 100,
22
+ "branches": 100,
18
23
  "exclude": [
19
24
  "node_modules/**",
20
25
  "IndexedDBShim/node_modules/**",
@@ -28,92 +33,6 @@
28
33
  "test-support/**"
29
34
  ]
30
35
  },
31
- "scripts": {
32
- "prepublishOnly": "npm run license-badges && npm run build",
33
- "attw": "attw --pack . --profile node16",
34
- "tsc": "tsc",
35
- "tsc-prod": "tsc -p tsconfig-prod.json",
36
- "tsc:ts7": "npx -y -p typescript@^7 -c \"tsc\"",
37
- "tsc-prod:ts7": "npx -y typescript@^7 tsc -p tsconfig-prod.json",
38
- "build": "rm -R dist && npm run tsc-prod && npm run rollup",
39
- "license-badge": "license-badger --corrections --uncategorizedLicenseTemplate \"\\${license} (\\${name} (\\${version}))\" --filteredTypes=nonempty --textTemplate \"License types\n(project, deps, and bundled devDeps)\" --packageJson --production badges/licenses-badge.svg",
40
- "license-badge-dev": "license-badger --corrections --filteredTypes=nonempty --textTemplate \"License types\n(all devDeps)\" --allDevelopment badges/licenses-badge-dev.svg",
41
- "license-badges": "run-p license-badge license-badge-dev",
42
- "start": "static -p 9999 -H '{\"Access-Control-Allow-Origin\": \"http://web-platform.test:8000\", \"Access-Control-Allow-Methods\": \"GET\", \"Access-Control-Allow-Headers\": \"Content-Type\"}'",
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
- "dev": "run-p start watch",
45
- "clean": "run-p clean-sysDB clean-mocha clean-fake clean-mock clean-w3c clean-w3cOld",
46
- "clean-sysDB": "rimraf --glob __sysdb__*",
47
- "clean-polyfill": "run-p clean-fake clean-mock clean-w3cOld clean-sysDB",
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
- "clean-w3c-built": "rimraf test-support/js",
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
- "fix-permissions": "chmod +x node_modules/npm-run-all/bin/*/index.js",
56
- "lint": "eslint .",
57
- "eslint": "npm run lint --",
58
- "w3c-build-only": "node test-support/node-buildjs",
59
- "w3c-build": "run-s clean-w3c clean-w3c-built w3c-build-only",
60
- "fake": "run-s clean-fake coverage:fake clean-fake",
61
- "mock": "run-s clean-mock coverage:mock clean-mock",
62
- "w3c-old": "run-s clean-w3cOld coverage:w3cOld clean-w3cOld",
63
- "tests-polyfill": "run-s clean-polyfill coverage:fake coverage:mock coverage:w3cOld",
64
- "mocha": "run-s clean-mocha coverage:mocha clean-mocha",
65
- "rollup": "rollup -c",
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",
71
- "test:w3c": "NODE_OPTIONS=--max_old_space_size=16384 NODE_OPTIONS=--trace-warnings node test-support/node-idb-test.js",
72
- "w3c-test-only": "NODE_OPTIONS=--max_old_space_size=16384 node --trace-warnings test-support/node-idb-test.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",
74
- "coverage-badge": "coveradge badges/coverage-badge",
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",
78
- "remove-cache": "rimraf node_modules/.cache",
79
- "remove-cov": "rimraf .nyc_output ",
80
- "remove-results": "rimraf --glob test-support/results/file*.json",
81
- "coverage:polyfill": "run-s coverage:fake coverage:mock coverage:w3cOld",
82
- "tests-badge": "mbg --fileGlob \"./test-support/results/file*.json\" --badge_output badges/tests-badge.svg",
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",
85
- "open-coverage-only": "open http://127.0.0.1:9999/coverage/lcov-report/",
86
- "open-coverage": "run-p start open-coverage-only",
87
- "test": "run-s lint coverage",
88
- "submodules-init": "git submodule update --init --recursive",
89
- "submodules-fetch": "git submodule foreach --recursive git fetch",
90
- "submodules-merge": "git submodule foreach git merge origin master",
91
- "submodules": "run-s submodules-init submodules-fetch submodules-merge",
92
- "wpt": "run-p start web-platform-tests",
93
- "web-platform-tests": "cd web-platform-tests && ./wpt serve",
94
- "stop-server": "pkill -f \"static -p 9999\" || true",
95
- "stop-wpt": "pkill -f \"wpt serve\" || true",
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",
98
- "w3c-find-unused": "node test-support/find-unused.js",
99
- "w3c": "run-s w3c-test",
100
- "w3c-add-wrap": "node test-support/wrap-w3c-tests",
101
- "w3c-remove-wrap": "node test-support/wrap-w3c-tests remove",
102
- "w3c-wrap": "node test-support/wrap-w3c-tests",
103
- "test-and-start:w3c": "run-p -r start web-platform-tests delayed-w3c-test",
104
- "delay": "delay 9",
105
- "delayed-w3c-test": "run-s delay w3c-build-only test:w3c",
106
- "w3c-test": "run-s clean-w3c test-and-start:w3c",
107
- "w3c-good-only": "NODE_OPTIONS=--max_old_space_size=16384 node test-support/node-idb-test.js good",
108
- "w3c-bad-only": "NODE_OPTIONS=--max_old_space_size=16384 node test-support/node-idb-test.js bad",
109
- "w3c-good-worker-only": "NODE_OPTIONS=--max_old_space_size=16384 node test-support/node-idb-test.js good-worker",
110
- "w3c-good": "run-s w3c-build w3c-good-only clean-w3c",
111
- "w3c-bad": "run-s w3c-build w3c-bad-only clean-w3c",
112
- "w3c-good-test": "run-s w3c-good-only clean-w3c",
113
- "w3c-bad-test": "run-s w3c-bad-only clean-w3c",
114
- "w3c-any-workers-only": "NODE_OPTIONS=--max_old_space_size=16384 node test-support/node-idb-test.js any-workers",
115
- "w3c-non-workers-only": "NODE_OPTIONS=--max_old_space_size=16384 node --trace-warnings test-support/node-idb-test.js"
116
- },
117
36
  "repository": {
118
37
  "type": "git",
119
38
  "url": "https://github.com/indexeddbshim/IndexedDBShim"
@@ -170,29 +89,29 @@
170
89
  "node": "^22.18.0 || >= 24.11.0"
171
90
  },
172
91
  "dependencies": {
173
- "@node-static/node-static": "^0.9.2",
92
+ "@node-static/node-static": "^0.10.0",
174
93
  "canvas": "^3.2.3",
175
- "eventtargeter": "0.12.0",
94
+ "eventtargeter": "0.12.1",
176
95
  "sync-promise-expanded": "^2.0.0",
177
96
  "typeson": "10.3.0",
178
- "typeson-registry": "14.7.0",
179
- "websql-configurable": "^4.0.0"
97
+ "typeson-registry": "15.0.0",
98
+ "websql-configurable": "^4.1.0"
180
99
  },
181
100
  "devDependencies": {
182
101
  "@arethetypeswrong/cli": "^0.18.5",
183
- "@babel/core": "^8.0.5",
184
- "@babel/preset-env": "^8.0.5",
102
+ "@babel/core": "^8.0.6",
103
+ "@babel/preset-env": "^8.0.6",
185
104
  "@es-joy/json-file-reporter": "^2.0.0",
186
105
  "@rollup/plugin-babel": "^7.1.0",
187
106
  "@rollup/plugin-commonjs": "^29.0.3",
188
107
  "@rollup/plugin-node-resolve": "^16.0.3",
189
108
  "@rollup/plugin-terser": "^1.0.0",
190
- "@types/node": "^26.5.1",
109
+ "@types/node": "^26.6.2",
191
110
  "@types/websql": "^0.0.30",
192
111
  "@unicode/unicode-17.0.0": "^2.0.7",
193
112
  "babel-plugin-add-module-exports": "1.0.4",
194
113
  "bson": "^7.3.3",
195
- "builtin-modules": "^5.3.0",
114
+ "builtin-modules": "^5.4.0",
196
115
  "c8": "^12.0.0",
197
116
  "chai": "6.2.2",
198
117
  "chokidar-cli": "^3.0.0",
@@ -200,21 +119,21 @@
200
119
  "copyfiles": "^2.4.1",
201
120
  "coveradge": "^0.9.0",
202
121
  "delay-cli": "^3.0.0",
203
- "eslint": "^10.10.0",
204
- "eslint-config-ash-nazg": "^43.1.10",
122
+ "eslint": "^10.11.0",
123
+ "eslint-config-ash-nazg": "^43.2.2",
205
124
  "globals": "^17.12.0",
206
125
  "is-date-object": "1.1.0",
207
126
  "isomorphic-fetch": "^3.0.0",
208
- "jsdom": "^30.0.1",
127
+ "jsdom": "^30.1.0",
209
128
  "license-badger": "^0.23.1",
210
- "local-xmlhttprequest": "4.0.0",
211
- "mocha": "^12.0.1",
129
+ "local-xmlhttprequest": "4.0.1",
130
+ "mocha": "^12.0.2",
212
131
  "mocha-badge-generator": "^0.13.0",
213
132
  "mocha-multi-reporters": "1.5.2",
214
133
  "npm-run-all": "^4.1.5",
215
134
  "open-cli": "^9.0.0",
216
135
  "rimraf": "^6.1.3",
217
- "rollup": "^4.63.3",
136
+ "rollup": "^4.63.4",
218
137
  "rollup-plugin-filesize": "^10.0.0",
219
138
  "sinon": "^22.1.0",
220
139
  "source-map-support": "0.5.21",
@@ -229,5 +148,90 @@
229
148
  "unrs-resolver@1.12.2": true,
230
149
  "better-sqlite3@13.0.3": true,
231
150
  "is-hidden-file@1.1.2": true
151
+ },
152
+ "scripts": {
153
+ "attw": "attw --pack . --profile node16",
154
+ "tsc": "tsc",
155
+ "tsc-prod": "tsc -p tsconfig-prod.json",
156
+ "tsc:ts7": "npx -y -p typescript@^7 -c \"tsc\"",
157
+ "tsc-prod:ts7": "npx -y typescript@^7 tsc -p tsconfig-prod.json",
158
+ "build": "rm -R dist && npm run tsc-prod && npm run rollup",
159
+ "license-badge": "license-badger --corrections --uncategorizedLicenseTemplate \"\\${license} (\\${name} (\\${version}))\" --filteredTypes=nonempty --textTemplate \"License types\n(project, deps, and bundled devDeps)\" --packageJson --production badges/licenses-badge.svg",
160
+ "license-badge-dev": "license-badger --corrections --filteredTypes=nonempty --textTemplate \"License types\n(all devDeps)\" --allDevelopment badges/licenses-badge-dev.svg",
161
+ "license-badges": "run-p license-badge license-badge-dev",
162
+ "start": "static -p 9999 -H '{\"Access-Control-Allow-Origin\": \"http://web-platform.test:8000\", \"Access-Control-Allow-Methods\": \"GET\", \"Access-Control-Allow-Headers\": \"Content-Type\"}'",
163
+ "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\"",
164
+ "dev": "run-p start watch",
165
+ "clean": "run-p clean-sysDB clean-mocha clean-fake clean-mock clean-w3c clean-w3cOld",
166
+ "clean-sysDB": "rimraf --glob __sysdb__*",
167
+ "clean-polyfill": "run-p clean-fake clean-mock clean-w3cOld clean-sysDB",
168
+ "clean-mocha": "rimraf --glob D_recreate-index* D_indexeddbshim_test_database_* D_test.sqlite D_delete-* D_update-* D_cont* D_c^* D_dbname* D_sysdb-* file::memory:?* && npm run clean-sysDB",
169
+ "clean-fake": "rimraf --glob D_test0.*",
170
+ "clean-mock": "rimraf --glob D_test_database*",
171
+ "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",
172
+ "clean-w3cOld": "rimraf --glob D_db.sqlite* D_test* D_database_name* D_idbtransaction*",
173
+ "clean-w3c-built": "rimraf test-support/js",
174
+ "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",
175
+ "fix-permissions": "chmod +x node_modules/npm-run-all/bin/*/index.js",
176
+ "lint": "eslint .",
177
+ "eslint": "npm run lint --",
178
+ "w3c-build-only": "node test-support/node-buildjs",
179
+ "w3c-build": "run-s clean-w3c clean-w3c-built w3c-build-only",
180
+ "fake": "run-s clean-fake coverage:fake clean-fake",
181
+ "mock": "run-s clean-mock coverage:mock clean-mock",
182
+ "w3c-old": "run-s clean-w3cOld coverage:w3cOld clean-w3cOld",
183
+ "tests-polyfill": "run-s clean-polyfill coverage:fake coverage:mock coverage:w3cOld",
184
+ "mocha": "run-s clean-mocha coverage:mocha clean-mocha",
185
+ "rollup": "rollup -c",
186
+ "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",
187
+ "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",
188
+ "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",
189
+ "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",
190
+ "coverage:w3c": "npm run clean-w3c && run-p -r wpt coverage:w3c:test",
191
+ "test:w3c": "NODE_OPTIONS=--max_old_space_size=16384 NODE_OPTIONS=--trace-warnings node test-support/node-idb-test.js",
192
+ "w3c-test-only": "NODE_OPTIONS=--max_old_space_size=16384 node --trace-warnings test-support/node-idb-test.js",
193
+ "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",
194
+ "coverage-badge": "coveradge badges/coverage-badge",
195
+ "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/",
196
+ "coverage:report-only": "c8 report --temp-directory coverage/combined",
197
+ "coverage:report": "run-s coverage:copy coverage:report-only",
198
+ "remove-cache": "rimraf node_modules/.cache",
199
+ "remove-cov": "rimraf .nyc_output ",
200
+ "remove-results": "rimraf --glob test-support/results/file*.json",
201
+ "coverage:polyfill": "run-s coverage:fake coverage:mock coverage:w3cOld",
202
+ "tests-badge": "mbg --fileGlob \"./test-support/results/file*.json\" --badge_output badges/tests-badge.svg",
203
+ "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",
204
+ "coverage:empty": "rimraf coverage/combined coverage/fake coverage/mock coverage/mocha coverage/w3c && mkdir -p coverage/combined",
205
+ "open-coverage-only": "open http://127.0.0.1:9999/coverage/lcov-report/",
206
+ "open-coverage": "run-p start open-coverage-only",
207
+ "test": "run-s lint coverage",
208
+ "submodules-init": "git submodule update --init --recursive",
209
+ "submodules-fetch": "git submodule foreach --recursive git fetch",
210
+ "submodules-merge": "git submodule foreach git merge origin master",
211
+ "submodules": "run-s submodules-init submodules-fetch submodules-merge",
212
+ "wpt": "run-p start web-platform-tests",
213
+ "web-platform-tests": "cd web-platform-tests && ./wpt serve",
214
+ "stop-server": "pkill -f \"static -p 9999\" || true",
215
+ "stop-wpt": "pkill -f \"wpt serve\" || true",
216
+ "stop-ports": "kill -9 $(lsof -ti tcp:8000,8443,8444,9000,9999) 2>/dev/null || true",
217
+ "stop": "run-s stop-server stop-wpt stop-ports",
218
+ "w3c-find-unused": "node test-support/find-unused.js",
219
+ "w3c": "run-s w3c-test",
220
+ "w3c-add-wrap": "node test-support/wrap-w3c-tests",
221
+ "w3c-remove-wrap": "node test-support/wrap-w3c-tests remove",
222
+ "w3c-wrap": "node test-support/wrap-w3c-tests",
223
+ "test-and-start:w3c": "run-p -r start web-platform-tests delayed-w3c-test",
224
+ "delay": "delay 9",
225
+ "delayed-w3c-test": "run-s delay w3c-build-only test:w3c",
226
+ "w3c-test": "run-s clean-w3c test-and-start:w3c clean-w3c",
227
+ "w3c-good-only": "NODE_OPTIONS=--max_old_space_size=16384 node test-support/node-idb-test.js good",
228
+ "w3c-bad-only": "NODE_OPTIONS=--max_old_space_size=16384 node test-support/node-idb-test.js bad",
229
+ "w3c-good-worker-only": "NODE_OPTIONS=--max_old_space_size=16384 node test-support/node-idb-test.js good-worker",
230
+ "w3c-good": "run-s w3c-build w3c-good-only clean-w3c",
231
+ "w3c-bad": "run-s w3c-build w3c-bad-only clean-w3c",
232
+ "w3c-good-test": "run-s w3c-good-only clean-w3c",
233
+ "w3c-bad-test": "run-s w3c-bad-only clean-w3c",
234
+ "w3c-any-workers-only": "NODE_OPTIONS=--max_old_space_size=16384 node test-support/node-idb-test.js any-workers",
235
+ "w3c-non-workers-only": "NODE_OPTIONS=--max_old_space_size=16384 node --trace-warnings test-support/node-idb-test.js"
232
236
  }
233
- }
237
+ }
package/src/CFG.js CHANGED
@@ -36,7 +36,7 @@
36
36
  * databaseNameLengthLimit: number|false,
37
37
  * escapeNFDForDatabaseNames: boolean,
38
38
  * addSQLiteExtension: boolean,
39
- * memoryDatabase: string,
39
+ * memoryDatabase: string|null|undefined,
40
40
  * deleteDatabaseFiles: boolean,
41
41
  * databaseBasePath: string,
42
42
  * sysDatabaseBasePath: string,
@@ -191,17 +191,31 @@ const CFG = /** @type {ConfigValues} */ ({});
191
191
  [
192
192
  'memoryDatabase',
193
193
  /**
194
- * @param {string} val
194
+ * `null`/`undefined` are accepted (and left unvalidated against the
195
+ * regex below) specifically so this can be reset back to its
196
+ * unset/disabled state after being set: unlike other `CFG`
197
+ * boolean-ish switches (e.g. `sqlMemoryQuota`, which is checked
198
+ * with a falsy `if (CFG.sqlMemoryQuota)`), `memoryDatabase`'s own
199
+ * usage sites check `typeof CFG.memoryDatabase === 'string'`, so
200
+ * even the empty string counts as "on" (it's a distinct, valid
201
+ * in-memory mode of its own -- an unnamed private temporary
202
+ * database -- not an "off" state). Without this, once set to any
203
+ * string there would be no value passable back through this same
204
+ * validator that turns `useMemoryDatabase` false again.
205
+ * @param {string|null|undefined} val
195
206
  * @throws {TypeError}
196
207
  * @returns {void}
197
208
  */
198
209
  (val) => {
210
+ if (val === null || val === undefined) {
211
+ return;
212
+ }
199
213
  if (!(/^(?::memory:|file::memory:(\?[^#]*)?(#.*)?)?$/u).test(
200
214
  /** @type {string} */ (val)
201
215
  )) {
202
216
  throw new TypeError(
203
- '`memoryDatabase` must be the empty string, ":memory:", or a ' +
204
- '"file::memory:[?queryString][#hash] URL".'
217
+ '`memoryDatabase` must be `null`/`undefined` (to reset it to disabled), the empty string, ' +
218
+ '":memory:", or a "file::memory:[?queryString][#hash] URL".'
205
219
  );
206
220
  }
207
221
  }
@@ -11,6 +11,7 @@ function createNativeDOMException (name, message) {
11
11
  // eslint-disable-next-line new-cap -- Ok
12
12
  return new DOMException.prototype.constructor(
13
13
  message,
14
+ /* c8 ignore next -- Defensive fallback; every call site in this codebase always supplies a `name` */
14
15
  name || 'DOMException'
15
16
  );
16
17
  }
@@ -178,8 +179,10 @@ function createNonNativeDOMExceptionClass () {
178
179
  */
179
180
  get () {
180
181
  if (!(this instanceof DOMException ||
182
+ // eslint-disable-next-line jsdoc/ts-ban-ts-comment -- TS 6/7
181
183
  // @ts-ignore Just checking; needed under some TS versions
182
184
  this instanceof DummyDOMException ||
185
+ // eslint-disable-next-line jsdoc/ts-ban-ts-comment -- TS 6/7
183
186
  // @ts-ignore Just checking; needed under some TS versions
184
187
  this instanceof Error)) {
185
188
  throw new TypeError('Illegal invocation');
@@ -242,6 +245,7 @@ function createNonNativeDOMExceptionClass () {
242
245
  value: DOMException
243
246
  });
244
247
 
248
+ // eslint-disable-next-line jsdoc/ts-ban-ts-comment -- TS 6/7
245
249
  // @ts-ignore We don't need all its properties; needed under some TS versions
246
250
  return DOMException;
247
251
  }
@@ -255,6 +259,7 @@ const ShimNonNativeDOMException = createNonNativeDOMExceptionClass();
255
259
  * @returns {Error}
256
260
  */
257
261
  function createNonNativeDOMException (name, message) {
262
+ // eslint-disable-next-line jsdoc/ts-ban-ts-comment -- TS 6/7
258
263
  // @ts-ignore It's ok; needed under some TS versions
259
264
  return new ShimNonNativeDOMException(message, name);
260
265
  }
@@ -281,6 +286,7 @@ function logError (name, message, error) {
281
286
  ? error.message
282
287
  : /** @type {string} */ (error);
283
288
 
289
+ /* c8 ignore next -- Defensive fallback for an environment lacking `console.error` */
284
290
  const method = typeof (console.error) === 'function' ? 'error' : 'log';
285
291
  console[method](name + ': ' + message + '. ' + (msg || ''));
286
292
  if (console.trace) { console.trace(); }
@@ -28,9 +28,11 @@ if (Object.defineProperty) {
28
28
  if (testObject.test) {
29
29
  cleanInterface = true;
30
30
  }
31
+ /* c8 ignore start -- Defensive fallback for an engine with a broken `Object.defineProperty` */
31
32
  } catch (err) {
32
33
  // Object.defineProperty does not work as intended.
33
34
  }
35
+ /* c8 ignore stop -- Defensive fallback for an engine with a broken `Object.defineProperty` */
34
36
  }
35
37
 
36
38
  /**
@@ -230,6 +232,7 @@ Object.defineProperty(DOMStringList, '__createInstance', {
230
232
  this._length = 0;
231
233
  };
232
234
  DOMStringList.prototype = DOMStringListAlias.prototype;
235
+ // eslint-disable-next-line jsdoc/ts-ban-ts-comment -- TS 6/7
233
236
  // @ts-ignore It's ok; needed under some TS versions
234
237
  return /** @type {DOMStringListFull} */ (new DOMStringList());
235
238
  }
package/src/IDBCursor.js CHANGED
@@ -351,6 +351,7 @@ IDBCursor.prototype.__findBasic = function (key, primaryKey, tx, success, error,
351
351
  success(undefined, undefined, undefined);
352
352
  }
353
353
  }, function (tx, err) {
354
+ /* c8 ignore next -- Debug-only log; no test sets `CFG.DEBUG`. */
354
355
  if (CFG.DEBUG) { console.log('Could not execute Cursor.continue', sqlStr, sqlValues); }
355
356
  error(err);
356
357
  return false;
@@ -540,7 +541,16 @@ IDBCursor.prototype.__findMultiEntry = function (key, primaryKey, tx, success, e
540
541
  if (a.key > b.key) {
541
542
  return me.direction === 'prev' ? -1 : 1;
542
543
  }
544
+ /* c8 ignore start -- Defensive: only reachable if two matches
545
+ in the same batch shared both the same `matchingKey` and
546
+ the same primary `key`, which would require the same
547
+ record's multi-entry array to contain a duplicate value.
548
+ `Key.js`'s array-to-key conversion already drops duplicate
549
+ values when a multi-entry index entry is built, so this
550
+ can never happen in practice; kept only to satisfy the
551
+ `Array.prototype.sort` comparator contract. */
543
552
  return 0;
553
+ /* c8 ignore stop -- see comment above */
544
554
  });
545
555
 
546
556
  me.__prefetchedIndex = 0;
@@ -558,11 +568,15 @@ IDBCursor.prototype.__findMultiEntry = function (key, primaryKey, tx, success, e
558
568
  };
559
569
  if (CFG.DEBUG) { console.log('[multiEntry] Preloaded ' + me.__prefetchedData.length + ' records for multiEntry cursor'); }
560
570
  me.__decode(rows[0], success);
561
- }, function (tx, err) {
571
+ }, /* c8 ignore start -- Defensive: guards against an unexpected SQLite
572
+ execution error (e.g. I/O error, corruption) while querying for
573
+ multi-entry cursor matches; not reliably reproducible without
574
+ mocking the SQL layer. */ function (tx, err) {
562
575
  if (CFG.DEBUG) { console.log('[multiEntry] Could not execute Cursor.continue', sqlStr, sqlValues); }
563
576
  error(err);
564
577
  return false;
565
578
  });
579
+ /* c8 ignore stop -- see comment above */
566
580
  }
567
581
 
568
582
  runQuery();
@@ -683,6 +697,7 @@ IDBCursor.prototype.__sourceOrEffectiveObjStoreDeleted = function () {
683
697
  * @returns {void}
684
698
  */
685
699
  IDBCursor.prototype.__invalidateCache = function () {
700
+ // eslint-disable-next-line jsdoc/ts-ban-ts-comment -- TS 6/7
686
701
  // @ts-ignore Why is this not being found?; needed under some TS versions
687
702
  this.__prefetchedData = null;
688
703
  this.__multiEntryExhausted = false;
@@ -710,7 +725,7 @@ IDBCursor.prototype.__continue = function (key, advanceContinue) {
710
725
  (me.direction.includes('next') && cmpResult === -1) ||
711
726
  (me.direction.includes('prev') && cmpResult === 1)
712
727
  ) {
713
- throw createDOMException('DataError', 'Cannot ' + (advanceState ? 'advance' : 'continue') + ' the cursor in an unexpected direction');
728
+ throw createDOMException('DataError', 'Cannot continue the cursor in an unexpected direction');
714
729
  }
715
730
  }
716
731
  this.__continueFinish(key, undefined, advanceState);
@@ -976,6 +991,7 @@ IDBCursor.prototype.update = function (valueToUpdate) {
976
991
  // continuation logic in `__findBasic` to see this update's
977
992
  // effect on ordering (see "Modify records during cursor
978
993
  // iteration" in idbcursor_update_index.any.js).
994
+ // eslint-disable-next-line jsdoc/ts-ban-ts-comment -- TS 6/7
979
995
  // @ts-ignore -- API (not erring in TS 6)
980
996
  IDBObjectStore.__storingRecordObjectStore(request, me.__store, true, clonedValue, false, key);
981
997
  }
@@ -1030,14 +1046,31 @@ IDBCursor.prototype.delete = function () {
1030
1046
  // We don't invalidate the cache (as we don't access it anymore
1031
1047
  // and it will set the index off)
1032
1048
  success(undefined);
1049
+ /* c8 ignore start -- Defensive: `__find` (invoked just above) has
1050
+ already confirmed a row exists for this primary key within the
1051
+ same transaction queue, so `rowsAffected` should always be 1 in
1052
+ normal usage. This branch would only be reached if the underlying
1053
+ row were removed by another request queued in the same
1054
+ transaction between `__find`'s check and this DELETE actually
1055
+ running (e.g. deleting the same record directly via the object
1056
+ store while a cursor over it is mid-iteration); attempts to
1057
+ construct such a scenario instead trigger a transaction abort
1058
+ (`AbortError`) before this callback ever runs, since the default
1059
+ action of an unhandled request error is to abort the
1060
+ transaction. */
1033
1061
  } else {
1034
1062
  // @ts-expect-error Apparently ok
1035
1063
  error('No rows with key found' + key);
1036
1064
  }
1037
- }, function (tx, data) {
1065
+ /* c8 ignore stop -- see comment above */
1066
+ }, /* c8 ignore start -- Defensive: guards against an unexpected SQLite
1067
+ execution error (e.g. I/O error, corruption) while deleting the
1068
+ current row; not reliably reproducible without mocking the SQL
1069
+ layer. */ function (tx, data) {
1038
1070
  error(data);
1039
1071
  return false;
1040
1072
  });
1073
+ /* c8 ignore stop -- see comment above */
1041
1074
  }, error
1042
1075
  );
1043
1076
  }, undefined, me);
@@ -167,7 +167,7 @@ IDBDatabase.prototype.createObjectStore = function (storeName /* , createOptions
167
167
  throw createDOMException('SyntaxError', 'The keyPath argument contains an invalid key path.');
168
168
  }
169
169
 
170
- if (Object.hasOwn(this.__objectStores, storeName) && !this.__objectStores[storeName].__pendingDelete) {
170
+ if (Object.hasOwn(this.__objectStores, storeName) && !this.__objectStores[storeName].__pendingDelete && !this.__objectStores[storeName].__deleted) {
171
171
  throw createDOMException('ConstraintError', 'Object store "' + storeName + '" already exists in ' + this.name);
172
172
  }
173
173
 
@@ -319,7 +319,6 @@ IDBDatabase.prototype.throwIfUpgradeTransactionNull = function () {
319
319
  }
320
320
  };
321
321
 
322
- // Todo __forceClose: Add tests for `__forceClose`
323
322
  /**
324
323
  *
325
324
  * @param {string} msg
@@ -328,26 +327,43 @@ IDBDatabase.prototype.throwIfUpgradeTransactionNull = function () {
328
327
  */
329
328
  IDBDatabase.prototype.__forceClose = function (msg) {
330
329
  const me = this;
330
+ // `close()` (below) resets `me.__transactions` to `[]`, so the
331
+ // transactions to abort -- and the total count the completion check
332
+ // below needs -- must be captured before calling it, not read back off
333
+ // `me.__transactions` afterward.
334
+ const transactions = me.__transactions;
331
335
  me.close();
336
+
337
+ /**
338
+ * @returns {void}
339
+ */
340
+ function dispatchClose () {
341
+ // Todo __forceClose: unblock any pending `upgradeneeded` or `deleteDatabase` calls
342
+ const evt = createEvent('close');
343
+ setTimeout(() => {
344
+ me.dispatchEvent(evt);
345
+ }, 0);
346
+ }
347
+
348
+ if (!transactions.length) {
349
+ dispatchClose();
350
+ return;
351
+ }
332
352
  let ct = 0;
333
- me.__transactions.forEach(function (trans) {
353
+ transactions.forEach(function (trans) {
334
354
  // eslint-disable-next-line camelcase -- Clear API
335
355
  trans.on__abort = function () {
336
356
  ct++;
337
- if (ct === me.__transactions.length) {
338
- // Todo __forceClose: unblock any pending `upgradeneeded` or `deleteDatabase` calls
339
- const evt = createEvent('close');
340
- setTimeout(() => {
341
- me.dispatchEvent(evt);
342
- }, 0);
357
+ if (ct !== transactions.length) {
358
+ return;
343
359
  }
360
+ dispatchClose();
344
361
  };
345
362
  trans.__abortTransaction(createDOMException(
346
363
  'AbortError',
347
364
  'The connection was force-closed: ' + (msg || '')
348
365
  ));
349
366
  });
350
- me.__transactions = [];
351
367
  };
352
368
  /* eslint-disable unicorn/no-top-level-side-effects -- Would be good */
353
369
  util.defineOuterInterface(IDBDatabase.prototype, listeners);