From 89cf67d4348d4ac43df158b265fdac4e48cfe03c Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 16 Nov 2024 15:40:40 -0400 Subject: data: withResolvedAnnotatedReferenceList: availability checks --- .../wiki-data/withResolvedAnnotatedReferenceList.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/data') diff --git a/src/data/composite/wiki-data/withResolvedAnnotatedReferenceList.js b/src/data/composite/wiki-data/withResolvedAnnotatedReferenceList.js index 341fdb3d..ac6b15fa 100644 --- a/src/data/composite/wiki-data/withResolvedAnnotatedReferenceList.js +++ b/src/data/composite/wiki-data/withResolvedAnnotatedReferenceList.js @@ -3,9 +3,14 @@ import {stitchArrays} from '#sugar'; import {isString, optional, validateArrayItems, validateProperties} from '#validators'; -import {withAvailabilityFilter} from '#composite/control-flow'; import {withPropertiesFromList} from '#composite/data'; +import { + exitWithoutDependency, + raiseOutputWithoutDependency, + withAvailabilityFilter, +} from '#composite/control-flow'; + import inputNotFoundMode from './inputNotFoundMode.js'; import inputWikiData from './inputWikiData.js'; import raiseResolvedReferenceList from './raiseResolvedReferenceList.js'; @@ -35,6 +40,19 @@ export default templateCompositeFrom({ outputs: ['#resolvedAnnotatedReferenceList'], steps: () => [ + exitWithoutDependency({ + dependency: input('data'), + value: input.value([]), + }), + + raiseOutputWithoutDependency({ + dependency: input('list'), + mode: input.value('empty'), + output: input.value({ + ['#resolvedAnnotatedReferenceList']: [], + }), + }), + withPropertiesFromList({ list: input('list'), properties: input.value([ -- cgit 1.3.0-6-gf8a5