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