indexeddbshim 16.1.0 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/badges/licenses-badge-dev.svg +1 -1
- package/badges/licenses-badge.svg +1 -1
- package/dist/CFG.d.ts.map +1 -1
- package/dist/DOMException.d.ts.map +1 -1
- package/dist/DOMStringList.d.ts.map +1 -1
- package/dist/IDBCursor.d.ts +3 -1
- package/dist/IDBCursor.d.ts.map +1 -1
- package/dist/IDBDatabase.d.ts +2 -1
- package/dist/IDBDatabase.d.ts.map +1 -1
- package/dist/IDBFactory.d.ts +2 -1
- package/dist/IDBFactory.d.ts.map +1 -1
- package/dist/IDBIndex.d.ts +2 -1
- package/dist/IDBIndex.d.ts.map +1 -1
- package/dist/IDBKeyRange.d.ts +1 -1
- package/dist/IDBKeyRange.d.ts.map +1 -1
- package/dist/IDBObjectStore.d.ts +2 -1
- package/dist/IDBObjectStore.d.ts.map +1 -1
- package/dist/IDBRequest.d.ts +5 -3
- package/dist/IDBRequest.d.ts.map +1 -1
- package/dist/IDBTransaction.d.ts +2 -1
- package/dist/IDBTransaction.d.ts.map +1 -1
- package/dist/Key.d.ts.map +1 -1
- package/dist/Sca.d.ts.map +1 -1
- package/dist/UnicodeIdentifiers.d.ts.map +1 -1
- package/dist/browser-noninvasive.d.ts.map +1 -1
- package/dist/indexeddbshim-Key.js +1844 -1669
- package/dist/indexeddbshim-Key.js.map +1 -1
- package/dist/indexeddbshim-Key.min.js +2 -2
- package/dist/indexeddbshim-Key.min.js.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +972 -1076
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.js +2704 -2034
- package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js +9 -2
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
- package/dist/indexeddbshim-node.cjs +972 -1076
- package/dist/indexeddbshim-node.cjs.map +1 -1
- package/dist/indexeddbshim-noninvasive.js +2703 -2033
- package/dist/indexeddbshim-noninvasive.js.map +1 -1
- package/dist/indexeddbshim-noninvasive.min.js +9 -2
- package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
- package/dist/indexeddbshim.js +2676 -2014
- package/dist/indexeddbshim.js.map +1 -1
- package/dist/indexeddbshim.min.js +9 -2
- package/dist/indexeddbshim.min.js.map +1 -1
- package/dist/node-UnicodeIdentifiers.d.ts +2 -2
- package/dist/node-UnicodeIdentifiers.d.ts.map +1 -1
- package/dist/node.d.ts +2 -2
- package/dist/node.d.ts.map +1 -1
- package/dist/util.d.ts.map +1 -1
- package/package.json +111 -103
- package/src/CFG.js +2 -3
- package/src/DOMException.js +11 -9
- package/src/DOMStringList.js +8 -3
- package/src/Event.js +2 -0
- package/src/IDBCursor.js +16 -9
- package/src/IDBDatabase.js +9 -6
- package/src/IDBFactory.js +21 -14
- package/src/IDBIndex.js +82 -77
- package/src/IDBKeyRange.js +42 -35
- package/src/IDBObjectStore.js +83 -77
- package/src/IDBRequest.js +28 -15
- package/src/IDBTransaction.js +8 -4
- package/src/IDBVersionChangeEvent.js +2 -0
- package/src/Key.js +18 -12
- package/src/Sca.js +2 -1
- package/src/UnicodeIdentifiers.js +2 -2
- package/src/browser-UnicodeIdentifiers.js +0 -1
- package/src/browser-noninvasive.js +0 -1
- package/src/browser.js +0 -1
- package/src/node-UnicodeIdentifiers.js +1 -1
- package/src/node.js +1 -1
- package/src/setGlobalVars.js +13 -13
- package/src/util.js +13 -12
|
@@ -2,7 +2,7 @@ export default __setGlobalVars;
|
|
|
2
2
|
/**
|
|
3
3
|
* @param {import('./setGlobalVars.js').ShimmedObject} idb
|
|
4
4
|
* @param {import('./CFG.js').default} initialConfig
|
|
5
|
-
* @returns {
|
|
5
|
+
* @returns {import('./setGlobalVars.js').ShimmedObject|Window}
|
|
6
6
|
*/
|
|
7
|
-
declare function __setGlobalVars(idb: import("./setGlobalVars.js").ShimmedObject, initialConfig?: any):
|
|
7
|
+
declare function __setGlobalVars(idb: import("./setGlobalVars.js").ShimmedObject, initialConfig?: any): import("./setGlobalVars.js").ShimmedObject | Window;
|
|
8
8
|
//# sourceMappingURL=node-UnicodeIdentifiers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-UnicodeIdentifiers.d.ts","sourceRoot":"","sources":["../src/node-UnicodeIdentifiers.js"],"names":[],"mappings":";AASA;;;;GAIG;AACH,sCAJW,OAAO,oBAAoB,EAAE,aAAa,wBAExC,EAAE,GAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"node-UnicodeIdentifiers.d.ts","sourceRoot":"","sources":["../src/node-UnicodeIdentifiers.js"],"names":[],"mappings":";AASA;;;;GAIG;AACH,sCAJW,OAAO,oBAAoB,EAAE,aAAa,wBAExC,OAAO,oBAAoB,EAAE,aAAa,GAAC,MAAM,CAW7D"}
|
package/dist/node.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export default __setGlobalVars;
|
|
|
2
2
|
/**
|
|
3
3
|
* @param {import('./setGlobalVars.js').ShimmedObject} idb
|
|
4
4
|
* @param {import('./CFG.js').default} initialConfig
|
|
5
|
-
* @returns {
|
|
5
|
+
* @returns {import('./setGlobalVars.js').ShimmedObject|Window}
|
|
6
6
|
*/
|
|
7
|
-
declare function __setGlobalVars(idb: import("./setGlobalVars.js").ShimmedObject, initialConfig?: any):
|
|
7
|
+
declare function __setGlobalVars(idb: import("./setGlobalVars.js").ShimmedObject, initialConfig?: any): import("./setGlobalVars.js").ShimmedObject | Window;
|
|
8
8
|
//# sourceMappingURL=node.d.ts.map
|
package/dist/node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.js"],"names":[],"mappings":";AAQA;;;;GAIG;AACH,sCAJW,OAAO,oBAAoB,EAAE,aAAa,wBAExC,EAAE,GAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.js"],"names":[],"mappings":";AAQA;;;;GAIG;AACH,sCAJW,OAAO,oBAAoB,EAAE,aAAa,wBAExC,OAAO,oBAAoB,EAAE,aAAa,GAAC,MAAM,CAI7D"}
|
package/dist/util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.js"],"names":[],"mappings":"sBAKa,MAAM;;uBAofN,GAAG;AA1chB;;;;GAIG;AACH,2CAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;GAGG;AACH,4CAHW,MAAM,GACJ,MAAM,CAUlB;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;;GAEG;AAGH;;;;;GAKG;AACH,gCAJW,QAAQ,QACR,QAAQ,GACN,OAAO,CAInB;AAED;;;;GAIG;AACH,2BAHW,QAAQ,GACN,GAAG,IAAI,MAAM,CAIzB;AAED;;;;GAIG;AACH,4BAHW,MAAM,GACJ,OAAO,CAInB;AAED;;;;GAIG;AACH,4BAHW,MAAM,GACJ,OAAO,CAKnB;AAED;;;;GAIG;AACH,8BAHW,MAAM,GACJ,OAAO,CAKnB;AAED;;;;GAIG;AACH,4BAHW,MAAM,GACJ,OAAO,CAKnB;AAED;;;;GAIG;AACH,8BAHW,QAAQ,GACN,OAAO,CAOnB;AAED;;;;GAIG;AACH,gCAHW,QAAQ,GACN,OAAO,CAOnB;AAED;;;;;GAKG;AACH,0CAJW,MAAM,SACN,MAAM,EAAE,GACN,IAAI,CAkBhB;AAED;;;;;GAKG;AACH,kDAJW,MAAM,SACN,MAAM,EAAE,GACN,IAAI,CAchB;AAED;;;;;;;GAOG;AACH,8CANW,MAAM,GAAG;IACnB,CAAK,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB,aACO,MAAM,EAAE,GACN,IAAI,CA2BhB;AAED;;;;;;;;GAQG;AACH,8CAPW,MAAM,SACN,MAAM,GAAC,MAAM,EAAE,WACf,IAAI,GAAC;IACf,CAAK,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB,GACS,IAAI,CA8BhB;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;AAWD;;;;GAIG;AACH,gDAHW,QAAQ,GACN,MAAM,GAAC,MAAM,EAAE,CAW3B;AAED;;;GAGG;AACH,6BAHW,QAAQ,GACN,CAAC,IAAI,IAAI,GAAC,SAAS,CAI/B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "indexeddbshim",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "Parashuram <code@nparashuram.com>",
|
|
6
6
|
"contributors": [
|
|
@@ -28,6 +28,78 @@
|
|
|
28
28
|
"test-support/**"
|
|
29
29
|
]
|
|
30
30
|
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"tsc": "tsc",
|
|
33
|
+
"tsc-prod": "tsc -p tsconfig-prod.json",
|
|
34
|
+
"build": "rm -R dist && npm run tsc-prod && npm run rollup",
|
|
35
|
+
"prepublishOnly": "npm run license-badges && npm run build",
|
|
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 .",
|
|
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
|
+
},
|
|
31
103
|
"repository": {
|
|
32
104
|
"type": "git",
|
|
33
105
|
"url": "https://github.com/indexeddbshim/IndexedDBShim"
|
|
@@ -81,136 +153,72 @@
|
|
|
81
153
|
"last 3 Samsung versions"
|
|
82
154
|
],
|
|
83
155
|
"engines": {
|
|
84
|
-
"node": "
|
|
156
|
+
"node": "^22.18.0 || >= 24.11.0"
|
|
85
157
|
},
|
|
86
158
|
"dependencies": {
|
|
87
|
-
"canvas": "^3.2.
|
|
159
|
+
"canvas": "^3.2.3",
|
|
88
160
|
"eventtargeter": "0.9.0",
|
|
89
161
|
"sync-promise-expanded": "^1.0.0",
|
|
90
|
-
"typeson": "
|
|
91
|
-
"typeson-registry": "
|
|
162
|
+
"typeson": "10.0.0",
|
|
163
|
+
"typeson-registry": "13.0.0",
|
|
92
164
|
"websql-configurable": "^3.0.3"
|
|
93
165
|
},
|
|
94
166
|
"devDependencies": {
|
|
95
|
-
"@babel/core": "^
|
|
96
|
-
"@babel/preset-env": "^
|
|
167
|
+
"@babel/core": "^8.0.1",
|
|
168
|
+
"@babel/preset-env": "^8.0.2",
|
|
97
169
|
"@brettz9/node-static": "^0.1.1",
|
|
98
170
|
"@es-joy/json-file-reporter": "^1.5.0",
|
|
99
|
-
"@rollup/plugin-babel": "^
|
|
100
|
-
"@rollup/plugin-commonjs": "^
|
|
171
|
+
"@rollup/plugin-babel": "^7.1.0",
|
|
172
|
+
"@rollup/plugin-commonjs": "^29.0.3",
|
|
173
|
+
"@rollup/plugin-inject": "^5.0.5",
|
|
101
174
|
"@rollup/plugin-json": "^6.1.0",
|
|
102
|
-
"@rollup/plugin-node-resolve": "^16.0.
|
|
103
|
-
"@rollup/plugin-terser": "^0.
|
|
104
|
-
"@types/node": "^
|
|
175
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
176
|
+
"@rollup/plugin-terser": "^1.0.0",
|
|
177
|
+
"@types/node": "^26.1.2",
|
|
105
178
|
"@types/websql": "^0.0.30",
|
|
106
|
-
"@unicode/unicode-17.0.0": "^1.6.
|
|
179
|
+
"@unicode/unicode-17.0.0": "^1.6.17",
|
|
107
180
|
"babel-plugin-add-module-exports": "1.0.4",
|
|
108
|
-
"bson": "^
|
|
109
|
-
"builtin-modules": "^5.
|
|
110
|
-
"c8": "^
|
|
111
|
-
"chai": "6.
|
|
181
|
+
"bson": "^7.3.1",
|
|
182
|
+
"builtin-modules": "^5.3.0",
|
|
183
|
+
"c8": "^12.0.0",
|
|
184
|
+
"chai": "6.2.2",
|
|
112
185
|
"chokidar-cli": "^3.0.0",
|
|
113
186
|
"colors": "1.4.0",
|
|
114
187
|
"copyfiles": "^2.4.1",
|
|
115
|
-
"core-js-bundle": "^3.
|
|
188
|
+
"core-js-bundle": "^3.49.0",
|
|
116
189
|
"coveradge": "^0.8.2",
|
|
117
190
|
"cyclonejs": "1.1.4",
|
|
118
|
-
"delay-cli": "^
|
|
119
|
-
"eslint": "^
|
|
120
|
-
"eslint-config-ash-nazg": "^
|
|
121
|
-
"globals": "^
|
|
122
|
-
"got": "^14.4.8",
|
|
191
|
+
"delay-cli": "^3.0.0",
|
|
192
|
+
"eslint": "^10.8.0",
|
|
193
|
+
"eslint-config-ash-nazg": "^41.0.0",
|
|
194
|
+
"globals": "^17.8.0",
|
|
123
195
|
"is-date-object": "1.1.0",
|
|
124
196
|
"isomorphic-fetch": "^3.0.0",
|
|
125
|
-
"jsdom": "^
|
|
197
|
+
"jsdom": "^30.0.0",
|
|
126
198
|
"license-badger": "^0.22.1",
|
|
127
199
|
"local-xmlhttprequest": "2.0.0",
|
|
128
|
-
"mocha": "^11.7.
|
|
200
|
+
"mocha": "^11.7.6",
|
|
129
201
|
"mocha-badge-generator": "^0.11.0",
|
|
130
202
|
"mocha-multi-reporters": "^1.5.1",
|
|
131
203
|
"npm-run-all": "^4.1.5",
|
|
132
|
-
"open-cli": "^
|
|
133
|
-
"rimraf": "^6.
|
|
134
|
-
"rollup": "^4.
|
|
204
|
+
"open-cli": "^9.0.0",
|
|
205
|
+
"rimraf": "^6.1.3",
|
|
206
|
+
"rollup": "^4.62.3",
|
|
135
207
|
"rollup-plugin-filesize": "^10.0.0",
|
|
136
|
-
"rollup-plugin-node-globals": "^1.4.0",
|
|
137
208
|
"rollup-plugin-node-polyfills": "^0.2.1",
|
|
138
|
-
"sinon": "^
|
|
209
|
+
"sinon": "^22.1.0",
|
|
139
210
|
"source-map-support": "0.5.21",
|
|
140
211
|
"sourcemap-transformer": "git+https://github.com/brettz9/sourcemap-transformer.git",
|
|
141
|
-
"typescript": "^
|
|
212
|
+
"typescript": "^6.0.3",
|
|
142
213
|
"w3c-blob": "0.0.1",
|
|
143
|
-
"ws": "^8.
|
|
214
|
+
"ws": "^8.21.1"
|
|
144
215
|
},
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"
|
|
149
|
-
"
|
|
150
|
-
"
|
|
151
|
-
"
|
|
152
|
-
"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\"}'",
|
|
153
|
-
"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\"",
|
|
154
|
-
"dev": "run-p start watch",
|
|
155
|
-
"clean": "run-p clean-sysDB clean-mocha clean-fake clean-mock clean-w3c clean-w3cOld",
|
|
156
|
-
"clean-sysDB": "rimraf __sysdb__*",
|
|
157
|
-
"clean-polyfill": "run-p clean-fake clean-mock clean-w3cOld clean-sysDB",
|
|
158
|
-
"clean-mocha": "rimraf D_indexeddbshim_test_database_* D_test.sqlite",
|
|
159
|
-
"clean-fake": "rimraf D_test0.*",
|
|
160
|
-
"clean-mock": "rimraf D_test_database*",
|
|
161
|
-
"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*",
|
|
162
|
-
"clean-w3cOld": "rimraf D_db.sqlite* D_test* D_database_name* D_idbtransaction*",
|
|
163
|
-
"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",
|
|
164
|
-
"lint": "eslint .",
|
|
165
|
-
"eslint": "npm run lint",
|
|
166
|
-
"sqlite-rebuild": "cd node_modules/sqlite3 && npm i",
|
|
167
|
-
"w3c-build-only": "node test-support/node-buildjs",
|
|
168
|
-
"w3c-build": "run-s clean-w3c w3c-build-only",
|
|
169
|
-
"fake": "run-s clean-fake coverage:fake clean-fake",
|
|
170
|
-
"mock": "run-s clean-mock coverage:mock clean-mock",
|
|
171
|
-
"w3c-old": "run-s clean-w3cOld coverage:w3cOld clean-w3cOld",
|
|
172
|
-
"tests-polyfill": "run-s clean-polyfill coverage:fake coverage:mock coverage:w3cOld",
|
|
173
|
-
"mocha": "run-s clean-mocha coverage:mocha clean-mocha",
|
|
174
|
-
"rollup": "rollup -c",
|
|
175
|
-
"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",
|
|
176
|
-
"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",
|
|
177
|
-
"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",
|
|
178
|
-
"coverage:w3c": "NODE_OPTIONS=--max_old_space_size=16384 c8 --silent --no-clean npm run w3c-test-only",
|
|
179
|
-
"test:w3c": "NODE_OPTIONS=--max_old_space_size=16384 NODE_OPTIONS=--trace-warnings node test-support/node-idb-test.js",
|
|
180
|
-
"w3c-test-only": "node --trace-warnings test-support/node-idb-test.js",
|
|
181
|
-
"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",
|
|
182
|
-
"coverage-badge": "coveradge badges/coverage-badge",
|
|
183
|
-
"coverage:report-only": "c8 report",
|
|
184
|
-
"coverage:report": "run-s coverage:report-only",
|
|
185
|
-
"remove-cache": "rimraf node_modules/.cache",
|
|
186
|
-
"remove-cov": "rimraf .nyc_output ",
|
|
187
|
-
"remove-results": "rimraf test-support/results/file*.json",
|
|
188
|
-
"coverage:polyfill": "run-s coverage:fake coverage:mock coverage:w3cOld",
|
|
189
|
-
"tests-badge": "mbg --fileGlob \"./test-support/results/file*.json\" --badge_output badges/tests-badge.svg",
|
|
190
|
-
"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",
|
|
191
|
-
"open-coverage-only": "open http://127.0.0.1:9999/coverage/lcov-report/",
|
|
192
|
-
"open-coverage": "run-p start open-coverage-only",
|
|
193
|
-
"test": "run-s lint coverage",
|
|
194
|
-
"submodules-init": "git submodule update --init --recursive",
|
|
195
|
-
"submodules-fetch": "git submodule foreach --recursive git fetch",
|
|
196
|
-
"submodules-merge": "git submodule foreach git merge origin master",
|
|
197
|
-
"submodules": "run-s submodules-init submodules-fetch submodules-merge",
|
|
198
|
-
"wpt": "run-p start web-platform-tests",
|
|
199
|
-
"web-platform-tests": "cd web-platform-tests && ./wpt serve",
|
|
200
|
-
"w3c-find-unused": "node test-support/find-unused.js",
|
|
201
|
-
"w3c": "run-s w3c-build w3c-test",
|
|
202
|
-
"w3c-add-wrap": "node test-support/wrap-w3c-tests",
|
|
203
|
-
"w3c-remove-wrap": "node test-support/wrap-w3c-tests remove",
|
|
204
|
-
"w3c-wrap": "node test-support/wrap-w3c-tests",
|
|
205
|
-
"test-and-start:w3c": "run-p -r start web-platform-tests delayed-w3c-test",
|
|
206
|
-
"delay": "delay 9",
|
|
207
|
-
"delayed-w3c-test": "run-s delay test:w3c",
|
|
208
|
-
"w3c-test": "run-s clean-w3c test-and-start:w3c",
|
|
209
|
-
"w3c-good-only": "node test-support/node-idb-test.js good",
|
|
210
|
-
"w3c-bad-only": "node test-support/node-idb-test.js bad",
|
|
211
|
-
"w3c-good": "run-s w3c-build w3c-good-only clean-w3c",
|
|
212
|
-
"w3c-bad": "run-s w3c-build w3c-bad-only clean-w3c",
|
|
213
|
-
"w3c-good-test": "run-s w3c-good-only clean-w3c",
|
|
214
|
-
"w3c-bad-test": "run-s w3c-bad-only clean-w3c"
|
|
216
|
+
"allowScripts": {
|
|
217
|
+
"es5-ext@0.10.64": true,
|
|
218
|
+
"fsevents@2.3.3": true,
|
|
219
|
+
"sqlite3@5.1.7": true,
|
|
220
|
+
"canvas@3.2.3": true,
|
|
221
|
+
"core-js-bundle@3.49.0": true,
|
|
222
|
+
"unrs-resolver@1.12.2": true
|
|
215
223
|
}
|
|
216
|
-
}
|
|
224
|
+
}
|
package/src/CFG.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
/* eslint-disable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/147 */
|
|
2
1
|
/**
|
|
3
2
|
* @typedef {T[keyof T]} ValueOf<T>
|
|
4
3
|
* @template T
|
|
5
4
|
*/
|
|
6
|
-
/* eslint-enable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/147 */
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
* @typedef {{unlink: (path: string, cb: import('fs').NoParamCallback) => void}} FSApi
|
|
@@ -66,6 +64,7 @@ const CFG = /** @type {ConfigValues} */ ({});
|
|
|
66
64
|
*/
|
|
67
65
|
|
|
68
66
|
/** @type {Config} */
|
|
67
|
+
// eslint-disable-next-line unicorn/no-top-level-side-effects -- Would be good
|
|
69
68
|
([
|
|
70
69
|
// Boolean for verbose reporting
|
|
71
70
|
'DEBUG', // Effectively defaults to false (ignored unless `true`)
|
|
@@ -84,7 +83,7 @@ const CFG = /** @type {ConfigValues} */ ({});
|
|
|
84
83
|
// calls required for full WebIDL compliance will be used. Probably
|
|
85
84
|
// only needed for testing or environments where full introspection
|
|
86
85
|
// on class relationships is required; see
|
|
87
|
-
//
|
|
86
|
+
// https://stackoverflow.com/questions/41927589/rationales-consequences-of-webidl-class-inheritance-requirements
|
|
88
87
|
'fullIDLSupport', // Effectively defaults to false (ignored unless `true`)
|
|
89
88
|
|
|
90
89
|
// Boolean on whether to perform origin checks in `IDBFactory` methods
|
package/src/DOMException.js
CHANGED
|
@@ -117,7 +117,7 @@ function createNonNativeDOMExceptionClass () {
|
|
|
117
117
|
function DOMException (message, name) {
|
|
118
118
|
// const err = Error.prototype.constructor.call(this, message); // Any use to this? Won't set this.message
|
|
119
119
|
this[Symbol.toStringTag] = 'DOMException';
|
|
120
|
-
this._code = name
|
|
120
|
+
this._code = Object.hasOwn(codes, name)
|
|
121
121
|
? codes[/** @type {Code} */ (name)]
|
|
122
122
|
: (legacyCodes[/** @type {LegacyCode} */ (name)] || 0);
|
|
123
123
|
this._name = name || 'Error';
|
|
@@ -259,15 +259,17 @@ function createNonNativeDOMException (name, message) {
|
|
|
259
259
|
* @returns {void}
|
|
260
260
|
*/
|
|
261
261
|
function logError (name, message, error) {
|
|
262
|
-
if (CFG.DEBUG) {
|
|
263
|
-
|
|
264
|
-
? error.message
|
|
265
|
-
: /** @type {string} */ (error);
|
|
266
|
-
|
|
267
|
-
const method = typeof (console.error) === 'function' ? 'error' : 'log';
|
|
268
|
-
console[method](name + ': ' + message + '. ' + (msg || ''));
|
|
269
|
-
if (console.trace) { console.trace(); }
|
|
262
|
+
if (!CFG.DEBUG) {
|
|
263
|
+
return;
|
|
270
264
|
}
|
|
265
|
+
|
|
266
|
+
const msg = error && typeof error === 'object' && error.message
|
|
267
|
+
? error.message
|
|
268
|
+
: /** @type {string} */ (error);
|
|
269
|
+
|
|
270
|
+
const method = typeof (console.error) === 'function' ? 'error' : 'log';
|
|
271
|
+
console[method](name + ': ' + message + '. ' + (msg || ''));
|
|
272
|
+
if (console.trace) { console.trace(); }
|
|
271
273
|
}
|
|
272
274
|
|
|
273
275
|
/**
|
package/src/DOMStringList.js
CHANGED
|
@@ -70,7 +70,9 @@ DOMStringList.prototype = {
|
|
|
70
70
|
if (!arguments.length) {
|
|
71
71
|
throw new TypeError('DOMStringList.item must be supplied a value');
|
|
72
72
|
}
|
|
73
|
-
if (key < 0 || key >= this.length ||
|
|
73
|
+
if (key < 0 || key >= this.length ||
|
|
74
|
+
// eslint-disable-next-line unicorn/prefer-number-is-safe-integer -- We want all
|
|
75
|
+
!Number.isInteger(key)) {
|
|
74
76
|
return null;
|
|
75
77
|
}
|
|
76
78
|
return this._items[key];
|
|
@@ -101,8 +103,9 @@ DOMStringList.prototype = {
|
|
|
101
103
|
* @returns {string[]}
|
|
102
104
|
*/
|
|
103
105
|
sortList () {
|
|
104
|
-
//
|
|
106
|
+
// https://w3c.github.io/IndexedDB/#sorted-list
|
|
105
107
|
// https://tc39.github.io/ecma262/#sec-abstract-relational-comparison
|
|
108
|
+
// eslint-disable-next-line unicorn/require-array-sort-compare -- IndexedDB requires code unit comparison (default behavior)
|
|
106
109
|
this._items.sort();
|
|
107
110
|
this.addIndexes();
|
|
108
111
|
return this._items;
|
|
@@ -154,7 +157,7 @@ DOMStringList.prototype = {
|
|
|
154
157
|
this._items.splice(...args);
|
|
155
158
|
this._length = this._items.length;
|
|
156
159
|
for (const i in this) {
|
|
157
|
-
if (i === String(
|
|
160
|
+
if (i === String(Math.trunc(Number(i)))) {
|
|
158
161
|
delete this[i];
|
|
159
162
|
}
|
|
160
163
|
}
|
|
@@ -174,6 +177,7 @@ DOMStringList.prototype = {
|
|
|
174
177
|
}
|
|
175
178
|
};
|
|
176
179
|
|
|
180
|
+
/* eslint-disable unicorn/no-top-level-side-effects -- Would be good */
|
|
177
181
|
/**
|
|
178
182
|
* @typedef {any} AnyValue
|
|
179
183
|
*/
|
|
@@ -188,6 +192,7 @@ Object.defineProperty(DOMStringList, Symbol.hasInstance, {
|
|
|
188
192
|
});
|
|
189
193
|
const DOMStringListAlias = DOMStringList;
|
|
190
194
|
Object.defineProperty(DOMStringList, '__createInstance', {
|
|
195
|
+
/* eslint-enable unicorn/no-top-level-side-effects -- Would be good */
|
|
191
196
|
/**
|
|
192
197
|
* @returns {DOMStringListFull}
|
|
193
198
|
*/
|
package/src/Event.js
CHANGED
|
@@ -21,8 +21,10 @@ function createEvent (type, debug, evInit) {
|
|
|
21
21
|
return ev;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
/* eslint-disable unicorn/no-top-level-side-effects -- Would be good */
|
|
24
25
|
// We don't add within polyfill repo as might not always be the desired implementation
|
|
25
26
|
Object.defineProperty(ShimEvent, Symbol.hasInstance, {
|
|
27
|
+
/* eslint-enable unicorn/no-top-level-side-effects -- Would be good */
|
|
26
28
|
/**
|
|
27
29
|
* @typedef {any} AnyValue
|
|
28
30
|
*/
|
package/src/IDBCursor.js
CHANGED
|
@@ -58,6 +58,7 @@ import CFG from './CFG.js';
|
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* @class
|
|
61
|
+
* @throws {TypeError}
|
|
61
62
|
*/
|
|
62
63
|
function IDBCursor () {
|
|
63
64
|
throw new TypeError('Illegal constructor');
|
|
@@ -67,7 +68,7 @@ const IDBCursorAlias = IDBCursor;
|
|
|
67
68
|
/* eslint-disable func-name-matching -- API */
|
|
68
69
|
/**
|
|
69
70
|
* The IndexedDB Cursor Object.
|
|
70
|
-
* @see
|
|
71
|
+
* @see https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBCursor
|
|
71
72
|
* @param {IDBKeyRange} query
|
|
72
73
|
* @param {string} direction
|
|
73
74
|
* @param {import('./IDBObjectStore.js').IDBObjectStoreFull} store
|
|
@@ -151,11 +152,10 @@ IDBCursor.__createInstance = function (...args) {
|
|
|
151
152
|
* @returns {void}
|
|
152
153
|
*/
|
|
153
154
|
IDBCursor.prototype.__find = function (...args /* key, tx, success, error, recordsToLoad */) {
|
|
155
|
+
const [key, primaryKey, tx, success, error, recordsToLoad] = args;
|
|
154
156
|
if (this.__multiEntryIndex) {
|
|
155
|
-
const [key, primaryKey, tx, success, error, recordsToLoad] = args;
|
|
156
157
|
this.__findMultiEntry(key, primaryKey, tx, success, error, recordsToLoad);
|
|
157
158
|
} else {
|
|
158
|
-
const [key, primaryKey, tx, success, error, recordsToLoad] = args;
|
|
159
159
|
this.__findBasic(key, primaryKey, tx, success, error, recordsToLoad);
|
|
160
160
|
}
|
|
161
161
|
};
|
|
@@ -185,7 +185,7 @@ IDBCursor.prototype.__find = function (...args /* key, tx, success, error, recor
|
|
|
185
185
|
*/
|
|
186
186
|
IDBCursor.prototype.__findBasic = function (key, primaryKey, tx, success, error, recordsToLoad) {
|
|
187
187
|
const continueCall = recordsToLoad !== undefined;
|
|
188
|
-
recordsToLoad
|
|
188
|
+
recordsToLoad ||= 1;
|
|
189
189
|
|
|
190
190
|
const me = this;
|
|
191
191
|
const quotedKeyColumnName = util.sqlQuote(me.__keyColumnName);
|
|
@@ -366,10 +366,10 @@ IDBCursor.prototype.__findMultiEntry = function (key, primaryKey, tx, success, e
|
|
|
366
366
|
matchingKey: /** @type {string} */ (
|
|
367
367
|
Key.encode(matchingKey, true)
|
|
368
368
|
),
|
|
369
|
-
key: rowItem.key
|
|
369
|
+
key: rowItem.key,
|
|
370
|
+
[me.__keyColumnName]: rowItem[me.__keyColumnName],
|
|
371
|
+
[me.__valueColumnName]: rowItem[me.__valueColumnName]
|
|
370
372
|
};
|
|
371
|
-
clone[me.__keyColumnName] = rowItem[me.__keyColumnName];
|
|
372
|
-
clone[me.__valueColumnName] = rowItem[me.__valueColumnName];
|
|
373
373
|
rows.push(clone);
|
|
374
374
|
}
|
|
375
375
|
}
|
|
@@ -496,7 +496,7 @@ IDBCursor.prototype.__decode = function (rowItem, callback) {
|
|
|
496
496
|
if (!me.__matchedKeys) {
|
|
497
497
|
me.__matchedKeys = {};
|
|
498
498
|
}
|
|
499
|
-
if (me.__matchedKeys[rowItem.matchingKey]) {
|
|
499
|
+
if (me.__matchedKeys[rowItem.matchingKey] === true) {
|
|
500
500
|
callback(undefined, undefined, undefined);
|
|
501
501
|
return;
|
|
502
502
|
}
|
|
@@ -779,6 +779,7 @@ IDBCursor.prototype.update = function (valueToUpdate) {
|
|
|
779
779
|
if (cmp(me.primaryKey, evaluatedKey) !== 0) {
|
|
780
780
|
throw createDOMException('DataError', 'The key of the supplied value to `update` is not equal to the cursor\'s effective key');
|
|
781
781
|
}
|
|
782
|
+
// eslint-disable-next-line unicorn/prefer-hoisting-branch-code -- Different
|
|
782
783
|
addToQueue(clonedValue);
|
|
783
784
|
} else {
|
|
784
785
|
const clonedValue = Sca.clone(valueToUpdate);
|
|
@@ -836,6 +837,7 @@ IDBCursor.prototype.delete = function () {
|
|
|
836
837
|
|
|
837
838
|
IDBCursor.prototype[Symbol.toStringTag] = 'IDBCursorPrototype';
|
|
838
839
|
|
|
840
|
+
/* eslint-disable unicorn/no-top-level-side-effects -- Would be good */
|
|
839
841
|
util.defineReadonlyOuterInterface(
|
|
840
842
|
IDBCursor.prototype,
|
|
841
843
|
['source', 'direction', 'key', 'primaryKey', 'request']
|
|
@@ -843,14 +845,17 @@ util.defineReadonlyOuterInterface(
|
|
|
843
845
|
Object.defineProperty(IDBCursor, 'prototype', {
|
|
844
846
|
writable: false
|
|
845
847
|
});
|
|
848
|
+
/* eslint-enable unicorn/no-top-level-side-effects -- Would be good */
|
|
846
849
|
|
|
847
850
|
/**
|
|
848
851
|
* @class
|
|
852
|
+
* @throws {TypeError}
|
|
849
853
|
*/
|
|
850
854
|
function IDBCursorWithValue () {
|
|
851
855
|
throw new TypeError('Illegal constructor');
|
|
852
856
|
}
|
|
853
857
|
|
|
858
|
+
/* eslint-disable unicorn/no-top-level-side-effects -- Would be good */
|
|
854
859
|
// @ts-expect-error It's ok
|
|
855
860
|
IDBCursorWithValue.prototype = Object.create(IDBCursor.prototype);
|
|
856
861
|
Object.defineProperty(IDBCursorWithValue.prototype, 'constructor', {
|
|
@@ -859,6 +864,7 @@ Object.defineProperty(IDBCursorWithValue.prototype, 'constructor', {
|
|
|
859
864
|
configurable: true,
|
|
860
865
|
value: IDBCursorWithValue
|
|
861
866
|
});
|
|
867
|
+
/* eslint-enable unicorn/no-top-level-side-effects -- Would be good */
|
|
862
868
|
|
|
863
869
|
const IDBCursorWithValueAlias = IDBCursorWithValue;
|
|
864
870
|
/**
|
|
@@ -884,12 +890,13 @@ IDBCursorWithValue.__createInstance = function (...args) {
|
|
|
884
890
|
return new IDBCursorWithValue();
|
|
885
891
|
};
|
|
886
892
|
|
|
893
|
+
/* eslint-disable unicorn/no-top-level-side-effects -- Would be good */
|
|
887
894
|
util.defineReadonlyOuterInterface(IDBCursorWithValue.prototype, ['value']);
|
|
888
|
-
|
|
889
895
|
IDBCursorWithValue.prototype[Symbol.toStringTag] = 'IDBCursorWithValuePrototype';
|
|
890
896
|
|
|
891
897
|
Object.defineProperty(IDBCursorWithValue, 'prototype', {
|
|
892
898
|
writable: false
|
|
893
899
|
});
|
|
900
|
+
/* eslint-enable unicorn/no-top-level-side-effects -- Would be good */
|
|
894
901
|
|
|
895
902
|
export {IDBCursor, IDBCursorWithValue};
|
package/src/IDBDatabase.js
CHANGED
|
@@ -23,8 +23,9 @@ const readonlyProperties = ['name', 'version', 'objectStoreNames'];
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* IDB Database Object.
|
|
26
|
-
* @see
|
|
26
|
+
* @see https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#database-interface
|
|
27
27
|
* @class
|
|
28
|
+
* @throws {TypeError}
|
|
28
29
|
*/
|
|
29
30
|
function IDBDatabase () {
|
|
30
31
|
this.__versionTransaction = null;
|
|
@@ -165,7 +166,7 @@ IDBDatabase.prototype.createObjectStore = function (storeName /* , createOptions
|
|
|
165
166
|
throw createDOMException('SyntaxError', 'The keyPath argument contains an invalid key path.');
|
|
166
167
|
}
|
|
167
168
|
|
|
168
|
-
if (this.__objectStores
|
|
169
|
+
if (Object.hasOwn(this.__objectStores, storeName) && !this.__objectStores[storeName].__pendingDelete) {
|
|
169
170
|
throw createDOMException('ConstraintError', 'Object store "' + storeName + '" already exists in ' + this.name);
|
|
170
171
|
}
|
|
171
172
|
|
|
@@ -244,7 +245,8 @@ IDBDatabase.prototype.transaction = function (storeNames /* , mode */) {
|
|
|
244
245
|
// Creating new array also ensures sequence is passed by value: https://heycam.github.io/webidl/#idl-sequence
|
|
245
246
|
? [...new Set( // to be unique
|
|
246
247
|
util.convertToSequenceDOMString(storeNames) // iterables have `ToString` applied (and we convert to array for convenience)
|
|
247
|
-
|
|
248
|
+
// eslint-disable-next-line unicorn/require-array-sort-compare -- IndexedDB requires code unit comparison (default behavior)
|
|
249
|
+
)].toSorted() // must be sorted
|
|
248
250
|
: [util.convertToDOMString(storeNames)];
|
|
249
251
|
|
|
250
252
|
/* (function () {
|
|
@@ -258,7 +260,7 @@ IDBDatabase.prototype.transaction = function (storeNames /* , mode */) {
|
|
|
258
260
|
// prioritizing readonly but not starving readwrite).
|
|
259
261
|
// Even for readonly transactions, due to [issue 17](https://github.com/nolanlawson/node-websql/issues/17),
|
|
260
262
|
// we're not currently actually running the SQL requests in parallel.
|
|
261
|
-
mode
|
|
263
|
+
mode ||= 'readonly';
|
|
262
264
|
|
|
263
265
|
IDBTransaction.__assertNotVersionChange(this.__versionTransaction);
|
|
264
266
|
if (this.__closePending) {
|
|
@@ -321,7 +323,7 @@ IDBDatabase.prototype.__forceClose = function (msg) {
|
|
|
321
323
|
const evt = createEvent('close');
|
|
322
324
|
setTimeout(() => {
|
|
323
325
|
me.dispatchEvent(evt);
|
|
324
|
-
});
|
|
326
|
+
}, 0);
|
|
325
327
|
}
|
|
326
328
|
};
|
|
327
329
|
trans.__abortTransaction(createDOMException(
|
|
@@ -331,7 +333,7 @@ IDBDatabase.prototype.__forceClose = function (msg) {
|
|
|
331
333
|
});
|
|
332
334
|
me.__transactions = [];
|
|
333
335
|
};
|
|
334
|
-
|
|
336
|
+
/* eslint-disable unicorn/no-top-level-side-effects -- Would be good */
|
|
335
337
|
util.defineOuterInterface(IDBDatabase.prototype, listeners);
|
|
336
338
|
util.defineReadonlyOuterInterface(IDBDatabase.prototype, readonlyProperties);
|
|
337
339
|
|
|
@@ -345,5 +347,6 @@ Object.defineProperty(IDBDatabase.prototype, 'constructor', {
|
|
|
345
347
|
Object.defineProperty(IDBDatabase, 'prototype', {
|
|
346
348
|
writable: false
|
|
347
349
|
});
|
|
350
|
+
/* eslint-enable unicorn/no-top-level-side-effects -- Would be good */
|
|
348
351
|
|
|
349
352
|
export default IDBDatabase;
|