diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-05-06 13:36:41 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-05-06 13:36:53 -0300 |
commit | af1db3b02a4e5791aeb46c1f253989a3b10815ac (patch) | |
tree | 71cb2f96e7edde3f3a4357669283b1872ae0f1ba /src/data/composite/things/content/hasAnnotationPart.js | |
parent | 95cc0b6e8c9374e351ae8e985b03887c7155b138 (diff) |
data: factor out withHasAnnotationPart
Diffstat (limited to 'src/data/composite/things/content/hasAnnotationPart.js')
-rw-r--r-- | src/data/composite/things/content/hasAnnotationPart.js | 28 |
1 files changed, 6 insertions, 22 deletions
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()), - }, ], }); |