« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/util/html.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/html.js')
-rw-r--r--src/util/html.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/util/html.js b/src/util/html.js
index 752291e..0a58622 100644
--- a/src/util/html.js
+++ b/src/util/html.js
@@ -1,5 +1,3 @@
-/** @format */
-
 // Some really simple functions for formatting HTML content.
 
 // COMPREHENSIVE!
@@ -116,16 +114,18 @@ export function escapeAttributeValue(value) {
 export function attributes(attribs) {
   return Object.entries(attribs)
     .map(([key, val]) => {
-      if (typeof val === 'undefined' || val === null) return [key, val, false];
-      else if (typeof val === 'string') return [key, val, true];
-      else if (typeof val === 'boolean') return [key, val, val];
-      else if (typeof val === 'number') return [key, val.toString(), true];
+      if (typeof val === 'undefined' || val === null)
+        return [key, val, false];
+      else if (typeof val === 'string')
+        return [key, val, true];
+      else if (typeof val === 'boolean')
+        return [key, val, val];
+      else if (typeof val === 'number')
+        return [key, val.toString(), true];
       else if (Array.isArray(val))
         return [key, val.filter(Boolean).join(' '), val.length > 0];
       else
-        throw new Error(
-          `Attribute value for ${key} should be primitive or array, got ${typeof val}`
-        );
+        throw new Error(`Attribute value for ${key} should be primitive or array, got ${typeof val}`);
     })
     .filter(([_key, _val, keep]) => keep)
     .map(([key, val]) =>