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
|
(function (factory) {
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -1851,12 +1851,13 @@
|
|
|
1851
1851
|
}
|
|
1852
1852
|
|
|
1853
1853
|
/**
|
|
1854
|
+
* @todo Didn't need to escape `%`. Do we still need this escape?
|
|
1854
1855
|
* @param {string} str
|
|
1855
1856
|
* @returns {string}
|
|
1856
1857
|
*/
|
|
1857
1858
|
function sqlLIKEEscape(str) {
|
|
1858
1859
|
// https://www.sqlite.org/lang_expr.html#like
|
|
1859
|
-
return
|
|
1860
|
+
return str.replaceAll('^', '^^');
|
|
1860
1861
|
}
|
|
1861
1862
|
|
|
1862
1863
|
/**
|
|
@@ -7970,8 +7971,11 @@
|
|
|
7970
7971
|
return rowKey.includes(check);
|
|
7971
7972
|
}) ||
|
|
7972
7973
|
// More precise than our SQL
|
|
7973
|
-
isMultiEntryMatch(
|
|
7974
|
-
|
|
7974
|
+
isMultiEntryMatch(
|
|
7975
|
+
// Added `JSON.stringify` as was having problems with
|
|
7976
|
+
// `JSON.stringify` encoding added to nested
|
|
7977
|
+
// array keys
|
|
7978
|
+
JSON.stringify(encodedKey).slice(1, -1), row[escapedIndexNameForKeyCol]))) {
|
|
7975
7979
|
recordCount++;
|
|
7976
7980
|
record = row;
|
|
7977
7981
|
} else if (!hasKey && !multiChecks) {
|
|
@@ -8047,7 +8051,13 @@
|
|
|
8047
8051
|
sql.push(')');
|
|
8048
8052
|
} else if (index.multiEntry) {
|
|
8049
8053
|
sql.push('AND', escapeIndexNameForSQL(index.name), "LIKE ? ESCAPE '^'");
|
|
8050
|
-
|
|
8054
|
+
if (Array.isArray(range)) {
|
|
8055
|
+
// Todo: For nesting deeper than one level, we probably need to
|
|
8056
|
+
// run `JSON.stringify` again
|
|
8057
|
+
sqlValues.push('%' + sqlLIKEEscape(JSON.stringify(/** @type {string} */_encode(range, index.multiEntry)).slice(1, -1)) + '%');
|
|
8058
|
+
} else {
|
|
8059
|
+
sqlValues.push('%' + sqlLIKEEscape(/** @type {string} */_encode(range, index.multiEntry)) + '%');
|
|
8060
|
+
}
|
|
8051
8061
|
} else {
|
|
8052
8062
|
var convertedRange = convertValueToKeyRange(range, nullDisallowed);
|
|
8053
8063
|
setSQLForKeyRange(convertedRange, escapeIndexNameForSQL(index.name), sql, sqlValues, true, false);
|