From 1f41b6f13fe1ccfa0a6e847629448a680b1b1be4 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 1 Jul 2025 08:12:57 -0300 Subject: data: exitWithoutArtwork --- src/data/composite/wiki-data/exitWithoutArtwork.js | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/data/composite/wiki-data/exitWithoutArtwork.js (limited to 'src/data/composite/wiki-data/exitWithoutArtwork.js') 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'), + }), + ], +}); -- cgit 1.3.0-6-gf8a5