(text: string)
| 152 | } |
| 153 | |
| 154 | export 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 | |
| 160 | export function isJson(text: string): boolean { |
| 161 | const possibleJsonChunk = getPossibleJsonChunk(text); |
no outgoing calls
no test coverage detected