« get me outta code hell

data: factor out withHasAnnotationPart - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/things/content/hasAnnotationPart.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-05-06 13:36:41 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-05-06 13:36:53 -0300
commitaf1db3b02a4e5791aeb46c1f253989a3b10815ac (patch)
tree71cb2f96e7edde3f3a4357669283b1872ae0f1ba /src/data/composite/things/content/hasAnnotationPart.js
parent95cc0b6e8c9374e351ae8e985b03887c7155b138 (diff)
data: factor out withHasAnnotationPart
Diffstat (limited to 'src/data/composite/things/content/hasAnnotationPart.js')
-rw-r--r--src/data/composite/things/content/hasAnnotationPart.js28
1 files changed, 6 insertions, 22 deletions
diff --git a/src/data/composite/things/content/hasAnnotationPart.js b/src/data/composite/things/content/hasAnnotationPart.js
index 8b2cbb8b..83d175e3 100644
--- a/src/data/composite/things/content/hasAnnotationPart.js
+++ b/src/data/composite/things/content/hasAnnotationPart.js
@@ -1,8 +1,8 @@
 import {input, templateCompositeFrom} from '#composite';
 
-import {exitWithoutDependency} from '#composite/control-flow';
+import {exposeDependency} from '#composite/control-flow';
 
-import withAnnotationParts from './withAnnotationParts.js';
+import withHasAnnotationPart from './withHasAnnotationPart.js';
 
 export default templateCompositeFrom({
   annotation: `hasAnnotationPart`,
@@ -14,28 +14,12 @@ export default templateCompositeFrom({
   },
 
   steps: () => [
-    withAnnotationParts({
-      mode: input.value('strings'),
+    withHasAnnotationPart({
+      part: input('part'),
     }),
 
-    exitWithoutDependency({
-      dependency: '#annotationParts',
-      value: input.value(false),
+    exposeDependency({
+      dependency: '#hasAnnotationPart',
     }),
-
-    {
-      dependencies: [
-        input('part'),
-        '#annotationParts',
-      ],
-
-      compute: ({
-        [input('part')]: search,
-        ['#annotationParts']: parts,
-      }) =>
-        parts.some(part =>
-          part.toLowerCase() ===
-          search.toLowerCase()),
-    },
   ],
 });