Open keironlowe-edriving opened 4 days ago
I resolved that error by making specGroupValidator
a function which returns the vine object. But it now throws a maximum call stack size exceeded error.
From the looks if it, Vine doesn't support recursive objects?
Hi, I'm trying to build some validation that can handle recursive objects and I'm hitting against a TS error. Trying to figure out the best way to handle this.
For the following JSON, the
conditions
array can either be acondition
object, orgroup
object, thegroup
object can have aconditions
array which again, can have eithergroup
orcondition
object, and this can go on recursively.I'm mostly there with it with the following code...
But the problem is the
vine.union.if((value) => value.type === 'group', specGroupValidator),
line, which throws a TS error saying "Cannot access 'specGroupValidator' before initialization", which makes sense. I'm just not sure of the best way to work around this using Vine.Thanks!