From 98446f3f30dbc0bc8fe55bae1e4729cd023dbf71 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 16 Nov 2024 12:37:10 -0400 Subject: data: factor out inputNotFoundMode --- src/data/composite/wiki-data/withResolvedReferenceList.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/data/composite/wiki-data/withResolvedReferenceList.js') diff --git a/src/data/composite/wiki-data/withResolvedReferenceList.js b/src/data/composite/wiki-data/withResolvedReferenceList.js index 42f0e175..f929d400 100644 --- a/src/data/composite/wiki-data/withResolvedReferenceList.js +++ b/src/data/composite/wiki-data/withResolvedReferenceList.js @@ -5,13 +5,12 @@ // to early exit ({notFoundMode: 'exit'}) or leave null in place ('null'). import {input, templateCompositeFrom} from '#composite'; -import {is, isString, validateArrayItems} from '#validators'; +import {isString, validateArrayItems} from '#validators'; -import { - exitWithoutDependency, - raiseOutputWithoutDependency, -} from '#composite/control-flow'; +import {exitWithoutDependency, raiseOutputWithoutDependency} + from '#composite/control-flow'; +import inputNotFoundMode from './inputNotFoundMode.js'; import inputWikiData from './inputWikiData.js'; export default templateCompositeFrom({ @@ -26,10 +25,7 @@ export default templateCompositeFrom({ data: inputWikiData({allowMixedTypes: true}), find: input({type: 'function'}), - notFoundMode: input({ - validate: is('exit', 'filter', 'null'), - defaultValue: 'filter', - }), + notFoundMode: inputNotFoundMode(), }, outputs: ['#resolvedReferenceList'], -- cgit 1.3.0-6-gf8a5