MCPcopy Create free account
hub / github.com/code-pushup/cli / transformGQLTable

Function transformGQLTable

packages/ci/src/lib/portal/transform.ts:183–202  ·  view source on GitHub ↗
(table: TableFragment)

Source from the content-addressed store, hash-verified

181}
182
183function transformGQLTable(table: TableFragment): Table {
184 if (!table.header) {
185 return {
186 ...(table.title && { title: table.title }),
187 rows: table.body.map(cells => cells.map(cell => cell.content)),
188 };
189 }
190
191 return {
192 ...(table.title && { title: table.title }),
193 columns: table.header.map(({ content, alignment }, idx) => ({
194 key: idx.toString(),
195 label: content,
196 align: lowercase(alignment),
197 })),
198 rows: table.body.map(cells =>
199 Object.fromEntries(cells.map((cell, idx) => [idx, cell.content])),
200 ),
201 };
202}
203
204function transformGQLTree(tree: TreeFragment): Tree {
205 switch (tree.__typename) {

Callers 1

transformGQLAuditFunction · 0.85

Calls 2

lowercaseFunction · 0.90
toStringMethod · 0.80

Tested by

no test coverage detected