« get me outta code hell

data: Track.mainRelease, "Main Release: <album or track>" - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/wiki-properties
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-10-02 20:35:34 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-10-02 20:35:34 -0300
commitca412ca52b1998fe715951309d3e0546560c2c58 (patch)
tree4629d6b9f2e96cee427a0a641fa4472bbb6f78f6 /src/data/composite/wiki-properties
parentbfc4a8cb5deb69d3692837f8ede95089a01bef44 (diff)
data: Track.mainRelease, "Main Release: <album or track>"
Diffstat (limited to 'src/data/composite/wiki-properties')
-rw-r--r--src/data/composite/wiki-properties/singleReference.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/data/composite/wiki-properties/singleReference.js b/src/data/composite/wiki-properties/singleReference.js
index f532ebbe..2435dd2d 100644
--- a/src/data/composite/wiki-properties/singleReference.js
+++ b/src/data/composite/wiki-properties/singleReference.js
@@ -8,31 +8,31 @@
 //
 
 import {input, templateCompositeFrom} from '#composite';
-import {isThingClass, validateReference} from '#validators';
+import {validateReference} from '#validators';
 
 import {exposeDependency} from '#composite/control-flow';
 import {inputSoupyFind, inputWikiData, withResolvedReference}
   from '#composite/wiki-data';
 
+import {referenceListInputDescriptions, referenceListUpdateDescription}
+  from './helpers/reference-list-helpers.js';
+
 export default templateCompositeFrom({
   annotation: `singleReference`,
 
   compose: false,
 
   inputs: {
-    class: input.staticValue({validate: isThingClass}),
+    ...referenceListInputDescriptions(),
 
+    data: inputWikiData({allowMixedTypes: true}),
     find: inputSoupyFind(),
-    data: inputWikiData({allowMixedTypes: false}),
   },
 
-  update: ({
-    [input.staticValue('class')]: thingClass,
-  }) => ({
-    validate:
-      validateReference(
-        thingClass[Symbol.for('Thing.referenceType')]),
-  }),
+  update:
+    referenceListUpdateDescription({
+      validateReferenceList: validateReference,
+    }),
 
   steps: () => [
     withResolvedReference({