indexeddbshim 15.0.4 → 15.2.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/dist/CFG.d.ts +3 -36
- package/dist/CFG.d.ts.map +1 -1
- package/dist/DOMException.d.ts +1 -1
- package/dist/DOMException.d.ts.map +1 -1
- package/dist/DOMStringList.d.ts +1 -1
- package/dist/DOMStringList.d.ts.map +1 -1
- package/dist/Event.d.ts.map +1 -1
- package/dist/IDBCursor.d.ts +21 -21
- package/dist/IDBCursor.d.ts.map +1 -1
- package/dist/IDBDatabase.d.ts +13 -11
- package/dist/IDBDatabase.d.ts.map +1 -1
- package/dist/IDBFactory.d.ts +4 -4
- package/dist/IDBFactory.d.ts.map +1 -1
- package/dist/IDBIndex.d.ts +17 -17
- package/dist/IDBIndex.d.ts.map +1 -1
- package/dist/IDBKeyRange.d.ts +7 -7
- package/dist/IDBKeyRange.d.ts.map +1 -1
- package/dist/IDBObjectStore.d.ts +33 -33
- package/dist/IDBObjectStore.d.ts.map +1 -1
- package/dist/IDBRequest.d.ts +6 -19
- package/dist/IDBRequest.d.ts.map +1 -1
- package/dist/IDBTransaction.d.ts +13 -13
- package/dist/IDBTransaction.d.ts.map +1 -1
- package/dist/Key.d.ts +10 -10
- package/dist/Key.d.ts.map +1 -1
- package/dist/Sca.d.ts +1 -1
- package/dist/Sca.d.ts.map +1 -1
- package/dist/UnicodeIdentifiers.d.ts +2 -2
- package/dist/UnicodeIdentifiers.d.ts.map +1 -1
- package/dist/cmp.d.ts +1 -1
- package/dist/indexeddbshim-Key.js +3 -2
- 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 +75 -63
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.js +85 -74
- 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 +75 -63
- package/dist/indexeddbshim-node.cjs.map +1 -1
- package/dist/indexeddbshim-noninvasive.js +85 -74
- 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 +85 -74
- package/dist/indexeddbshim.js.map +1 -1
- package/dist/indexeddbshim.min.js +2 -2
- package/dist/indexeddbshim.min.js.map +1 -1
- package/dist/node-UnicodeIdentifiers.d.ts +1 -1
- package/dist/node-UnicodeIdentifiers.d.ts.map +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.d.ts.map +1 -1
- package/dist/setGlobalVars.d.ts +4 -5
- package/dist/setGlobalVars.d.ts.map +1 -1
- package/dist/util.d.ts +3 -2
- package/dist/util.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/IDBFactory.js +1 -0
- package/src/IDBIndex.js +18 -4
- package/src/IDBObjectStore.js +1 -3
- package/src/Key.js +2 -1
- package/src/util.js +2 -1
- package/src/Key.d.ts +0 -1
|
@@ -4,5 +4,5 @@ export default __setGlobalVars;
|
|
|
4
4
|
* @param {import('./CFG.js').default} initialConfig
|
|
5
5
|
* @returns {{}|Window}
|
|
6
6
|
*/
|
|
7
|
-
declare function __setGlobalVars(idb: import(
|
|
7
|
+
declare function __setGlobalVars(idb: import("./setGlobalVars.js").ShimmedObject, initialConfig?: any): {} | 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,
|
|
1
|
+
{"version":3,"file":"node-UnicodeIdentifiers.d.ts","sourceRoot":"","sources":["../src/node-UnicodeIdentifiers.js"],"names":[],"mappings":";AASA;;;;GAIG;AACH,sCAJW,OAAO,oBAAoB,EAAE,aAAa,kBAC1C,GAA0B,GACxB,EAAE,GAAC,MAAM,CAWrB"}
|
package/dist/node.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export default __setGlobalVars;
|
|
|
4
4
|
* @param {import('./CFG.js').default} initialConfig
|
|
5
5
|
* @returns {{}|Window}
|
|
6
6
|
*/
|
|
7
|
-
declare function __setGlobalVars(idb: import(
|
|
7
|
+
declare function __setGlobalVars(idb: import("./setGlobalVars.js").ShimmedObject, initialConfig?: any): {} | 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,
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.js"],"names":[],"mappings":";AAQA;;;;GAIG;AACH,sCAJW,OAAO,oBAAoB,EAAE,aAAa,kBAC1C,GAA0B,GACxB,EAAE,GAAC,MAAM,CAIrB"}
|
package/dist/setGlobalVars.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export { createDOMException };
|
|
2
2
|
export default setGlobalVars;
|
|
3
3
|
export type AnyValue = any;
|
|
4
|
-
export type SetConfig = (prop: import(
|
|
5
|
-
export type GetConfig = (prop: import(
|
|
4
|
+
export type SetConfig = (prop: import("./CFG.js").KeyofConfigValues | Partial<import("./CFG.js").ConfigValues>, val?: AnyValue) => any;
|
|
5
|
+
export type GetConfig = (prop: import("./CFG.js").KeyofConfigValues) => import("./CFG.js").ConfigValue;
|
|
6
6
|
export type SetUnicodeIdentifiers = (cfg: {
|
|
7
7
|
UnicodeIDStart: string;
|
|
8
8
|
UnicodeIDContinue: string;
|
|
9
9
|
}) => void;
|
|
10
|
-
export type ShimIndexedDB = (
|
|
10
|
+
export type ShimIndexedDB = (IDBFactory | object) & {
|
|
11
11
|
__useShim: () => void;
|
|
12
12
|
__debug: (val: boolean) => void;
|
|
13
13
|
__setConfig: SetConfig;
|
|
@@ -32,7 +32,7 @@ import { createDOMException } from './DOMException.js';
|
|
|
32
32
|
/**
|
|
33
33
|
* @typedef {(
|
|
34
34
|
* prop: import('./CFG.js').KeyofConfigValues
|
|
35
|
-
* ) => import('
|
|
35
|
+
* ) => import('./CFG.js').ConfigValue} GetConfig
|
|
36
36
|
*/
|
|
37
37
|
/**
|
|
38
38
|
* @typedef {(cfg: {
|
|
@@ -75,5 +75,4 @@ import { createDOMException } from './DOMException.js';
|
|
|
75
75
|
*/
|
|
76
76
|
declare function setGlobalVars(idb?: ShimmedObject | undefined, initialConfig?: import("./CFG.js").ConfigValues | undefined): ShimmedObject;
|
|
77
77
|
import { IDBFactory } from './IDBFactory.js';
|
|
78
|
-
import { shimIndexedDB } from './IDBFactory.js';
|
|
79
78
|
//# sourceMappingURL=setGlobalVars.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setGlobalVars.d.ts","sourceRoot":"","sources":["../src/setGlobalVars.js"],"names":[],"mappings":";;uBAkBa,GAAG;+BAKL,OAAO,UAAU,EAAE,iBAAiB,
|
|
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,8HAFa,aAAa,CAoSzB;2BA1Y8C,iBAAiB"}
|
package/dist/util.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export function escapeIndexNameForSQL(index: string): string;
|
|
|
40
40
|
*/
|
|
41
41
|
export function escapeIndexNameForSQLKeyColumn(index: string): string;
|
|
42
42
|
/**
|
|
43
|
+
* @todo Didn't need to escape `%`. Do we still need this escape?
|
|
43
44
|
* @param {string} str
|
|
44
45
|
* @returns {string}
|
|
45
46
|
*/
|
|
@@ -135,9 +136,9 @@ export function defineListenerProperties(obj: object & {
|
|
|
135
136
|
* }} getter
|
|
136
137
|
* @returns {void}
|
|
137
138
|
*/
|
|
138
|
-
export function defineReadonlyProperties(obj: object, props: string | string[], getter?: {
|
|
139
|
+
export function defineReadonlyProperties(obj: object, props: string | string[], getter?: null | {
|
|
139
140
|
[key: string]: any;
|
|
140
|
-
}
|
|
141
|
+
}): void;
|
|
141
142
|
/**
|
|
142
143
|
*
|
|
143
144
|
* @param {string|string[]} keyPath
|
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;;uBAkfN,GAAG;AAxchB;;;;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,CAKnB;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,sCAEN,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": "15.0
|
|
3
|
+
"version": "15.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "Parashuram <code@nparashuram.com>",
|
|
6
6
|
"contributors": [
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"eventtargeter": "0.9.0",
|
|
91
91
|
"sync-promise-expanded": "^1.0.0",
|
|
92
92
|
"typeson": "9.0.3",
|
|
93
|
-
"typeson-registry": "11.0
|
|
93
|
+
"typeson-registry": "11.1.0",
|
|
94
94
|
"websql-configurable": "^3.0.3"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
@@ -118,8 +118,8 @@
|
|
|
118
118
|
"coveradge": "^0.8.2",
|
|
119
119
|
"cyclonejs": "1.1.4",
|
|
120
120
|
"delay-cli": "^2.0.0",
|
|
121
|
-
"eslint": "^9.
|
|
122
|
-
"eslint-config-ash-nazg": "^36.
|
|
121
|
+
"eslint": "^9.10.0",
|
|
122
|
+
"eslint-config-ash-nazg": "^36.16.3",
|
|
123
123
|
"got": "^13.0.0",
|
|
124
124
|
"is-date-object": "1.0.5",
|
|
125
125
|
"isomorphic-fetch": "^3.0.0",
|
|
@@ -136,17 +136,17 @@
|
|
|
136
136
|
"rollup-plugin-filesize": "^10.0.0",
|
|
137
137
|
"rollup-plugin-node-globals": "^1.4.0",
|
|
138
138
|
"rollup-plugin-node-polyfills": "^0.2.1",
|
|
139
|
-
"sinon": "^18.0.
|
|
139
|
+
"sinon": "^18.0.1",
|
|
140
140
|
"source-map-support": "0.5.21",
|
|
141
141
|
"sourcemap-transformer": "git+https://github.com/brettz9/sourcemap-transformer.git",
|
|
142
|
-
"typescript": "^5.
|
|
142
|
+
"typescript": "^5.6.2",
|
|
143
143
|
"w3c-blob": "0.0.1",
|
|
144
144
|
"ws": "^8.18.0"
|
|
145
145
|
},
|
|
146
146
|
"scripts": {
|
|
147
147
|
"tsc": "tsc",
|
|
148
148
|
"tsc-prod": "tsc -p tsconfig-prod.json",
|
|
149
|
-
"build": "
|
|
149
|
+
"build": "rm -R dist && npm run tsc-prod && npm run rollup",
|
|
150
150
|
"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",
|
|
151
151
|
"license-badge-dev": "license-badger --corrections --filteredTypes=nonempty --textTemplate \"License types\n(all devDeps)\" --allDevelopment badges/licenses-badge-dev.svg",
|
|
152
152
|
"license-badges": "run-p license-badge license-badge-dev",
|
package/src/IDBFactory.js
CHANGED
package/src/IDBIndex.js
CHANGED
|
@@ -453,6 +453,7 @@ IDBIndex.__deleteIndex = function (store, index) {
|
|
|
453
453
|
IDBIndex.__updateIndexList = function (store, tx, success, failure) {
|
|
454
454
|
/** @type {IndexList} **/
|
|
455
455
|
const indexList = {};
|
|
456
|
+
// eslint-disable-next-line sonarjs/prefer-for-of -- Implement iterability?
|
|
456
457
|
for (let i = 0; i < store.indexNames.length; i++) {
|
|
457
458
|
const idx = store.__indexes[store.indexNames[i]];
|
|
458
459
|
indexList[idx.name] = {
|
|
@@ -846,8 +847,10 @@ function executeFetchIndexData (
|
|
|
846
847
|
(check) => rowKey.includes(check)
|
|
847
848
|
)) || // More precise than our SQL
|
|
848
849
|
Key.isMultiEntryMatch(
|
|
849
|
-
|
|
850
|
-
|
|
850
|
+
// Added `JSON.stringify` as was having problems with
|
|
851
|
+
// `JSON.stringify` encoding added to nested
|
|
852
|
+
// array keys
|
|
853
|
+
JSON.stringify(encodedKey).slice(1, -1),
|
|
851
854
|
row[escapedIndexNameForKeyCol]
|
|
852
855
|
)
|
|
853
856
|
)) {
|
|
@@ -932,9 +935,20 @@ function buildFetchIndexDataSQL (
|
|
|
932
935
|
sql.push(')');
|
|
933
936
|
} else if (index.multiEntry) {
|
|
934
937
|
sql.push('AND', util.escapeIndexNameForSQL(index.name), "LIKE ? ESCAPE '^'");
|
|
935
|
-
|
|
938
|
+
|
|
939
|
+
if (Array.isArray(range)) {
|
|
940
|
+
// Todo: For nesting deeper than one level, we probably need to
|
|
941
|
+
// run `JSON.stringify` again
|
|
942
|
+
sqlValues.push('%' + util.sqlLIKEEscape(
|
|
943
|
+
JSON.stringify(
|
|
944
|
+
/** @type {string} */ (Key.encode(range, index.multiEntry))
|
|
945
|
+
).slice(1, -1)
|
|
946
|
+
) + '%');
|
|
947
|
+
} else {
|
|
948
|
+
sqlValues.push('%' + util.sqlLIKEEscape(
|
|
936
949
|
/** @type {string} */ (Key.encode(range, index.multiEntry))
|
|
937
|
-
|
|
950
|
+
) + '%');
|
|
951
|
+
}
|
|
938
952
|
} else {
|
|
939
953
|
const convertedRange = convertValueToKeyRange(range, nullDisallowed);
|
|
940
954
|
setSQLForKeyRange(convertedRange, util.escapeIndexNameForSQL(index.name), sql, sqlValues, true, false);
|
package/src/IDBObjectStore.js
CHANGED
|
@@ -447,7 +447,6 @@ IDBObjectStore.prototype.__deriveKey = function (tx, value, key, success, failCb
|
|
|
447
447
|
if (me.autoIncrement) {
|
|
448
448
|
// If auto-increment and no valid primaryKey found on the keyPath, get and set the new value, and use
|
|
449
449
|
if (key === undefined) {
|
|
450
|
-
// @ts-expect-error Due to re-exporting `Key.d.ts` file (needed for `node_modules` imports)
|
|
451
450
|
Key.generateKeyForStore(tx, me, function (failure, key, oldCn) {
|
|
452
451
|
if (failure) {
|
|
453
452
|
failCb(createDOMException('ConstraintError', 'The key generator\'s current number has reached the maximum safe integer limit'));
|
|
@@ -463,7 +462,6 @@ IDBObjectStore.prototype.__deriveKey = function (tx, value, key, success, failCb
|
|
|
463
462
|
success(key, oldCn);
|
|
464
463
|
}, failCb);
|
|
465
464
|
} else {
|
|
466
|
-
// @ts-expect-error Due to re-exporting `Key.d.ts` file (needed for `node_modules` imports)
|
|
467
465
|
Key.possiblyUpdateKeyGenerator(tx, me, key, keyCloneThenSuccess, failCb);
|
|
468
466
|
}
|
|
469
467
|
// Not auto-increment
|
|
@@ -612,6 +610,7 @@ IDBObjectStore.prototype.__insertData = function (tx, encoded, value, clonedKeyO
|
|
|
612
610
|
return false;
|
|
613
611
|
});
|
|
614
612
|
return undefined;
|
|
613
|
+
// eslint-disable-next-line sonarjs/no-invariant-returns -- Convenient
|
|
615
614
|
}).catch(function (err) {
|
|
616
615
|
/**
|
|
617
616
|
* @returns {void}
|
|
@@ -622,7 +621,6 @@ IDBObjectStore.prototype.__insertData = function (tx, encoded, value, clonedKeyO
|
|
|
622
621
|
error(err);
|
|
623
622
|
}
|
|
624
623
|
if (typeof oldCn === 'number') {
|
|
625
|
-
// @ts-expect-error Due to re-exporting `Key.d.ts` file (needed for `node_modules` imports)
|
|
626
624
|
Key.assignCurrentNumber(tx, me, oldCn, fail, fail);
|
|
627
625
|
return null;
|
|
628
626
|
}
|
package/src/Key.js
CHANGED
|
@@ -864,6 +864,7 @@ function findMultiEntryMatches (keyEntry, range) {
|
|
|
864
864
|
continue;
|
|
865
865
|
}
|
|
866
866
|
if (key.length === 1) {
|
|
867
|
+
// eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient
|
|
867
868
|
key = key[0];
|
|
868
869
|
} else {
|
|
869
870
|
const nested = findMultiEntryMatches(key, range);
|
|
@@ -1084,7 +1085,7 @@ function generateKeyForStore (tx, store, cb, sqlFailCb) {
|
|
|
1084
1085
|
*
|
|
1085
1086
|
* @param {SQLTransaction} tx
|
|
1086
1087
|
* @param {import('./IDBObjectStore.js').IDBObjectStoreFull} store
|
|
1087
|
-
* @param {
|
|
1088
|
+
* @param {Key} key
|
|
1088
1089
|
* @param {(num?: Integer) => void} successCb
|
|
1089
1090
|
* @param {SQLFailureCallback} sqlFailCb
|
|
1090
1091
|
* @returns {void}
|
package/src/util.js
CHANGED
|
@@ -211,12 +211,13 @@ function escapeIndexNameForSQLKeyColumn (index) {
|
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
/**
|
|
214
|
+
* @todo Didn't need to escape `%`. Do we still need this escape?
|
|
214
215
|
* @param {string} str
|
|
215
216
|
* @returns {string}
|
|
216
217
|
*/
|
|
217
218
|
function sqlLIKEEscape (str) {
|
|
218
219
|
// https://www.sqlite.org/lang_expr.html#like
|
|
219
|
-
return
|
|
220
|
+
return str.replaceAll('^', '^^');
|
|
220
221
|
}
|
|
221
222
|
|
|
222
223
|
/**
|
package/src/Key.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../dist/Key.js';
|