« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/html.js9
-rw-r--r--src/write/build-modes/static-build.js2
2 files changed, 11 insertions, 0 deletions
diff --git a/src/html.js b/src/html.js
index 71b6f4d5..097ecfee 100644
--- a/src/html.js
+++ b/src/html.js
@@ -53,6 +53,11 @@ export const attributeSpec = {
   },
 };
 
+// Validation keeps running even after we validate
+// all of data, this let us turn it off and let build run free
+let VALIDATION_DISABLED = false;
+export function finishValidation() { VALIDATION_DISABLED = true; }
+
 // Pass to tag() as an attributes key to make tag() return a 8lank tag if the
 // provided content is empty. Useful for when you'll only 8e showing an element
 // according to the presence of content that would 8elong there.
@@ -1773,6 +1778,10 @@ export class Template {
   }
 
   static validateSlotValueAgainstDescription(value, description) {
+    if (VALIDATION_DISABLED) {
+      return true;
+    }
+
     if (value === undefined) {
       throw new TypeError(`Specify value as null or don't specify at all`);
     }
diff --git a/src/write/build-modes/static-build.js b/src/write/build-modes/static-build.js
index b5ded04c..1683c729 100644
--- a/src/write/build-modes/static-build.js
+++ b/src/write/build-modes/static-build.js
@@ -233,6 +233,8 @@ export async function go({
     return false;
   }
 
+  html.finishValidation();
+
   /*
   await progressPromiseAll(`Writing data files shared across languages.`, queue(
     dataWrites.map(({path, data}) => () => {