@mastra/libsql 1.24.0-alpha.1 → 1.24.0-alpha.2
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/index.js
CHANGED
|
@@ -423,9 +423,14 @@ function handleLogicalOperator(key, value, parentPath) {
|
|
|
423
423
|
}
|
|
424
424
|
const values = [];
|
|
425
425
|
const joinOperator = key === "$or" || key === "$nor" ? "OR" : "AND";
|
|
426
|
-
const joined = (Array.isArray(value) ? value.
|
|
427
|
-
|
|
428
|
-
|
|
426
|
+
const joined = (Array.isArray(value) ? value.flatMap((f) => {
|
|
427
|
+
const branch = (!!f ? Object.entries(f) : []).map(([k, v]) => buildCondition$1(k, v, key));
|
|
428
|
+
if (branch.length <= 1) return branch;
|
|
429
|
+
return [{
|
|
430
|
+
sql: `(${branch.map((c) => c.sql).join(" AND ")})`,
|
|
431
|
+
values: branch.flatMap((c) => c.values)
|
|
432
|
+
}];
|
|
433
|
+
}) : [buildCondition$1(key, value, parentPath)]).map((c) => {
|
|
429
434
|
values.push(...c.values);
|
|
430
435
|
return c.sql;
|
|
431
436
|
}).join(` ${joinOperator} `);
|