Skip to content

Commit 55cf899

Browse files
committed
test(objectql): the multi-reference stub driver's find holds the caller's bound
Claude-Session: https://claude.ai/code/session_01ADzJtzYTLUfgrRZHxkagkX Co-authored-by: Claude <noreply@anthropic.com>
1 parent bd86c56 commit 55cf899

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎packages/objectql/src/engine-multi-reference-element-shape.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ function makeStubDriver() {
8585
async connect() {}, async disconnect() {}, async checkHealth() { return true; },
8686
async execute() { return null; },
8787
async find(object: string, ast: any) {
88-
return Array.from(storeFor(object).values()).filter((r) => matches(r, ast?.where));
88+
const rows = Array.from(storeFor(object).values()).filter((r) => matches(r, ast?.where));
89+
return typeof ast?.limit === 'number' ? rows.slice(0, ast.limit) : rows;
8990
},
9091
async findOne(object: string, ast: any) {
9192
for (const r of storeFor(object).values()) if (matches(r, ast?.where)) return r;

0 commit comments

Comments
 (0)