diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-03-29 09:41:19 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-03-29 09:41:19 -0300 |
commit | 47a2d6a9adf5059c194350e61d6beb3ff083088c (patch) | |
tree | f3e8fee6b62b5be0bdd525bc10c0bb5d74742ece | |
parent | 589dfa71fd73661e990d0d7ef70bd700b2e58165 (diff) |
html: pass null/undefined through in slot values
-rw-r--r-- | src/util/html.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util/html.js b/src/util/html.js index 3980b9aa..5ea5e0ad 100644 --- a/src/util/html.js +++ b/src/util/html.js @@ -398,7 +398,11 @@ export class Template { getSlot(slotName) { if (this.#slotContents[slotName]) { - const contents = this.#slotContents[slotName].map(item => item.valueOf()); + const contents = this.#slotContents[slotName] + .map(item => + (item === null || item === undefined + ? item + : item.valueOf())); return new Tag(null, null, contents).valueOf(); } else { return []; |