From 2fd0a2f4210d0954ef0af67b387a3c5a3ea91ad9 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 31 Dec 2023 22:22:21 -0400 Subject: html: make isAttributes alias to isAttributesAdditionSingletValue --- src/util/html.js | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'src') 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); }, }; -- cgit 1.3.0-6-gf8a5