You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does validateFoo reuse the validateBar function internally? Otherwise it would be a lot of duplicated validator code.
Does prune works also on array items and optional invalid fields? Docs says only superfluous properties so probably not? F.e:
interface Foo {
value?: string;
arr: Array<string & tags.MinItems<1>>;
}
const res: typia.IValidation<Foo> = typia.misc.validatePrune<Foo>({ value: 1, arr: ["a", 2] });
/** Expected:
* 1 is not a string, but it is optional so it fallbacks to undefined -> should log warning/error
* 2 is not a string so it is removed. It still passes the MinItems validation -> should log warning/error
* /
console.log(res.data); // { arr: ["a"] }
I need basically greedy validator that returns the maximum possible while maintaining validity, together with warnings/errors. Any tips appreciated. Thanks
The text was updated successfully, but these errors were encountered:
mysuf
changed the title
Lazy validation
Greedy validation
Aug 8, 2024
I have huge nested tree type definition and I'm wondering about few things:
Does validateFoo reuse the validateBar function internally? Otherwise it would be a lot of duplicated validator code.
I need basically greedy validator that returns the maximum possible while maintaining validity, together with warnings/errors. Any tips appreciated. Thanks
The text was updated successfully, but these errors were encountered: