« get me outta code hell

html: standard blank() function - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-04-05 15:41:38 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-04-05 15:41:38 -0300
commit17f1220718f0e736723108042fc00cd5cb90070d (patch)
tree935e5cd02baab0ca20ae9c4e694a4874ce51f6bb /src
parent575fef166cfe915b743d89a2007e259c3fcb4904 (diff)
html: standard blank() function
For now this just returns an empty array, but if we need to make
changes later, it won't require editing all instances of blank
content!
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/generateAlbumTrackList.js2
-rw-r--r--src/misc-templates.js2
-rw-r--r--src/util/html.js6
3 files changed, 7 insertions, 3 deletions
diff --git a/src/content/dependencies/generateAlbumTrackList.js b/src/content/dependencies/generateAlbumTrackList.js
index a2b0304..f2f2279 100644
--- a/src/content/dependencies/generateAlbumTrackList.js
+++ b/src/content/dependencies/generateAlbumTrackList.js
@@ -121,6 +121,6 @@ export default {
       return html.tag(listTag, relations.itemsByTrack);
     }
 
-    return [];
+    return html.blank();
   }
 };
diff --git a/src/misc-templates.js b/src/misc-templates.js
index 651b6bc..710dbcc 100644
--- a/src/misc-templates.js
+++ b/src/misc-templates.js
@@ -53,7 +53,7 @@ function unbound_generateChronologyLinks(currentThing, {
   const contributions = currentThing[contribKey];
 
   if (empty(contributions)) {
-    return [];
+    return html.blank();
   }
 
   if (contributions.length > 8) {
diff --git a/src/util/html.js b/src/util/html.js
index a7b44ec..be26700 100644
--- a/src/util/html.js
+++ b/src/util/html.js
@@ -38,6 +38,10 @@ export const joinChildren = Symbol();
 // or when there are multiple children.
 export const noEdgeWhitespace = Symbol();
 
+export function blank() {
+  return [];
+}
+
 export function tag(tagName, ...args) {
   let content;
   let attributes;
@@ -408,7 +412,7 @@ export class Template {
             : item.valueOf()));
       return new Tag(null, null, contents).valueOf();
     } else {
-      return [];
+      return blank();
     }
   }