MCPcopy Index your code
hub / github.com/simstudioai/sim / makeBuilder

Function makeBuilder

apps/sim/app/api/auth/sso/register/route.test.ts:38–51  ·  view source on GitHub ↗
(rows: any[])

Source from the content-addressed store, hash-verified

36}))
37
38function makeBuilder(rows: any[]): any {
39 const thenable: any = Promise.resolve(rows)
40 thenable.where = (condition: any) => {
41 const values = condition?.values
42 if (Array.isArray(values) && values.length > 0) {
43 const target = String(values[values.length - 1]).toLowerCase()
44 return makeBuilder(rows.filter((r) => String(r.domain ?? '').toLowerCase() === target))
45 }
46 return makeBuilder(rows)
47 }
48 thenable.limit = () => Promise.resolve(rows)
49 thenable.orderBy = () => Promise.resolve(rows)
50 return thenable
51}
52
53vi.mock('@sim/db', () => ({
54 db: {

Callers 1

route.test.tsFile · 0.85

Calls 1

resolveMethod · 0.65

Tested by

no test coverage detected