MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / returnedTables

Function returnedTables

src/resolution/frameworks/react.ts:2231–2236  ·  view source on GitHub ↗

* The tables the function written at `at` returns: its expression body's * (`(user) => [ … ]`, `() => buildRoutes()`), or what each `return` of its * own hands back, an early guard (`if (!user) return [];`) and every branch * alike. A `return` in a function written inside it (`.map((p) => { retur

(safe: string, at: number)

Source from the content-addressed store, hash-verified

2229 * [ … ]; })`, a method's) is that function's.
2230 */
2231function returnedTables(safe: string, at: number): TableSite[] {
2232 const body = functionBody(safe, at);
2233 if (!body) return [];
2234 if (!body.block) return heldTable(safe, body.start);
2235 return ownReturns(safe, body.start, body.end).flatMap((value) => heldTable(safe, value));
2236}
2237
2238/**
2239 * Where the function written at `at` keeps its body: a block, from its `{` to

Callers 3

exportedTableFunction · 0.85
declaredTableFunction · 0.85
heldTableFunction · 0.85

Calls 3

functionBodyFunction · 0.85
heldTableFunction · 0.85
ownReturnsFunction · 0.85

Tested by

no test coverage detected