From 97ec3e59db827876ea5b4233afac37407553be50 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 1 May 2025 15:06:59 -0300 Subject: data: hasAnnotationPart: case-insensitive --- .../composite/things/content/hasAnnotationPart.js | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'src/data/composite') diff --git a/src/data/composite/things/content/hasAnnotationPart.js b/src/data/composite/things/content/hasAnnotationPart.js index f989d829..8b2cbb8b 100644 --- a/src/data/composite/things/content/hasAnnotationPart.js +++ b/src/data/composite/things/content/hasAnnotationPart.js @@ -1,6 +1,6 @@ import {input, templateCompositeFrom} from '#composite'; -import {exposeWhetherDependencyAvailable} from '#composite/control-flow'; +import {exitWithoutDependency} from '#composite/control-flow'; import withAnnotationParts from './withAnnotationParts.js'; @@ -18,14 +18,24 @@ export default templateCompositeFrom({ mode: input.value('strings'), }), - withIndexInList({ - item: input('part'), - list: '#annotationParts', + exitWithoutDependency({ + dependency: '#annotationParts', + value: input.value(false), }), - exposeWhetherDependencyAvailable({ - dependency: '#index', - mode: input.value('index'), - }), + { + dependencies: [ + input('part'), + '#annotationParts', + ], + + compute: ({ + [input('part')]: search, + ['#annotationParts']: parts, + }) => + parts.some(part => + part.toLowerCase() === + search.toLowerCase()), + }, ], }); -- cgit 1.3.0-6-gf8a5