From af1db3b02a4e5791aeb46c1f253989a3b10815ac Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 6 May 2025 13:36:41 -0300 Subject: data: factor out withHasAnnotationPart --- .../composite/things/content/hasAnnotationPart.js | 28 +++++----------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'src/data/composite/things/content/hasAnnotationPart.js') 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()), - }, ], }); -- cgit 1.3.0-6-gf8a5