« get me outta code hell

html: make isAttributes alias to isAttributesAdditionSingletValue - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-12-31 22:22:21 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-01-01 15:19:33 -0400
commit2fd0a2f4210d0954ef0af67b387a3c5a3ea91ad9 (patch)
tree4597415d024e25d3199902d4bf26be5a5d9c114b
parentdc52cf09944d3b7413ce79a4a9019815c73febb9 (diff)
html: make isAttributes alias to isAttributesAdditionSingletValue
-rw-r--r--src/util/html.js26
1 files changed, 1 insertions, 25 deletions
diff --git a/src/util/html.js b/src/util/html.js
index 7fd2bcfe..073bdaab 100644
--- a/src/util/html.js
+++ b/src/util/html.js
@@ -100,27 +100,7 @@ export function isBlank(value) {
   return value.length === 0;
 }
 
-export function isAttributes(value) {
-  if (typeof value !== 'object' || Array.isArray(value)) {
-    return false;
-  }
-
-  if (value === null) {
-    return false;
-  }
-
-  if (value instanceof Tag || value instanceof Template) {
-    return false;
-  }
-
-  // TODO: Validate attribute values (just the general shape)
-
-  return true;
-}
-
 export const validators = {
-  // TODO: Move above implementations here and detail errors
-
   isBlank(value) {
     if (!isBlank(value)) {
       throw new TypeError(`Expected html.blank()`);
@@ -142,11 +122,7 @@ export const validators = {
   },
 
   isAttributes(value) {
-    if (!isAttributes(value)) {
-      throw new TypeError(`Expected HTML attributes`);
-    }
-
-    return true;
+    return isAttributesAdditionSingletValue(value);
   },
 };