« get me outta code hell

data: fix & tidy dynamic outputs in utilities - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-09-29 10:09:20 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-29 10:09:20 -0300
commitea02f6453f697d1e9fc6cfef2cdcf454c3f4286e (patch)
tree09b4db7d10f7d1eb0ce0af264d7c6d6b3e28f2ab
parentbc0f3fe427626bb3253c790898770f16701a512a (diff)
data: fix & tidy dynamic outputs in utilities
-rw-r--r--src/data/things/composite.js19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/data/things/composite.js b/src/data/things/composite.js
index eb93bd7c..7a3a8319 100644
--- a/src/data/things/composite.js
+++ b/src/data/things/composite.js
@@ -1938,15 +1938,12 @@ export const withPropertyFromObject = templateCompositeFrom({
   outputs: ({
     [input.staticDependency('object')]: object,
     [input.staticValue('property')]: property,
-  }) => {
-    return [
-      (object && property
-        ? (object.startsWith('#')
-            ? `${object}.${property}`
-            : `#${object}.${property}`)
-        : '#value'),
-    ];
-  },
+  }) =>
+    (object && property
+      ? (object.startsWith('#')
+          ? [`${object}.${property}`]
+          : [`#${object}.${property}`])
+      : ['#value']),
 
   steps: () => [
     {
@@ -2018,7 +2015,7 @@ export const withPropertiesFromObject = templateCompositeFrom({
          : object
             ? `${object}.${property}`
             : `#object.${property}`))
-      : '#object'),
+      : ['#object']),
 
   steps: () => [
     {
@@ -2135,7 +2132,7 @@ export const withPropertiesFromList = templateCompositeFrom({
          : list
             ? `${list}.${property}`
             : `#list.${property}`))
-      : '#lists'),
+      : ['#lists']),
 
   steps: () => [
     {