Skip to content

Commit 491900b

Browse files
committed
fix(db): remove redundant queryOnce undefined fallback
Drop the unnecessary nullish-coalescing in queryOnce so the single-result path returns the iterator value directly while preserving the existing undefined-on-empty behavior. Made-with: Cursor
1 parent c2ed7ad commit 491900b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/db/src/query/query-once.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export async function queryOnce<TContext extends Context>(
105105
const first = collection.values().next().value as
106106
| InferResultType<TContext>
107107
| undefined
108-
return (first ?? undefined) as InferResultType<TContext>
108+
return first as InferResultType<TContext>
109109
}
110110
return collection.toArray as InferResultType<TContext>
111111
} finally {

0 commit comments

Comments
 (0)