Skip to content

Commit

Permalink
fix: do not parse null
Browse files Browse the repository at this point in the history
  • Loading branch information
invm authored and Michael Ionov committed Oct 1, 2023
1 parent e3885f7 commit 7776cec
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const parseObjRecursive = (obj: any): Record<string, any> => {
return Object.fromEntries(
Object.entries(obj).map(([k, v]) => [k, parseObjRecursive(v)])
);
} else {
return obj;
}
} else {
try {
Expand All @@ -29,7 +31,7 @@ const parseObjRecursive = (obj: any): Record<string, any> => {
};

export const ResultsTable = (props: { rows: Row[] }) => {
const [code, setCode] = createSignal("console.log('hello world!')");
const [code, setCode] = createSignal("");
const { ref, editorView, createExtension } = createCodeMirror({
onValueChange: setCode,
});
Expand Down Expand Up @@ -73,7 +75,6 @@ export const ResultsTable = (props: { rows: Row[] }) => {
label: "Show row in JSON",
action: function(_e, row) {
// @ts-ignore
console.log(row._row.data)
const data = parseObjRecursive(row._row.data);
setCode(JSON.stringify(data, null, 4));
// @ts-ignore
Expand Down

0 comments on commit 7776cec

Please sign in to comment.