« get me outta code hell

reverse: bindTo 'wikiData' - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/reverse.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-01-11 17:33:58 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-01-11 17:33:58 -0400
commitedad98e0408571e4c6cabceaa5234510cefaaea5 (patch)
tree39811827bca3a2ba1b93640a6c9dac635f68d991 /src/reverse.js
parent7a30ec426d9cb4049c663441a510bd1525deed40 (diff)
reverse: bindTo 'wikiData'
Diffstat (limited to 'src/reverse.js')
-rw-r--r--src/reverse.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/reverse.js b/src/reverse.js
index 9cab5ef8..59790219 100644
--- a/src/reverse.js
+++ b/src/reverse.js
@@ -22,7 +22,9 @@ function reverseHelper(spec) {
     // one reverse spec is different from another.
 
     const referencingThings =
-      data.flatMap(thing => spec.referencing(thing));
+      (spec.bindTo === 'wikiData'
+        ? spec.referencing(data)
+        : data.flatMap(thing => spec.referencing(thing)));
 
     const referencedThings =
       referencingThings.map(thing => spec.referenced(thing));