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
|
// The all-encompassing "directory" property, used as the unique identifier for
// almost any data object. Also corresponds to a part of the URL which pages of
// such objects are visited at.
import {input, templateCompositeFrom} from '#composite';
import {isDirectory, isName} from '#validators';
import {exposeDependency} from '#composite/control-flow';
import {withDirectory} from '#composite/wiki-data';
export default templateCompositeFrom({
annotation: `directory`,
compose: false,
inputs: {
name: input({
validate: isName,
defaultDependency: 'name',
}),
suffix: input({
validate: isDirectory,
defaultValue: null,
}),
},
steps: () => [
withDirectory({
directory: input.updateValue({validate: isDirectory}),
name: input('name'),
suffix: input('suffix'),
}),
exposeDependency({
dependency: '#directory',
}),
],
});
|