indexeddbshim 14.0.0 → 15.0.1
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/badges/licenses-badge-dev.svg +1 -1
- package/dist/indexeddbshim-Key.js +10 -3
- 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 +72 -51
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.js +75 -52
- package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js +2 -2
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
- package/dist/indexeddbshim-node.cjs +72 -51
- package/dist/indexeddbshim-node.cjs.map +1 -1
- package/dist/indexeddbshim-noninvasive.js +75 -52
- package/dist/indexeddbshim-noninvasive.js.map +1 -1
- package/dist/indexeddbshim-noninvasive.min.js +2 -2
- package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
- package/dist/indexeddbshim.js +75 -52
- package/dist/indexeddbshim.js.map +1 -1
- package/dist/indexeddbshim.min.js +2 -2
- package/dist/indexeddbshim.min.js.map +1 -1
- package/package.json +80 -81
- package/src/IDBDatabase.js +5 -0
- package/src/IDBFactory.js +10 -4
- package/src/Key.js +8 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "indexeddbshim",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "Parashuram <code@nparashuram.com>",
|
|
6
6
|
"contributors": [
|
|
@@ -28,78 +28,6 @@
|
|
|
28
28
|
"test-support/**"
|
|
29
29
|
]
|
|
30
30
|
},
|
|
31
|
-
"scripts": {
|
|
32
|
-
"tsc": "tsc",
|
|
33
|
-
"tsc-prod": "tsc -p tsconfig-prod.json",
|
|
34
|
-
"build": "npm run rollup && npm run tsc-prod",
|
|
35
|
-
"prepublishOnly": "npm run license-badges",
|
|
36
|
-
"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",
|
|
37
|
-
"license-badge-dev": "license-badger --corrections --filteredTypes=nonempty --textTemplate \"License types\n(all devDeps)\" --allDevelopment badges/licenses-badge-dev.svg",
|
|
38
|
-
"license-badges": "run-p license-badge license-badge-dev",
|
|
39
|
-
"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\"}'",
|
|
40
|
-
"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\"",
|
|
41
|
-
"dev": "run-p start watch",
|
|
42
|
-
"clean": "run-p clean-sysDB clean-mocha clean-fake clean-mock clean-w3c clean-w3cOld",
|
|
43
|
-
"clean-sysDB": "rimraf __sysdb__*",
|
|
44
|
-
"clean-polyfill": "run-p clean-fake clean-mock clean-w3cOld clean-sysDB",
|
|
45
|
-
"clean-mocha": "rimraf D_indexeddbshim_test_database_* D_test.sqlite",
|
|
46
|
-
"clean-fake": "rimraf D_test0.*",
|
|
47
|
-
"clean-mock": "rimraf D_test_database*",
|
|
48
|
-
"clean-w3c": "rimraf 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*",
|
|
49
|
-
"clean-w3cOld": "rimraf D_db.sqlite* D_test* D_database_name* D_idbtransaction*",
|
|
50
|
-
"copy": "copyup node_modules/core-js-bundle/minified.js 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",
|
|
51
|
-
"lint": "eslint --ext=js,md,html .",
|
|
52
|
-
"eslint": "npm run lint",
|
|
53
|
-
"sqlite-rebuild": "cd node_modules/sqlite3 && npm i",
|
|
54
|
-
"w3c-build-only": "node test-support/node-buildjs",
|
|
55
|
-
"w3c-build": "run-s clean-w3c w3c-build-only",
|
|
56
|
-
"fake": "run-s clean-fake coverage:fake clean-fake",
|
|
57
|
-
"mock": "run-s clean-mock coverage:mock clean-mock",
|
|
58
|
-
"w3c-old": "run-s clean-w3cOld coverage:w3cOld clean-w3cOld",
|
|
59
|
-
"tests-polyfill": "run-s clean-polyfill coverage:fake coverage:mock coverage:w3cOld",
|
|
60
|
-
"mocha": "run-s clean-mocha coverage:mocha clean-mocha",
|
|
61
|
-
"rollup": "rollup -c",
|
|
62
|
-
"coverage:fake": "c8 --silent --no-clean mocha --reporterOptions configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+fake --require source-map-support/register tests-polyfill/fakeIndexedDB/test-node.js",
|
|
63
|
-
"coverage:mock": "c8 --silent --no-clean mocha --reporterOptions configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+mock --require source-map-support/register tests-polyfill/indexedDBmock/test-node.js",
|
|
64
|
-
"coverage:w3cOld": "c8 --silent --no-clean mocha --reporterOptions configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+w3c --require source-map-support/register tests-polyfill/w3c/test-node.js",
|
|
65
|
-
"coverage:w3c": "NODE_OPTIONS=--max_old_space_size=16384 c8 --silent --no-clean npm run w3c-test-only",
|
|
66
|
-
"test:w3c": "NODE_OPTIONS=--max_old_space_size=16384 NODE_OPTIONS=--trace-warnings node test-support/node-idb-test.js",
|
|
67
|
-
"w3c-test-only": "node --trace-warnings test-support/node-idb-test.js",
|
|
68
|
-
"coverage:mocha": "c8 --silent --no-clean mocha --reporterOptions configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+mocha --require source-map-support/register tests-mocha/test-node.js",
|
|
69
|
-
"coverage-badge": "coveradge badges/coverage-badge",
|
|
70
|
-
"coverage:report-only": "c8 report",
|
|
71
|
-
"coverage:report": "run-s coverage:report-only",
|
|
72
|
-
"remove-cache": "rimraf node_modules/.cache",
|
|
73
|
-
"remove-cov": "rimraf .nyc_output ",
|
|
74
|
-
"remove-results": "rimraf test-support/results/file*.json",
|
|
75
|
-
"coverage:polyfill": "run-s coverage:fake coverage:mock coverage:w3cOld",
|
|
76
|
-
"tests-badge": "mbg --fileGlob \"./test-support/results/file*.json\" --badge_output badges/tests-badge.svg",
|
|
77
|
-
"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",
|
|
78
|
-
"open-coverage-only": "open http://127.0.0.1:9999/coverage/lcov-report/",
|
|
79
|
-
"open-coverage": "run-p start open-coverage-only",
|
|
80
|
-
"test": "run-s lint coverage",
|
|
81
|
-
"submodules-init": "git submodule update --init --recursive",
|
|
82
|
-
"submodules-fetch": "git submodule foreach --recursive git fetch",
|
|
83
|
-
"submodules-merge": "git submodule foreach git merge origin master",
|
|
84
|
-
"submodules": "run-s submodules-init submodules-fetch submodules-merge",
|
|
85
|
-
"wpt": "run-p start web-platform-tests",
|
|
86
|
-
"web-platform-tests": "cd web-platform-tests && ./wpt serve",
|
|
87
|
-
"w3c-find-unused": "node test-support/find-unused.js",
|
|
88
|
-
"w3c": "run-s w3c-build w3c-test",
|
|
89
|
-
"w3c-add-wrap": "node test-support/wrap-w3c-tests",
|
|
90
|
-
"w3c-remove-wrap": "node test-support/wrap-w3c-tests remove",
|
|
91
|
-
"w3c-wrap": "node test-support/wrap-w3c-tests",
|
|
92
|
-
"test-and-start:w3c": "run-p -r start web-platform-tests delayed-w3c-test",
|
|
93
|
-
"delay": "delay 9",
|
|
94
|
-
"delayed-w3c-test": "run-s delay test:w3c",
|
|
95
|
-
"w3c-test": "run-s clean-w3c test-and-start:w3c",
|
|
96
|
-
"w3c-good-only": "node test-support/node-idb-test.js good",
|
|
97
|
-
"w3c-bad-only": "node test-support/node-idb-test.js bad",
|
|
98
|
-
"w3c-good": "run-s w3c-build w3c-good-only clean-w3c",
|
|
99
|
-
"w3c-bad": "run-s w3c-build w3c-bad-only clean-w3c",
|
|
100
|
-
"w3c-good-test": "run-s w3c-good-only clean-w3c",
|
|
101
|
-
"w3c-bad-test": "run-s w3c-bad-only clean-w3c"
|
|
102
|
-
},
|
|
103
31
|
"repository": {
|
|
104
32
|
"type": "git",
|
|
105
33
|
"url": "https://github.com/indexeddbshim/IndexedDBShim"
|
|
@@ -155,20 +83,20 @@
|
|
|
155
83
|
"last 3 Samsung versions"
|
|
156
84
|
],
|
|
157
85
|
"engines": {
|
|
158
|
-
"node": ">=18.
|
|
86
|
+
"node": ">=18.14.0"
|
|
159
87
|
},
|
|
160
88
|
"dependencies": {
|
|
161
89
|
"canvas": "^2.11.2",
|
|
162
90
|
"eventtargeter": "0.9.0",
|
|
163
91
|
"sync-promise-expanded": "^1.0.0",
|
|
164
92
|
"typeson": "9.0.3",
|
|
165
|
-
"typeson-registry": "
|
|
93
|
+
"typeson-registry": "11.0.0",
|
|
166
94
|
"websql-configurable": "^3.0.3"
|
|
167
95
|
},
|
|
168
96
|
"devDependencies": {
|
|
169
97
|
"@brettz9/eslint-plugin": "^1.0.4",
|
|
170
|
-
"@babel/core": "^7.24.
|
|
171
|
-
"@babel/preset-env": "^7.24.
|
|
98
|
+
"@babel/core": "^7.24.9",
|
|
99
|
+
"@babel/preset-env": "^7.24.8",
|
|
172
100
|
"@brettz9/node-static": "^0.1.1",
|
|
173
101
|
"@es-joy/json-file-reporter": "^1.4.0",
|
|
174
102
|
"@rollup/plugin-babel": "^6.0.4",
|
|
@@ -201,7 +129,7 @@
|
|
|
201
129
|
"eslint-plugin-markdown": "^3.0.1",
|
|
202
130
|
"eslint-plugin-n": "^16.6.2",
|
|
203
131
|
"eslint-plugin-import": "^2.29.1",
|
|
204
|
-
"eslint-plugin-jsdoc": "^48.
|
|
132
|
+
"eslint-plugin-jsdoc": "^48.7.0",
|
|
205
133
|
"eslint-plugin-no-unsanitized": "^4.0.2",
|
|
206
134
|
"eslint-plugin-no-use-extend-native": "^0.5.0",
|
|
207
135
|
"eslint-plugin-sonarjs": "^0.23.0",
|
|
@@ -220,15 +148,86 @@
|
|
|
220
148
|
"npm-run-all": "^4.1.5",
|
|
221
149
|
"open-cli": "^8.0.0",
|
|
222
150
|
"rimraf": "^5.0.8",
|
|
223
|
-
"rollup": "^4.18.
|
|
151
|
+
"rollup": "^4.18.1",
|
|
224
152
|
"rollup-plugin-filesize": "^10.0.0",
|
|
225
153
|
"rollup-plugin-node-globals": "^1.4.0",
|
|
226
154
|
"rollup-plugin-node-polyfills": "^0.2.1",
|
|
227
155
|
"sinon": "^18.0.0",
|
|
228
156
|
"source-map-support": "0.5.21",
|
|
229
157
|
"sourcemap-transformer": "git+https://github.com/brettz9/sourcemap-transformer.git",
|
|
230
|
-
"typescript": "^5.5.
|
|
158
|
+
"typescript": "^5.5.4",
|
|
231
159
|
"w3c-blob": "0.0.1",
|
|
232
160
|
"ws": "^8.18.0"
|
|
161
|
+
},
|
|
162
|
+
"scripts": {
|
|
163
|
+
"tsc": "tsc",
|
|
164
|
+
"tsc-prod": "tsc -p tsconfig-prod.json",
|
|
165
|
+
"build": "npm run rollup && npm run tsc-prod",
|
|
166
|
+
"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",
|
|
167
|
+
"license-badge-dev": "license-badger --corrections --filteredTypes=nonempty --textTemplate \"License types\n(all devDeps)\" --allDevelopment badges/licenses-badge-dev.svg",
|
|
168
|
+
"license-badges": "run-p license-badge license-badge-dev",
|
|
169
|
+
"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\"}'",
|
|
170
|
+
"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\"",
|
|
171
|
+
"dev": "run-p start watch",
|
|
172
|
+
"clean": "run-p clean-sysDB clean-mocha clean-fake clean-mock clean-w3c clean-w3cOld",
|
|
173
|
+
"clean-sysDB": "rimraf __sysdb__*",
|
|
174
|
+
"clean-polyfill": "run-p clean-fake clean-mock clean-w3cOld clean-sysDB",
|
|
175
|
+
"clean-mocha": "rimraf D_indexeddbshim_test_database_* D_test.sqlite",
|
|
176
|
+
"clean-fake": "rimraf D_test0.*",
|
|
177
|
+
"clean-mock": "rimraf D_test_database*",
|
|
178
|
+
"clean-w3c": "rimraf 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*",
|
|
179
|
+
"clean-w3cOld": "rimraf D_db.sqlite* D_test* D_database_name* D_idbtransaction*",
|
|
180
|
+
"copy": "copyup node_modules/core-js-bundle/minified.js 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",
|
|
181
|
+
"lint": "eslint --ext=js,md,html .",
|
|
182
|
+
"eslint": "npm run lint",
|
|
183
|
+
"sqlite-rebuild": "cd node_modules/sqlite3 && npm i",
|
|
184
|
+
"w3c-build-only": "node test-support/node-buildjs",
|
|
185
|
+
"w3c-build": "run-s clean-w3c w3c-build-only",
|
|
186
|
+
"fake": "run-s clean-fake coverage:fake clean-fake",
|
|
187
|
+
"mock": "run-s clean-mock coverage:mock clean-mock",
|
|
188
|
+
"w3c-old": "run-s clean-w3cOld coverage:w3cOld clean-w3cOld",
|
|
189
|
+
"tests-polyfill": "run-s clean-polyfill coverage:fake coverage:mock coverage:w3cOld",
|
|
190
|
+
"mocha": "run-s clean-mocha coverage:mocha clean-mocha",
|
|
191
|
+
"rollup": "rollup -c",
|
|
192
|
+
"coverage:fake": "c8 --silent --no-clean mocha --reporterOptions configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+fake --require source-map-support/register tests-polyfill/fakeIndexedDB/test-node.js",
|
|
193
|
+
"coverage:mock": "c8 --silent --no-clean mocha --reporterOptions configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+mock --require source-map-support/register tests-polyfill/indexedDBmock/test-node.js",
|
|
194
|
+
"coverage:w3cOld": "c8 --silent --no-clean mocha --reporterOptions configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+w3c --require source-map-support/register tests-polyfill/w3c/test-node.js",
|
|
195
|
+
"coverage:w3c": "NODE_OPTIONS=--max_old_space_size=16384 c8 --silent --no-clean npm run w3c-test-only",
|
|
196
|
+
"test:w3c": "NODE_OPTIONS=--max_old_space_size=16384 NODE_OPTIONS=--trace-warnings node test-support/node-idb-test.js",
|
|
197
|
+
"w3c-test-only": "node --trace-warnings test-support/node-idb-test.js",
|
|
198
|
+
"coverage:mocha": "c8 --silent --no-clean mocha --reporterOptions configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+mocha --require source-map-support/register tests-mocha/test-node.js",
|
|
199
|
+
"coverage-badge": "coveradge badges/coverage-badge",
|
|
200
|
+
"coverage:report-only": "c8 report",
|
|
201
|
+
"coverage:report": "run-s coverage:report-only",
|
|
202
|
+
"remove-cache": "rimraf node_modules/.cache",
|
|
203
|
+
"remove-cov": "rimraf .nyc_output ",
|
|
204
|
+
"remove-results": "rimraf test-support/results/file*.json",
|
|
205
|
+
"coverage:polyfill": "run-s coverage:fake coverage:mock coverage:w3cOld",
|
|
206
|
+
"tests-badge": "mbg --fileGlob \"./test-support/results/file*.json\" --badge_output badges/tests-badge.svg",
|
|
207
|
+
"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",
|
|
208
|
+
"open-coverage-only": "open http://127.0.0.1:9999/coverage/lcov-report/",
|
|
209
|
+
"open-coverage": "run-p start open-coverage-only",
|
|
210
|
+
"test": "run-s lint coverage",
|
|
211
|
+
"submodules-init": "git submodule update --init --recursive",
|
|
212
|
+
"submodules-fetch": "git submodule foreach --recursive git fetch",
|
|
213
|
+
"submodules-merge": "git submodule foreach git merge origin master",
|
|
214
|
+
"submodules": "run-s submodules-init submodules-fetch submodules-merge",
|
|
215
|
+
"wpt": "run-p start web-platform-tests",
|
|
216
|
+
"web-platform-tests": "cd web-platform-tests && ./wpt serve",
|
|
217
|
+
"w3c-find-unused": "node test-support/find-unused.js",
|
|
218
|
+
"w3c": "run-s w3c-build w3c-test",
|
|
219
|
+
"w3c-add-wrap": "node test-support/wrap-w3c-tests",
|
|
220
|
+
"w3c-remove-wrap": "node test-support/wrap-w3c-tests remove",
|
|
221
|
+
"w3c-wrap": "node test-support/wrap-w3c-tests",
|
|
222
|
+
"test-and-start:w3c": "run-p -r start web-platform-tests delayed-w3c-test",
|
|
223
|
+
"delay": "delay 9",
|
|
224
|
+
"delayed-w3c-test": "run-s delay test:w3c",
|
|
225
|
+
"w3c-test": "run-s clean-w3c test-and-start:w3c",
|
|
226
|
+
"w3c-good-only": "node test-support/node-idb-test.js good",
|
|
227
|
+
"w3c-bad-only": "node test-support/node-idb-test.js bad",
|
|
228
|
+
"w3c-good": "run-s w3c-build w3c-good-only clean-w3c",
|
|
229
|
+
"w3c-bad": "run-s w3c-build w3c-bad-only clean-w3c",
|
|
230
|
+
"w3c-good-test": "run-s w3c-good-only clean-w3c",
|
|
231
|
+
"w3c-bad-test": "run-s w3c-bad-only clean-w3c"
|
|
233
232
|
}
|
|
234
|
-
}
|
|
233
|
+
}
|
package/src/IDBDatabase.js
CHANGED
|
@@ -29,6 +29,8 @@ const readonlyProperties = ['name', 'version', 'objectStoreNames'];
|
|
|
29
29
|
function IDBDatabase () {
|
|
30
30
|
this.__versionTransaction = null;
|
|
31
31
|
this.__objectStores = null;
|
|
32
|
+
/** @type {import('./IDBTransaction.js').IDBTransactionFull[]} */
|
|
33
|
+
this.__transactions = [];
|
|
32
34
|
throw new TypeError('Illegal constructor');
|
|
33
35
|
}
|
|
34
36
|
const IDBDatabaseAlias = IDBDatabase;
|
|
@@ -92,6 +94,7 @@ IDBDatabase.__createInstance = function (db, name, oldVersion, version, storePro
|
|
|
92
94
|
legacyOutputDidListenersThrowFlag: true // Event hook for IndexedB
|
|
93
95
|
});
|
|
94
96
|
|
|
97
|
+
/** @type {import('./IDBTransaction.js').IDBTransactionFull[]} */
|
|
95
98
|
this.__transactions = [];
|
|
96
99
|
|
|
97
100
|
/** @type {{[key: string]: IDBObjectStore}} */
|
|
@@ -222,6 +225,7 @@ IDBDatabase.prototype.close = function () {
|
|
|
222
225
|
if (this.__unblocking) {
|
|
223
226
|
this.__unblocking.check();
|
|
224
227
|
}
|
|
228
|
+
this.__transactions = [];
|
|
225
229
|
};
|
|
226
230
|
|
|
227
231
|
/**
|
|
@@ -325,6 +329,7 @@ IDBDatabase.prototype.__forceClose = function (msg) {
|
|
|
325
329
|
'The connection was force-closed: ' + (msg || '')
|
|
326
330
|
));
|
|
327
331
|
});
|
|
332
|
+
me.__transactions = [];
|
|
328
333
|
};
|
|
329
334
|
|
|
330
335
|
util.defineOuterInterface(IDBDatabase.prototype, listeners);
|
package/src/IDBFactory.js
CHANGED
|
@@ -635,6 +635,11 @@ IDBFactory.prototype.open = function (name /* , version */) {
|
|
|
635
635
|
|
|
636
636
|
// eslint-disable-next-line camelcase -- Clear API
|
|
637
637
|
req.transaction.on__complete = function () {
|
|
638
|
+
const pos = connection.__transactions.indexOf(req.transaction);
|
|
639
|
+
if (pos > -1) {
|
|
640
|
+
connection.__transactions.splice(pos, 1);
|
|
641
|
+
}
|
|
642
|
+
|
|
638
643
|
if (/** @type {import('./IDBDatabase.js').IDBDatabaseFull} */ (
|
|
639
644
|
req.__result
|
|
640
645
|
).__closePending) {
|
|
@@ -1028,9 +1033,10 @@ IDBFactory.prototype.__forceClose = function (dbName, connIdx, msg) {
|
|
|
1028
1033
|
conn.__forceClose(msg);
|
|
1029
1034
|
}
|
|
1030
1035
|
if (util.isNullish(dbName)) {
|
|
1031
|
-
(Object.values(me.__connections)).forEach((
|
|
1032
|
-
|
|
1033
|
-
|
|
1036
|
+
(Object.values(me.__connections)).forEach((connections) => {
|
|
1037
|
+
connections.forEach((connection) => {
|
|
1038
|
+
forceClose(connection);
|
|
1039
|
+
});
|
|
1034
1040
|
});
|
|
1035
1041
|
} else if (!me.__connections[dbName]) {
|
|
1036
1042
|
console.log('No database connections with that name to force close');
|
|
@@ -1041,7 +1047,7 @@ IDBFactory.prototype.__forceClose = function (dbName, connIdx, msg) {
|
|
|
1041
1047
|
} else if (!Number.isInteger(connIdx) || connIdx < 0 || connIdx > me.__connections[dbName].length - 1) {
|
|
1042
1048
|
throw new TypeError(
|
|
1043
1049
|
'If providing an argument, __forceClose must be called with a ' +
|
|
1044
|
-
'numeric index to indicate a specific connection to
|
|
1050
|
+
'numeric index to indicate a specific connection to close'
|
|
1045
1051
|
);
|
|
1046
1052
|
} else {
|
|
1047
1053
|
forceClose(me.__connections[dbName][connIdx]);
|
package/src/Key.js
CHANGED
|
@@ -91,6 +91,14 @@ const signValues = ['negativeInfinity', 'bigNegative', 'smallNegative', 'smallPo
|
|
|
91
91
|
* @typedef {any} AnyValue
|
|
92
92
|
*/
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* @type {{
|
|
96
|
+
* [key: string]: {
|
|
97
|
+
* encode: (param: any, inArray?: boolean) => string,
|
|
98
|
+
* decode: (param: string, inArray?: boolean) => any
|
|
99
|
+
* }
|
|
100
|
+
* }}
|
|
101
|
+
*/
|
|
94
102
|
const types = {
|
|
95
103
|
invalid: {
|
|
96
104
|
/**
|
|
@@ -923,7 +931,6 @@ function encode (key, inArray) {
|
|
|
923
931
|
return null;
|
|
924
932
|
}
|
|
925
933
|
// array, date, number, string, binary (should already have detected "invalid")
|
|
926
|
-
// @ts-expect-error Argument may be ignored
|
|
927
934
|
return types[getKeyType(key)].encode(key, inArray);
|
|
928
935
|
}
|
|
929
936
|
|