indexeddbshim 16.0.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 +4 -4
- 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 +5 -2
- 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 +32 -27
- 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 +984 -1092
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.js +1220 -1233
- package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js +8 -3
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
- package/dist/indexeddbshim-node.cjs +984 -1092
- package/dist/indexeddbshim-node.cjs.map +1 -1
- package/dist/indexeddbshim-noninvasive.js +1219 -1232
- package/dist/indexeddbshim-noninvasive.js.map +1 -1
- package/dist/indexeddbshim-noninvasive.min.js +8 -3
- package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
- package/dist/indexeddbshim.js +1219 -1232
- package/dist/indexeddbshim.js.map +1 -1
- package/dist/indexeddbshim.min.js +8 -3
- 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/setGlobalVars.d.ts.map +1 -1
- package/dist/util.d.ts.map +1 -1
- package/package.json +112 -105
- 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 +22 -11
- package/src/IDBDatabase.js +9 -6
- package/src/IDBFactory.js +21 -15
- 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 +22 -12
- package/src/Sca.js +2 -1
- package/src/UnicodeIdentifiers.js +2 -2
- package/src/browser-UnicodeIdentifiers.js +1 -2
- 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 -15
- package/src/unicode-regex.js +1 -1
- 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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setGlobalVars.d.ts","sourceRoot":"","sources":["../src/setGlobalVars.js"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"setGlobalVars.d.ts","sourceRoot":"","sources":["../src/setGlobalVars.js"],"names":[],"mappings":";;uBAkBa,GAAG;+BAKL,OAAO,UAAU,EAAE,iBAAiB,GAC1C,OAAO,CAAC,OAAO,UAAU,EAAE,YAAY,CAAC,QAClC,QAAQ;wBAoCN,CACR,IAAI,EAAE,OAAO,UAAU,EAAE,iBAAiB,KACvC,OAAO,UAAU,EAAE,WAAW;oCAIzB,CAAC,GAAG,EAAE;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAA;CAC1B,KAAK,IAAI;4BAIA,CAAC,UAAU,GAAC,MAAM,CAAC,GAAG;IAC5B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IAChC,WAAW,EAAE,SAAS,CAAC;IACvB,WAAW,EAAE,SAAS,CAAC;IACvB,uBAAuB,EAAE,qBAAqB,CAAC;IAC/C,0BAA0B,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CACtD;sBAIO,MAAM;4BAIN,CAAC,OAAO,UAAU,GAAC,MAAM,CAAC,GAAG;IACrC,SAAS,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAChC,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B;mCAhG+C,mBAAmB;AAwDtE;;;;GAIG;AAEH;;;;;GAKG;AAEH;;;;;;;;;GASG;AAEH;;GAEG;AAEH;;;;;;;;;;;;;GAaG;AAEH;;;;;GAKG;AACH,qCAJW,aAAa,kBACb,OAAO,UAAU,EAAE,YAAY,GAC7B,aAAa,CAkSzB;2BAxY8C,iBAAiB"}
|
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"
|
|
@@ -64,7 +136,6 @@
|
|
|
64
136
|
"websql"
|
|
65
137
|
],
|
|
66
138
|
"browserslist": [
|
|
67
|
-
"cover 100%",
|
|
68
139
|
"last 3 Chrome versions",
|
|
69
140
|
"last 3 Firefox versions",
|
|
70
141
|
"last 3 Edge versions",
|
|
@@ -72,7 +143,6 @@
|
|
|
72
143
|
"last 3 ios_saf versions",
|
|
73
144
|
"last 3 Android versions",
|
|
74
145
|
"last 3 Opera versions",
|
|
75
|
-
"last 3 IE versions",
|
|
76
146
|
"last 3 op_mini versions",
|
|
77
147
|
"last 3 bb versions",
|
|
78
148
|
"last 3 op_mob versions",
|
|
@@ -83,135 +153,72 @@
|
|
|
83
153
|
"last 3 Samsung versions"
|
|
84
154
|
],
|
|
85
155
|
"engines": {
|
|
86
|
-
"node": "
|
|
156
|
+
"node": "^22.18.0 || >= 24.11.0"
|
|
87
157
|
},
|
|
88
158
|
"dependencies": {
|
|
89
|
-
"canvas": "^3.
|
|
159
|
+
"canvas": "^3.2.3",
|
|
90
160
|
"eventtargeter": "0.9.0",
|
|
91
161
|
"sync-promise-expanded": "^1.0.0",
|
|
92
|
-
"typeson": "
|
|
93
|
-
"typeson-registry": "
|
|
162
|
+
"typeson": "10.0.0",
|
|
163
|
+
"typeson-registry": "13.0.0",
|
|
94
164
|
"websql-configurable": "^3.0.3"
|
|
95
165
|
},
|
|
96
166
|
"devDependencies": {
|
|
97
|
-
"@babel/core": "^
|
|
98
|
-
"@babel/preset-env": "^
|
|
167
|
+
"@babel/core": "^8.0.1",
|
|
168
|
+
"@babel/preset-env": "^8.0.2",
|
|
99
169
|
"@brettz9/node-static": "^0.1.1",
|
|
100
170
|
"@es-joy/json-file-reporter": "^1.5.0",
|
|
101
|
-
"@rollup/plugin-babel": "^
|
|
102
|
-
"@rollup/plugin-commonjs": "^
|
|
171
|
+
"@rollup/plugin-babel": "^7.1.0",
|
|
172
|
+
"@rollup/plugin-commonjs": "^29.0.3",
|
|
173
|
+
"@rollup/plugin-inject": "^5.0.5",
|
|
103
174
|
"@rollup/plugin-json": "^6.1.0",
|
|
104
|
-
"@rollup/plugin-node-resolve": "^16.0.
|
|
105
|
-
"@rollup/plugin-terser": "^0.
|
|
106
|
-
"@types/node": "^
|
|
175
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
176
|
+
"@rollup/plugin-terser": "^1.0.0",
|
|
177
|
+
"@types/node": "^26.1.2",
|
|
107
178
|
"@types/websql": "^0.0.30",
|
|
108
|
-
"@unicode/unicode-
|
|
179
|
+
"@unicode/unicode-17.0.0": "^1.6.17",
|
|
109
180
|
"babel-plugin-add-module-exports": "1.0.4",
|
|
110
|
-
"bson": "^
|
|
111
|
-
"builtin-modules": "^5.
|
|
112
|
-
"c8": "^
|
|
113
|
-
"chai": "
|
|
181
|
+
"bson": "^7.3.1",
|
|
182
|
+
"builtin-modules": "^5.3.0",
|
|
183
|
+
"c8": "^12.0.0",
|
|
184
|
+
"chai": "6.2.2",
|
|
114
185
|
"chokidar-cli": "^3.0.0",
|
|
115
186
|
"colors": "1.4.0",
|
|
116
187
|
"copyfiles": "^2.4.1",
|
|
117
|
-
"core-js-bundle": "^3.
|
|
188
|
+
"core-js-bundle": "^3.49.0",
|
|
118
189
|
"coveradge": "^0.8.2",
|
|
119
190
|
"cyclonejs": "1.1.4",
|
|
120
|
-
"delay-cli": "^
|
|
121
|
-
"eslint": "^
|
|
122
|
-
"eslint-config-ash-nazg": "^
|
|
123
|
-
"
|
|
191
|
+
"delay-cli": "^3.0.0",
|
|
192
|
+
"eslint": "^10.8.0",
|
|
193
|
+
"eslint-config-ash-nazg": "^41.0.0",
|
|
194
|
+
"globals": "^17.8.0",
|
|
124
195
|
"is-date-object": "1.1.0",
|
|
125
196
|
"isomorphic-fetch": "^3.0.0",
|
|
126
|
-
"jsdom": "^
|
|
127
|
-
"license-badger": "^0.
|
|
197
|
+
"jsdom": "^30.0.0",
|
|
198
|
+
"license-badger": "^0.22.1",
|
|
128
199
|
"local-xmlhttprequest": "2.0.0",
|
|
129
|
-
"mocha": "^11.6
|
|
200
|
+
"mocha": "^11.7.6",
|
|
130
201
|
"mocha-badge-generator": "^0.11.0",
|
|
131
202
|
"mocha-multi-reporters": "^1.5.1",
|
|
132
203
|
"npm-run-all": "^4.1.5",
|
|
133
|
-
"open-cli": "^
|
|
134
|
-
"rimraf": "^6.
|
|
135
|
-
"rollup": "^4.
|
|
204
|
+
"open-cli": "^9.0.0",
|
|
205
|
+
"rimraf": "^6.1.3",
|
|
206
|
+
"rollup": "^4.62.3",
|
|
136
207
|
"rollup-plugin-filesize": "^10.0.0",
|
|
137
|
-
"rollup-plugin-node-globals": "^1.4.0",
|
|
138
208
|
"rollup-plugin-node-polyfills": "^0.2.1",
|
|
139
|
-
"sinon": "^
|
|
209
|
+
"sinon": "^22.1.0",
|
|
140
210
|
"source-map-support": "0.5.21",
|
|
141
211
|
"sourcemap-transformer": "git+https://github.com/brettz9/sourcemap-transformer.git",
|
|
142
|
-
"typescript": "^
|
|
212
|
+
"typescript": "^6.0.3",
|
|
143
213
|
"w3c-blob": "0.0.1",
|
|
144
|
-
"ws": "^8.
|
|
214
|
+
"ws": "^8.21.1"
|
|
145
215
|
},
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"
|
|
149
|
-
"
|
|
150
|
-
"
|
|
151
|
-
"
|
|
152
|
-
"
|
|
153
|
-
"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\"}'",
|
|
154
|
-
"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\"",
|
|
155
|
-
"dev": "run-p start watch",
|
|
156
|
-
"clean": "run-p clean-sysDB clean-mocha clean-fake clean-mock clean-w3c clean-w3cOld",
|
|
157
|
-
"clean-sysDB": "rimraf __sysdb__*",
|
|
158
|
-
"clean-polyfill": "run-p clean-fake clean-mock clean-w3cOld clean-sysDB",
|
|
159
|
-
"clean-mocha": "rimraf D_indexeddbshim_test_database_* D_test.sqlite",
|
|
160
|
-
"clean-fake": "rimraf D_test0.*",
|
|
161
|
-
"clean-mock": "rimraf D_test_database*",
|
|
162
|
-
"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*",
|
|
163
|
-
"clean-w3cOld": "rimraf D_db.sqlite* D_test* D_database_name* D_idbtransaction*",
|
|
164
|
-
"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",
|
|
165
|
-
"lint": "eslint .",
|
|
166
|
-
"eslint": "npm run lint",
|
|
167
|
-
"sqlite-rebuild": "cd node_modules/sqlite3 && npm i",
|
|
168
|
-
"w3c-build-only": "node test-support/node-buildjs",
|
|
169
|
-
"w3c-build": "run-s clean-w3c w3c-build-only",
|
|
170
|
-
"fake": "run-s clean-fake coverage:fake clean-fake",
|
|
171
|
-
"mock": "run-s clean-mock coverage:mock clean-mock",
|
|
172
|
-
"w3c-old": "run-s clean-w3cOld coverage:w3cOld clean-w3cOld",
|
|
173
|
-
"tests-polyfill": "run-s clean-polyfill coverage:fake coverage:mock coverage:w3cOld",
|
|
174
|
-
"mocha": "run-s clean-mocha coverage:mocha clean-mocha",
|
|
175
|
-
"rollup": "rollup -c",
|
|
176
|
-
"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",
|
|
177
|
-
"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",
|
|
178
|
-
"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",
|
|
179
|
-
"coverage:w3c": "NODE_OPTIONS=--max_old_space_size=16384 c8 --silent --no-clean npm run w3c-test-only",
|
|
180
|
-
"test:w3c": "NODE_OPTIONS=--max_old_space_size=16384 NODE_OPTIONS=--trace-warnings node test-support/node-idb-test.js",
|
|
181
|
-
"w3c-test-only": "node --trace-warnings test-support/node-idb-test.js",
|
|
182
|
-
"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",
|
|
183
|
-
"coverage-badge": "coveradge badges/coverage-badge",
|
|
184
|
-
"coverage:report-only": "c8 report",
|
|
185
|
-
"coverage:report": "run-s coverage:report-only",
|
|
186
|
-
"remove-cache": "rimraf node_modules/.cache",
|
|
187
|
-
"remove-cov": "rimraf .nyc_output ",
|
|
188
|
-
"remove-results": "rimraf test-support/results/file*.json",
|
|
189
|
-
"coverage:polyfill": "run-s coverage:fake coverage:mock coverage:w3cOld",
|
|
190
|
-
"tests-badge": "mbg --fileGlob \"./test-support/results/file*.json\" --badge_output badges/tests-badge.svg",
|
|
191
|
-
"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",
|
|
192
|
-
"open-coverage-only": "open http://127.0.0.1:9999/coverage/lcov-report/",
|
|
193
|
-
"open-coverage": "run-p start open-coverage-only",
|
|
194
|
-
"test": "run-s lint coverage",
|
|
195
|
-
"submodules-init": "git submodule update --init --recursive",
|
|
196
|
-
"submodules-fetch": "git submodule foreach --recursive git fetch",
|
|
197
|
-
"submodules-merge": "git submodule foreach git merge origin master",
|
|
198
|
-
"submodules": "run-s submodules-init submodules-fetch submodules-merge",
|
|
199
|
-
"wpt": "run-p start web-platform-tests",
|
|
200
|
-
"web-platform-tests": "cd web-platform-tests && ./wpt serve",
|
|
201
|
-
"w3c-find-unused": "node test-support/find-unused.js",
|
|
202
|
-
"w3c": "run-s w3c-build w3c-test",
|
|
203
|
-
"w3c-add-wrap": "node test-support/wrap-w3c-tests",
|
|
204
|
-
"w3c-remove-wrap": "node test-support/wrap-w3c-tests remove",
|
|
205
|
-
"w3c-wrap": "node test-support/wrap-w3c-tests",
|
|
206
|
-
"test-and-start:w3c": "run-p -r start web-platform-tests delayed-w3c-test",
|
|
207
|
-
"delay": "delay 9",
|
|
208
|
-
"delayed-w3c-test": "run-s delay test:w3c",
|
|
209
|
-
"w3c-test": "run-s clean-w3c test-and-start:w3c",
|
|
210
|
-
"w3c-good-only": "node test-support/node-idb-test.js good",
|
|
211
|
-
"w3c-bad-only": "node test-support/node-idb-test.js bad",
|
|
212
|
-
"w3c-good": "run-s w3c-build w3c-good-only clean-w3c",
|
|
213
|
-
"w3c-bad": "run-s w3c-build w3c-bad-only clean-w3c",
|
|
214
|
-
"w3c-good-test": "run-s w3c-good-only clean-w3c",
|
|
215
|
-
"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
|
|
216
223
|
}
|
|
217
|
-
}
|
|
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
|
-
|
|
156
|
-
this.__findMultiEntry(key, primaryKey, tx, success, error);
|
|
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);
|
|
@@ -270,10 +270,11 @@ const leftBracketRegex = /\[/gu;
|
|
|
270
270
|
* @param {SQLTransaction} tx
|
|
271
271
|
* @param {KeySuccess} success
|
|
272
272
|
* @param {FindError} error
|
|
273
|
+
* @param {Integer|undefined} recordsToLoad
|
|
273
274
|
* @this {IDBCursorFull}
|
|
274
275
|
* @returns {void}
|
|
275
276
|
*/
|
|
276
|
-
IDBCursor.prototype.__findMultiEntry = function (key, primaryKey, tx, success, error) {
|
|
277
|
+
IDBCursor.prototype.__findMultiEntry = function (key, primaryKey, tx, success, error, recordsToLoad) {
|
|
277
278
|
const me = this;
|
|
278
279
|
|
|
279
280
|
if (me.__prefetchedData && me.__prefetchedData.length === me.__prefetchedIndex) {
|
|
@@ -333,6 +334,7 @@ IDBCursor.prototype.__findMultiEntry = function (key, primaryKey, tx, success, e
|
|
|
333
334
|
// 4. Sort by object store position (if defined and not unique)
|
|
334
335
|
sql.push(',', util.sqlQuote(me.__valueColumnName), direction);
|
|
335
336
|
}
|
|
337
|
+
sql.push('LIMIT', String(recordsToLoad));
|
|
336
338
|
}
|
|
337
339
|
const sqlStr = sql.join(' ');
|
|
338
340
|
if (CFG.DEBUG) { console.log(sqlStr, sqlValues); }
|
|
@@ -364,10 +366,10 @@ IDBCursor.prototype.__findMultiEntry = function (key, primaryKey, tx, success, e
|
|
|
364
366
|
matchingKey: /** @type {string} */ (
|
|
365
367
|
Key.encode(matchingKey, true)
|
|
366
368
|
),
|
|
367
|
-
key: rowItem.key
|
|
369
|
+
key: rowItem.key,
|
|
370
|
+
[me.__keyColumnName]: rowItem[me.__keyColumnName],
|
|
371
|
+
[me.__valueColumnName]: rowItem[me.__valueColumnName]
|
|
368
372
|
};
|
|
369
|
-
clone[me.__keyColumnName] = rowItem[me.__keyColumnName];
|
|
370
|
-
clone[me.__valueColumnName] = rowItem[me.__valueColumnName];
|
|
371
373
|
rows.push(clone);
|
|
372
374
|
}
|
|
373
375
|
}
|
|
@@ -494,7 +496,7 @@ IDBCursor.prototype.__decode = function (rowItem, callback) {
|
|
|
494
496
|
if (!me.__matchedKeys) {
|
|
495
497
|
me.__matchedKeys = {};
|
|
496
498
|
}
|
|
497
|
-
if (me.__matchedKeys[rowItem.matchingKey]) {
|
|
499
|
+
if (me.__matchedKeys[rowItem.matchingKey] === true) {
|
|
498
500
|
callback(undefined, undefined, undefined);
|
|
499
501
|
return;
|
|
500
502
|
}
|
|
@@ -624,10 +626,12 @@ IDBCursor.prototype.__continueFinish = function (key, primaryKey, advanceState)
|
|
|
624
626
|
triggerSuccess(k, val, primKey);
|
|
625
627
|
return;
|
|
626
628
|
}
|
|
629
|
+
// @ts-expect-error Todo: Our bug to fix
|
|
627
630
|
cursorContinue(tx, args, success, error);
|
|
628
631
|
}
|
|
629
632
|
if (me.__unique && !me.__multiEntryIndex &&
|
|
630
633
|
encKey === Key.encode(me.key, me.__multiEntryIndex)) {
|
|
634
|
+
// @ts-expect-error Todo: Our bug to fix
|
|
631
635
|
cursorContinue(tx, args, success, error);
|
|
632
636
|
return;
|
|
633
637
|
}
|
|
@@ -775,6 +779,7 @@ IDBCursor.prototype.update = function (valueToUpdate) {
|
|
|
775
779
|
if (cmp(me.primaryKey, evaluatedKey) !== 0) {
|
|
776
780
|
throw createDOMException('DataError', 'The key of the supplied value to `update` is not equal to the cursor\'s effective key');
|
|
777
781
|
}
|
|
782
|
+
// eslint-disable-next-line unicorn/prefer-hoisting-branch-code -- Different
|
|
778
783
|
addToQueue(clonedValue);
|
|
779
784
|
} else {
|
|
780
785
|
const clonedValue = Sca.clone(valueToUpdate);
|
|
@@ -832,6 +837,7 @@ IDBCursor.prototype.delete = function () {
|
|
|
832
837
|
|
|
833
838
|
IDBCursor.prototype[Symbol.toStringTag] = 'IDBCursorPrototype';
|
|
834
839
|
|
|
840
|
+
/* eslint-disable unicorn/no-top-level-side-effects -- Would be good */
|
|
835
841
|
util.defineReadonlyOuterInterface(
|
|
836
842
|
IDBCursor.prototype,
|
|
837
843
|
['source', 'direction', 'key', 'primaryKey', 'request']
|
|
@@ -839,14 +845,17 @@ util.defineReadonlyOuterInterface(
|
|
|
839
845
|
Object.defineProperty(IDBCursor, 'prototype', {
|
|
840
846
|
writable: false
|
|
841
847
|
});
|
|
848
|
+
/* eslint-enable unicorn/no-top-level-side-effects -- Would be good */
|
|
842
849
|
|
|
843
850
|
/**
|
|
844
851
|
* @class
|
|
852
|
+
* @throws {TypeError}
|
|
845
853
|
*/
|
|
846
854
|
function IDBCursorWithValue () {
|
|
847
855
|
throw new TypeError('Illegal constructor');
|
|
848
856
|
}
|
|
849
857
|
|
|
858
|
+
/* eslint-disable unicorn/no-top-level-side-effects -- Would be good */
|
|
850
859
|
// @ts-expect-error It's ok
|
|
851
860
|
IDBCursorWithValue.prototype = Object.create(IDBCursor.prototype);
|
|
852
861
|
Object.defineProperty(IDBCursorWithValue.prototype, 'constructor', {
|
|
@@ -855,6 +864,7 @@ Object.defineProperty(IDBCursorWithValue.prototype, 'constructor', {
|
|
|
855
864
|
configurable: true,
|
|
856
865
|
value: IDBCursorWithValue
|
|
857
866
|
});
|
|
867
|
+
/* eslint-enable unicorn/no-top-level-side-effects -- Would be good */
|
|
858
868
|
|
|
859
869
|
const IDBCursorWithValueAlias = IDBCursorWithValue;
|
|
860
870
|
/**
|
|
@@ -880,12 +890,13 @@ IDBCursorWithValue.__createInstance = function (...args) {
|
|
|
880
890
|
return new IDBCursorWithValue();
|
|
881
891
|
};
|
|
882
892
|
|
|
893
|
+
/* eslint-disable unicorn/no-top-level-side-effects -- Would be good */
|
|
883
894
|
util.defineReadonlyOuterInterface(IDBCursorWithValue.prototype, ['value']);
|
|
884
|
-
|
|
885
895
|
IDBCursorWithValue.prototype[Symbol.toStringTag] = 'IDBCursorWithValuePrototype';
|
|
886
896
|
|
|
887
897
|
Object.defineProperty(IDBCursorWithValue, 'prototype', {
|
|
888
898
|
writable: false
|
|
889
899
|
});
|
|
900
|
+
/* eslint-enable unicorn/no-top-level-side-effects -- Would be good */
|
|
890
901
|
|
|
891
902
|
export {IDBCursor, IDBCursorWithValue};
|