Closed gordielachance closed 1 year ago
Validation can occur in two different scenarios: instanciation and mutation. On instanciation, if the object does not validate its model, it will be fully rejected. On mutation, if this mutation does not validate its model, the mutation will not be applied at all.
You should be able to apply your custom "clean-up" logic with a custom error collector: https://objectmodel.js.org/#doc-custom-collectors
closed after inactivity
Hi ! I’ve built a model with your (nice!) library. Works fine! Is there a way to use it to return a « cleaned » version of the data used to fill the model? I mean, removing all the properties that have returned an error.
Is that possible?
thanks!