indexeddbshim 15.1.0 → 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/IDBIndex.d.ts.map +1 -1
- package/dist/indexeddbshim-Key.js +1 -1
- 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 +15 -5
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.js +15 -5
- 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 +15 -5
- package/dist/indexeddbshim-node.cjs.map +1 -1
- package/dist/indexeddbshim-noninvasive.js +15 -5
- 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 +15 -5
- package/dist/indexeddbshim.js.map +1 -1
- package/dist/indexeddbshim.min.js +2 -2
- package/dist/indexeddbshim.min.js.map +1 -1
- package/dist/util.d.ts +1 -0
- package/dist/util.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/IDBIndex.js +17 -4
- package/src/util.js +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! indexeddbshim - v15.0
|
|
1
|
+
/*! indexeddbshim - v15.2.0 - 9/11/2024 */
|
|
2
2
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -1313,12 +1313,13 @@ function escapeIndexNameForSQLKeyColumn(index) {
|
|
|
1313
1313
|
}
|
|
1314
1314
|
|
|
1315
1315
|
/**
|
|
1316
|
+
* @todo Didn't need to escape `%`. Do we still need this escape?
|
|
1316
1317
|
* @param {string} str
|
|
1317
1318
|
* @returns {string}
|
|
1318
1319
|
*/
|
|
1319
1320
|
function sqlLIKEEscape(str) {
|
|
1320
1321
|
// https://www.sqlite.org/lang_expr.html#like
|
|
1321
|
-
return
|
|
1322
|
+
return str.replaceAll('^', '^^');
|
|
1322
1323
|
}
|
|
1323
1324
|
|
|
1324
1325
|
/**
|
|
@@ -7151,8 +7152,11 @@ function executeFetchIndexData(count, unboundedDisallowed, index, hasKey, range,
|
|
|
7151
7152
|
*/
|
|
7152
7153
|
check => rowKey.includes(check)) ||
|
|
7153
7154
|
// More precise than our SQL
|
|
7154
|
-
isMultiEntryMatch(
|
|
7155
|
-
|
|
7155
|
+
isMultiEntryMatch(
|
|
7156
|
+
// Added `JSON.stringify` as was having problems with
|
|
7157
|
+
// `JSON.stringify` encoding added to nested
|
|
7158
|
+
// array keys
|
|
7159
|
+
JSON.stringify(encodedKey).slice(1, -1), row[escapedIndexNameForKeyCol]))) {
|
|
7156
7160
|
recordCount++;
|
|
7157
7161
|
record = row;
|
|
7158
7162
|
} else if (!hasKey && !multiChecks) {
|
|
@@ -7225,7 +7229,13 @@ function buildFetchIndexDataSQL(nullDisallowed, index, range, opType, multiCheck
|
|
|
7225
7229
|
sql.push(')');
|
|
7226
7230
|
} else if (index.multiEntry) {
|
|
7227
7231
|
sql.push('AND', escapeIndexNameForSQL(index.name), "LIKE ? ESCAPE '^'");
|
|
7228
|
-
|
|
7232
|
+
if (Array.isArray(range)) {
|
|
7233
|
+
// Todo: For nesting deeper than one level, we probably need to
|
|
7234
|
+
// run `JSON.stringify` again
|
|
7235
|
+
sqlValues.push('%' + sqlLIKEEscape(JSON.stringify(/** @type {string} */encode$1(range, index.multiEntry)).slice(1, -1)) + '%');
|
|
7236
|
+
} else {
|
|
7237
|
+
sqlValues.push('%' + sqlLIKEEscape(/** @type {string} */encode$1(range, index.multiEntry)) + '%');
|
|
7238
|
+
}
|
|
7229
7239
|
} else {
|
|
7230
7240
|
const convertedRange = convertValueToKeyRange(range, nullDisallowed);
|
|
7231
7241
|
setSQLForKeyRange(convertedRange, escapeIndexNameForSQL(index.name), sql, sqlValues, true, false);
|