conditions make more sense this way

selene 2026-02-07 13:45:18 +01:00
parent b744f6cc4f
commit 085ec02ee4
Signed by: sel
SSH key fingerprint: SHA256:33R/4Rx5Lu4o81LyJyXdMrmP5CJ6j7j1Soo0Dn7mKc0

@ -136,28 +136,23 @@ Array of objects & their properties under `input`, that this property matches th
### `conditions` ### `conditions`
Array of references to other properties within the object, which may be itself, combined with values the target property must have for this property to be valid in the object instance. Object of arrays of references to other properties within the object, which may be itself, combined with values the target property must have for this property to be valid in the object instance. Some examples:
An example would look like this:
```toml ```toml
conditions = [ conditions = {
["input.value", "owo"], "input.value": ["owo"],
["input.version", "fact-checked by real transgender patriots"] "input.version": ["fact-checked by real transgender patriots"]
] }
``` ```
If a property is referenced multiple times, all of the provided options will be valid. This is an example from `meta/connection`:
```toml ```toml
conditions = [ conditions = {
["input.version", "function"] "input.version": ["function", "transform", "subobject", "custom"]
["input.version", "transform"] }
["input.version", "subobject"]
["input.version", "custom"]
]
``` ```
If the parent property of a property with conditions is an array, the conditions apply to all items of the array.
### `array` ### `array`
If `true`, the property will act as a collection of properties (referred to as an 'array'). When used as a transform destination, arrays add the source property's value to the first (0th) position. If `true`, the property will act as a collection of properties (referred to as an 'array'). When used as a transform destination, arrays add the source property's value to the first (0th) position.