From a2488d2f5f5d1b9ef096c2d9968c56e6439adcac Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 3 Jan 2025 08:11:15 -0400 Subject: data: with{Resolved,Reverse}AnnotatedReferenceList: dates --- .../wiki-data/withResolvedAnnotatedReferenceList.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/data/composite/wiki-data/withResolvedAnnotatedReferenceList.js') diff --git a/src/data/composite/wiki-data/withResolvedAnnotatedReferenceList.js b/src/data/composite/wiki-data/withResolvedAnnotatedReferenceList.js index e2b8a0a1..789a8844 100644 --- a/src/data/composite/wiki-data/withResolvedAnnotatedReferenceList.js +++ b/src/data/composite/wiki-data/withResolvedAnnotatedReferenceList.js @@ -1,6 +1,6 @@ import {input, templateCompositeFrom} from '#composite'; import {stitchArrays} from '#sugar'; -import {isObject, validateArrayItems} from '#validators'; +import {isDate, isObject, validateArrayItems} from '#validators'; import {withPropertyFromList} from '#composite/data'; @@ -24,6 +24,11 @@ export default templateCompositeFrom({ acceptsNull: true, }), + date: input({ + validate: isDate, + acceptsNull: true, + }), + reference: input({type: 'string', defaultValue: 'reference'}), annotation: input({type: 'string', defaultValue: 'annotation'}), thing: input({type: 'string', defaultValue: 'thing'}), @@ -93,6 +98,17 @@ export default templateCompositeFrom({ }), }, + { + dependencies: ['#matches', input('date')], + compute: (continuation, { + ['#matches']: matches, + [input('date')]: date, + }) => continuation({ + ['#matches']: + matches.map(match => ({...match, date})), + }), + }, + withAvailabilityFilter({ from: '#resolvedReferenceList', }), -- cgit 1.3.0-6-gf8a5