MCPcopy Create free account
hub / github.com/Superflows-AI/superflows / getPossibleJsonChunk

Function getPossibleJsonChunk

lib/embed-docs/utils.ts:154–158  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

152}
153
154export function getPossibleJsonChunk(text: string): string {
155 // Regex to check if text contains [] or {}
156 const match = /(\[[\s\S]+]|{[\s\S]+})/g.exec(text);
157 return !match ? "" : match[0];
158}
159
160export function isJson(text: string): boolean {
161 const possibleJsonChunk = getPossibleJsonChunk(text);

Callers 2

splitOutCodeChunksFunction · 0.85
isJsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected