diff options
Diffstat (limited to 'src/data/composite/wiki-properties/soupyReverse.js')
-rw-r--r-- | src/data/composite/wiki-properties/soupyReverse.js | 10 |
1 files changed, 7 insertions, 3 deletions
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], }); |