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
|
// Compiles additional names directly provided on other releases.
import {input, templateCompositeFrom} from '#composite';
import {raiseOutputWithoutDependency} from '#composite/control-flow';
import {withFlattenedList} from '#composite/data';
import CacheableObject from '#cacheable-object';
import withOtherReleases from './withOtherReleases.js';
export default templateCompositeFrom({
annotation: `withSharedAdditionalNames`,
outputs: ['#sharedAdditionalNames'],
steps: () => [
withOtherReleases(),
raiseOutputWithoutDependency({
dependency: '#otherReleases',
mode: input.value('empty'),
output: input.value({'#sharedAdditionalNames': []}),
}),
// TODO: Using getUpdateValue is always a bit janky.
{
dependencies: ['#otherReleases'],
compute: (continuation, {
['#otherReleases']: otherReleases,
}) => continuation({
['#otherReleases.additionalNames']:
otherReleases.map(release =>
CacheableObject.getUpdateValue(release, 'additionalNames')
?? []),
}),
},
withFlattenedList({
list: '#otherReleases.additionalNames',
}).outputs({
'#flattenedList': '#sharedAdditionalNames',
}),
],
});
|