hi! im trying to make a schema for lychee
because the format for post actions and contextual conditions is fucked up and objects can be nested (infinitely), i ended up making my own "system" that just bases itself off the recipe component system by writing a "map":
const anyString = Component("anyString");
const anyInt = Component("anyIntNumber");
const anyDouble = Component("anyDoubleNumber");
const bool = Component("bool");
const anyValue = bool.or(anyInt).or(anyDouble).or(anyString);
const jsonMap = anyValue.asMap(anyString);
const component = jsonMap.or(anyValue).asArrayOrSelf() /* Nested objects get "flattened" into an array */.asMap(anyString).asArrayOrSelf();
return component.map(...); // Logic for flattening in mapIn and unflattening in mapOut
however, this makes a very ugly probe output (see attached image); is there any way i could prettify it some? because this sucks for readability, actually
it's probably not working anymore