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

Function chunk

src/utils/debug.ts:90–97  ·  view source on GitHub ↗
(str: string, size: number)

Source from the content-addressed store, hash-verified

88 return lines.join('\n' + PADDING)
89}
90function chunk(str: string, size: number): string[] {
91 if (str.length <= size) {
92 return [str]
93 }
94 const chunks = str.match(new RegExp('.{1,' + size + '}', 'g'))
95 assert(chunks)
96 return chunks
97}
98
99function strUnknown(thing: unknown) {
100 return typeof thing === 'string' ? thing : strObj(thing)

Callers 1

padFunction · 0.85

Calls 1

assertFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…