« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/things')
-rw-r--r--src/data/things/validators.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/data/things/validators.js b/src/data/things/validators.js
index ac91b456..94c73b2a 100644
--- a/src/data/things/validators.js
+++ b/src/data/things/validators.js
@@ -12,6 +12,20 @@ function inspect(value) {
   return nodeInspect(value, {colors: ENABLE_COLOR});
 }
 
+export function getValidatorCreator(validator) {
+  return validator[Symbol.for(`hsmusic.validator.creator`)] ?? null;
+}
+
+export function getValidatorCreatorMeta(validator) {
+  return validator[Symbol.for(`hsmusic.validator.creatorMeta`)] ?? null;
+}
+
+export function setValidatorCreatorMeta(validator, creator, meta) {
+  validator[Symbol.for(`hsmusic.validator.creator`)] = creator;
+  validator[Symbol.for(`hsmusic.validator.creatorMeta`)] = meta;
+  return validator;
+}
+
 // Basic types (primitives)
 
 export function a(noun) {