« get me outta code hell

data: auto-prefix '#' in output names - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-09-21 17:01:21 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-21 17:01:21 -0300
commit72c526dfeee2b227400b73c3b220cf36c885b703 (patch)
tree4c293856bd795432f6de8062989d055cec052f7c /src
parent4852931ecf2c7ce63851ea6f3a60c9d5b142ae6f (diff)
data: auto-prefix '#' in output names
Diffstat (limited to 'src')
-rw-r--r--src/data/things/composite.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/data/things/composite.js b/src/data/things/composite.js
index 700cc922..26df71ae 100644
--- a/src/data/things/composite.js
+++ b/src/data/things/composite.js
@@ -588,6 +588,10 @@ export function templateCompositeFrom(description) {
         ? description.outputs
      : typeof description.outputs === 'function'
         ? description.outputs(inputMetadata)
+            .map(name =>
+              (name.startsWith('#')
+                ? name
+                : '#' + name))
         : []);
 
     const ownUpdateDescription =
@@ -797,7 +801,9 @@ export function compositeFrom(description) {
         Object.entries(description.outputs)
           .map(([continuationName, outputName]) => [
             outputName,
-            providedDependencies[continuationName],
+            (continuationName in providedDependencies
+              ? providedDependencies[continuationName]
+              : providedDependencies[continuationName.replace(/^#/, '')]),
           ])));
   }