« get me outta code hell

data: {with,inheritFrom}OriginalRelease: add notFoundValue input - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/things/track/inheritFromOriginalRelease.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-02-06 08:17:51 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-02-06 08:33:41 -0400
commit3913092589410a5e8a68168c6edbb59082fb5613 (patch)
tree9da51f1a03313c4a9752137f2bdffc626b3c3622 /src/data/composite/things/track/inheritFromOriginalRelease.js
parent5eac956b82276d6342b4bbe6b10fac7b3a783bc4 (diff)
data: {with,inheritFrom}OriginalRelease: add notFoundValue input
Diffstat (limited to 'src/data/composite/things/track/inheritFromOriginalRelease.js')
-rw-r--r--src/data/composite/things/track/inheritFromOriginalRelease.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/data/composite/things/track/inheritFromOriginalRelease.js b/src/data/composite/things/track/inheritFromOriginalRelease.js
index a9d57f8..27ed138 100644
--- a/src/data/composite/things/track/inheritFromOriginalRelease.js
+++ b/src/data/composite/things/track/inheritFromOriginalRelease.js
@@ -3,6 +3,10 @@
 // dependencies provided. If allowOverride is true, then the continuation
 // will also be called if the original release exposed the requested
 // property as null.
+//
+// Like withOriginalRelease, this will early exit (with notFoundValue) if the
+// original release is specified by reference and that reference doesn't
+// resolve to anything.
 
 import {input, templateCompositeFrom} from '#composite';
 
@@ -14,10 +18,13 @@ export default templateCompositeFrom({
   inputs: {
     property: input({type: 'string'}),
     allowOverride: input({type: 'boolean', defaultValue: false}),
+    notFoundValue: input({defaultValue: null}),
   },
 
   steps: () => [
-    withOriginalRelease(),
+    withOriginalRelease({
+      notFoundValue: input('notFoundValue'),
+    }),
 
     {
       dependencies: [