MCPcopy Create free account
hub / github.com/langgenius/dify / makeTable

Function makeTable

cli/src/framework/output.test.ts:19–34  ·  view source on GitHub ↗
(opts: {
  columns?: Array<{ name: string, priority: number }>
  rows?: Array<Array<string | number | boolean | null | undefined>>
  json?: unknown
  name?: string
})

Source from the content-addressed store, hash-verified

17}
18
19function makeTable(opts: {
20 columns?: Array<{ name: string, priority: number }>
21 rows?: Array<Array<string | number | boolean | null | undefined>>
22 json?: unknown
23 name?: string
24}): TablePrintable & NamePrintable {
25 return {
26 tableColumns: () => opts.columns ?? [
27 { name: 'NAME', priority: 0 },
28 { name: 'STATUS', priority: 0 },
29 ],
30 tableRows: () => opts.rows ?? [['alice', 'active']],
31 json: () => opts.json ?? [{ name: 'alice', status: 'active' }],
32 name: () => opts.name ?? 'table-name',
33 }
34}
35
36describe('raw', () => {
37 it('creates RawOutput with kind=raw', () => {

Callers 1

output.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected