It only displays a merge of all the items of the array instead of the array itself.
It’s misleading as we can’t be sure what saved for sure in the UDF.
(Made me change quite a bit of code ><)
Reproduction:
If you take the following UDFs:
Query(
Lambda('x',
Let([
{ case: null },
{ case: If(Equals(Var('x'), 0), 0, Var('case')) },
{ case: If(Equals(Var('x'), 1), 1, Var('case')) },
{ case: If(Equals(Var('x'), 2), 2, Var('case')) }
],
Var('case')
)
)
)
Once saved it shows as:
Query(Lambda("x", Let({case: If(Equals(Var("x"), 2), 2, Var("case"))}, Var("case"))))
As well as when fetched:
{
"resource": {
"ref": {
"@ref": {
"id": "test",
"collection": {
"@ref": {
"id": "functions"
}
}
}
},
"ts": 1591795452150000,
"name": "test",
"body": {
"@query": {
"lambda": "x",
"expr": {
"let": {
"case": {
"if": {
"equals": [
{
"var": "x"
},
2
]
},
"then": 2,
"else": {
"var": "case"
}
}
},
"in": {
"var": "case"
}
}
}
}
}
}