« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/util/html.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/util/html.js b/src/util/html.js
index 0c29ecd1..32350236 100644
--- a/src/util/html.js
+++ b/src/util/html.js
@@ -6,6 +6,10 @@ import {colors} from '#cli';
 import {empty, typeAppearance} from '#sugar';
 import * as commonValidators from '#validators';
 
+const {
+  validateInstanceOf,
+} = commonValidators;
+
 // COMPREHENSIVE!
 // https://html.spec.whatwg.org/multipage/syntax.html#void-elements
 export const selfClosingTags = [
@@ -72,14 +76,6 @@ export function isBlank(value) {
   return value.length === 0;
 }
 
-export function isTag(value) {
-  return value instanceof Tag;
-}
-
-export function isTemplate(value) {
-  return value instanceof Template;
-}
-
 export function isHTML(value) {
   if (typeof value === 'string') {
     return true;
@@ -1238,3 +1234,9 @@ export class Stationery {
         : `Stationery ${colors.dim(`(no annotation)`)}`));
   }
 }
+
+export const isTag =
+  validateInstanceOf(Tag);
+
+export const isTemplate =
+  validateInstanceOf(Template);