From 3913092589410a5e8a68168c6edbb59082fb5613 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 6 Feb 2024 08:17:51 -0400 Subject: data: {with,inheritFrom}OriginalRelease: add notFoundValue input --- src/data/composite/things/track/inheritFromOriginalRelease.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/data/composite/things/track/inheritFromOriginalRelease.js') diff --git a/src/data/composite/things/track/inheritFromOriginalRelease.js b/src/data/composite/things/track/inheritFromOriginalRelease.js index a9d57f86..27ed1387 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: [ -- cgit 1.3.0-6-gf8a5