« get me outta code hell

data: exitWithoutArtwork - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/wiki-data/exitWithoutArtwork.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-07-01 08:12:57 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-07-01 08:12:57 -0300
commit1f41b6f13fe1ccfa0a6e847629448a680b1b1be4 (patch)
tree3c14e4e0e92bfefd485e901ccfb3a7790866c2eb /src/data/composite/wiki-data/exitWithoutArtwork.js
parent6802a68176ec7e97eda29999f130a4e63b853a94 (diff)
data: exitWithoutArtwork
Diffstat (limited to 'src/data/composite/wiki-data/exitWithoutArtwork.js')
-rw-r--r--src/data/composite/wiki-data/exitWithoutArtwork.js45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/data/composite/wiki-data/exitWithoutArtwork.js b/src/data/composite/wiki-data/exitWithoutArtwork.js
new file mode 100644
index 00000000..8e799fda
--- /dev/null
+++ b/src/data/composite/wiki-data/exitWithoutArtwork.js
@@ -0,0 +1,45 @@
+import {input, templateCompositeFrom} from '#composite';
+import {isContributionList, isThing, strictArrayOf} from '#validators';
+
+import {exitWithoutDependency} from '#composite/control-flow';
+
+import withHasArtwork from './withHasArtwork.js';
+
+export default templateCompositeFrom({
+  annotation: `exitWithoutArtwork`,
+
+  inputs: {
+    contribs: input({
+      validate: isContributionList,
+      defaultValue: null,
+    }),
+
+    artwork: input({
+      validate: isThing,
+      defaultValue: null,
+    }),
+
+    artworks: input({
+      validate: strictArrayOf(isThing),
+      defaultValue: null,
+    }),
+
+    value: input({
+      defaultValue: null,
+    }),
+  },
+
+  steps: () => [
+    withHasArtwork({
+      contribs: input('contribs'),
+      artwork: input('artwork'),
+      artworks: input('artworks'),
+    }),
+
+    exitWithoutDependency({
+      dependency: '#hasArtwork',
+      mode: input.value('falsy'),
+      value: input('value'),
+    }),
+  ],
+});