MCPcopy Create free account
hub / github.com/brillout/react-streaming / strInfo

Function strInfo

src/utils/debug.ts:51–73  ·  view source on GitHub ↗
(info: unknown, options: Options)

Source from the content-addressed store, hash-verified

49}
50
51function strInfo(info: unknown, options: Options): string | undefined {
52 if (info === undefined) {
53 return undefined
54 }
55
56 let str = '\n'
57
58 if (typeof info === 'string') {
59 str += info
60 } else if (Array.isArray(info)) {
61 if (info.length === 0) {
62 str += options.serialization?.emptyArray ?? '[]'
63 } else {
64 str += info.map(strUnknown).join('\n')
65 }
66 } else {
67 str += strUnknown(info)
68 }
69
70 str = pad(str)
71
72 return str
73}
74
75function pad(str: string): string {
76 const PADDING = ' '

Callers 1

debugWithOptionsFunction · 0.85

Calls 2

strUnknownFunction · 0.85
padFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…