Skip to content

Commit ff70103

Browse files
committed
fix(isWhereEmpty): update logic to check for undefined values in where object
- prevents erronous sql exists() checks as whereinput is initialized with all keys but values undefined
1 parent 2e0e84b commit ff70103

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/strategies/isWhereEmpty.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ export function isWhereEmpty(
1212
): boolean {
1313
if (!where) return true;
1414
if (Array.isArray(where)) return where.length === 0;
15-
return Object.keys(where).length === 0;
15+
return Object.values(where).filter((x) => x !== undefined).length === 0;
1616
}

0 commit comments

Comments
 (0)