Skip to content
Snippets Groups Projects
Commit 35e95921 authored by Elliot Kang's avatar Elliot Kang
Browse files

prettify OutputParser

parent 08d466fa
No related branches found
No related tags found
No related merge requests found
......@@ -61,18 +61,17 @@ function parseJsonMarkdown(text: string) {
var left: number;
var right: number;
if(left_square < left_brace && left_square != -1){
if (left_square < left_brace && left_square != -1) {
left = left_square;
right = text.lastIndexOf("]");
}
else{
} else {
left = left_brace;
right = text.lastIndexOf("}");
}
const jsonText = text.substring(left, right + 1);
try {
//Single JSON object case
if(left_square === -1){
if (left_square === -1) {
return [JSON.parse(jsonText)];
}
//Multiple JSON object case.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment