From a0a7f15520b55043d9321a455a49a33558254aa1 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 8 Apr 2025 18:20:58 -0300 Subject: data: constitutibleArtwork & related infrastructure --- src/data/composite/wiki-properties/soupyReverse.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/data/composite/wiki-properties/soupyReverse.js') diff --git a/src/data/composite/wiki-properties/soupyReverse.js b/src/data/composite/wiki-properties/soupyReverse.js index b99c45da..784a66b4 100644 --- a/src/data/composite/wiki-properties/soupyReverse.js +++ b/src/data/composite/wiki-properties/soupyReverse.js @@ -20,12 +20,16 @@ soupyReverse.contributionsBy = }); soupyReverse.artworkContributionsBy = - (bindTo, artworkProperty) => ({ + (bindTo, artworkProperty, {single = false} = {}) => ({ bindTo, referencing: thing => - thing[artworkProperty] - .flatMap(artwork => artwork.artistContribs), + (single + ? (thing[artworkProperty] + ? thing[artworkProperty].artistContribs + : []) + : thing[artworkProperty] + .flatMap(artwork => artwork.artistContribs)), referenced: contrib => [contrib.artist], }); -- cgit 1.3.0-6-gf8a5