Open razibus opened 3 years ago
I'd be happy to help you with this, but most of these questions are underspecified, so I need to ask you questions to clarify each. And with four (at least) questions in a single issue I fear this quickly gets messy.
Could I ask you to break this into the following issues?
{ * : . }
) relative to contextThe object matching issue is easy to solve:
def make1(data)
$data | {
"v1": number(.v[0]),
* : .
}
The |
sets the context node so that you can do object matching on it. The .v
dot access is also relative to the context node.
I have not found how to do basic operations on arrays and objects like :
The
* : .
operator is rejected inside a function. It would have been useful to define it relatively to the current context to provide unmatched keys/values. For instance:or
None are accepted. It would have been a great help to get a local semantic of the
* : .
operator relatively to the data variable.