From 77fc589466fc0c04326231638c5ec6026e7948d4 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 11 Jan 2025 20:49:26 -0400 Subject: data: soupy reverse --- src/data/composite/wiki-properties/soupyReverse.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/data/composite/wiki-properties/soupyReverse.js (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 new file mode 100644 index 00000000..269ccd6f --- /dev/null +++ b/src/data/composite/wiki-properties/soupyReverse.js @@ -0,0 +1,22 @@ +import {isObject} from '#validators'; + +import {inputSoupyReverse} from '#composite/wiki-data'; + +function soupyReverse() { + return { + flags: {update: true}, + update: {validate: isObject}, + }; +} + +soupyReverse.input = inputSoupyReverse.input; + +soupyReverse.contributionsBy = + (bindTo, contributionsProperty) => ({ + bindTo, + + referencing: thing => thing[contributionsProperty], + referenced: contrib => [contrib.artist], + }); + +export default soupyReverse; -- cgit 1.3.0-6-gf8a5