Skip to content
Snippets Groups Projects
Commit 99c52f7b authored by Jonas Zohren's avatar Jonas Zohren :speech_balloon:
Browse files

Add better json debug handling

parent 9d15a08c
No related branches found
No related tags found
No related merge requests found
Pipeline #19686 passed
...@@ -14,7 +14,7 @@ import FormulaS from "./FormulaS.svelte"; ...@@ -14,7 +14,7 @@ import FormulaS from "./FormulaS.svelte";
for (let i = 0; i <= NUMBER_OF_WORKPACKAGES; i++) { for (let i = 0; i <= NUMBER_OF_WORKPACKAGES; i++) {
workPackages.push({a: null, b:null, c: null}); workPackages.push({a: null, b:null, c: null});
} }
$: dataJson = JSON.stringify(workPackages, null, 2) $: dataJson = JSON.stringify(workPackages.filter(({a,b,c}) => a !== null || b !== null || c !== null), null, 2)
let jsonPasteArea = ""; let jsonPasteArea = "";
...@@ -60,7 +60,7 @@ import FormulaS from "./FormulaS.svelte"; ...@@ -60,7 +60,7 @@ import FormulaS from "./FormulaS.svelte";
<summary> <summary>
Debug: Show Input as JSON Debug: Show Input as JSON
</summary> </summary>
<pre> <pre style="border: 1px solid;">
{dataJson} {dataJson}
</pre> </pre>
</details><details> </details><details>
...@@ -81,7 +81,7 @@ import FormulaS from "./FormulaS.svelte"; ...@@ -81,7 +81,7 @@ import FormulaS from "./FormulaS.svelte";
if (typeof elem.c !== 'number' && elem.c !== null) if (typeof elem.c !== 'number' && elem.c !== null)
throw TypeError("An 'c' attribute was neither number not null"); throw TypeError("An 'c' attribute was neither number not null");
} }
workPackages = decoded; workPackages = [...decoded, {a: null, b: null, c: null}];
jsonPasteArea = ""; jsonPasteArea = "";
} catch (error) { } catch (error) {
alert(error.toString()) alert(error.toString())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment