« 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/validators.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/validators.js')
-rw-r--r--src/data/validators.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/data/validators.js b/src/data/validators.js
index 39559cfa..f886c4f2 100644
--- a/src/data/validators.js
+++ b/src/data/validators.js
@@ -819,6 +819,17 @@ export function validateReferenceList(type = '') {
   return validateArrayItems(validateReference(type));
 }
 
+export function validateAnnotatedReference(type = '') {
+  return validateProperties({
+    reference: validateReference(type),
+    annotation: optional(isContentString),
+  });
+}
+
+export function validateAnnotatedReferenceList(type = '') {
+  return validateArrayItems(validateAnnotatedReference(type));
+}
+
 export function validateThing({
   referenceType: expectedReferenceType = '',
 } = {}) {