1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
// Provides a value inherited from the main release, or null,
// if this track is not a secondary release.
import {input, templateCompositeFrom} from '#composite';
import {withResultOfAvailabilityCheck} from '#composite/control-flow';
import {withPropertyFromObject} from '#composite/data';
export default templateCompositeFrom({
annotation: `withPropertyFromMainRelease`,
inputs: {
property: input({type: 'string'}),
},
outputs: ({
[input.staticValue('property')]: property,
}) => [
(property
? '#mainRelease.' + property
: '#mainReleaseValue'),
],
steps: () => [
{
dependencies: ['isSecondaryRelease', input.staticValue('property')],
compute: (continuation, {
['isSecondaryRelease']: isSecondaryRelease,
[input.staticValue('property')]: property,
}) =>
(isSecondaryRelease
? continuation()
: property
? continuation.raiseOutput({['#mainRelease.' + property]: null})
: continuation.raiseOutput({'#mainReleaseValue': null})),
},
withPropertyFromObject({
object: 'mainReleaseTrack',
property: input('property'),
}),
{
dependencies: ['#value', input.staticValue('property')],
compute: (continuation, {
['#value']: value,
[input.staticValue('property')]: property,
}) =>
(property
? continuation.raiseOutput({['#mainRelease.' + property]: value})
: continuation.raiseOutput({'#mainReleaseValue': value})),
},
],
});
|