Only make recursive table on non-null objects
This commit is contained in:
parent
6e6a7b207e
commit
4ac53a4733
2
main.js
2
main.js
|
@ -137,7 +137,7 @@ function objectToTable(o) {
|
||||||
// TODO: hack hack hack
|
// TODO: hack hack hack
|
||||||
let table = `<table style="margin: 0.5em; border-collapse: collapse;">`;
|
let table = `<table style="margin: 0.5em; border-collapse: collapse;">`;
|
||||||
for (let [key, value] of Object.entries(o)) {
|
for (let [key, value] of Object.entries(o)) {
|
||||||
if (typeof value === "object") {
|
if (typeof value === "object" && value !== null) {
|
||||||
value = objectToTable(value);
|
value = objectToTable(value);
|
||||||
}
|
}
|
||||||
if (typeof value === "string" && /^https?:\/\//.test(value)) {
|
if (typeof value === "string" && /^https?:\/\//.test(value)) {
|
||||||
|
|
Loading…
Reference in a new issue