Skip to content

Commit 0f923aa

Browse files
committed
prevent shorthand filters from being misclassified as AST nodes
Add accept-method check alongside kind discriminant in isWhereDirectInput so plain objects with a matching kind value (e.g. { kind: 'binary' }) go through shorthandToWhereExpr instead of being treated as prebuilt ASTs.
1 parent a1672e6 commit 0f923aa

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/3-extensions/sql-orm-client/src/collection.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ function isToWhereExprInput(value: unknown): value is ToWhereExpr {
105105
}
106106

107107
function isWhereDirectInput(value: unknown): value is WhereDirectInput {
108-
return isWhereExpr(value) || isToWhereExprInput(value);
108+
return (
109+
(isWhereExpr(value) && typeof (value as { accept?: unknown }).accept === 'function') ||
110+
isToWhereExprInput(value)
111+
);
109112
}
110113

111114
export class Collection<

0 commit comments

Comments
 (0)