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
|
// Actually execute a reverse function.
import {input, templateCompositeFrom} from '#composite';
import inputWikiData from '../inputWikiData.js';
export default templateCompositeFrom({
annotation: `withReverseReferenceList`,
inputs: {
data: inputWikiData({allowMixedTypes: true}),
reverse: input({type: 'function'}),
options: input({type: 'object', defaultValue: null}),
},
outputs: ['#resolvedReverse'],
steps: () => [
{
dependencies: [
input.myself(),
input('data'),
input('reverse'),
input('options'),
],
compute: (continuation, {
[input.myself()]: myself,
[input('data')]: data,
[input('reverse')]: reverseFunction,
[input('options')]: opts,
}) => continuation({
['#resolvedReverse']:
(data
? reverseFunction(myself, data, opts)
: reverseFunction(myself, opts)),
}),
},
],
});
|