-
-
Notifications
You must be signed in to change notification settings - Fork 51
Support valibot (lightweight version of zod) #577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@lopezjurip Hi! |
@Code-Hex @lopezjurip |
@MH4GF Sure! I'm looking forward your PR! |
@Code-Hex Please let me confirm about the Surprisingly, valibot seems to compile the following code: import * as v from 'valibot';
type A = {
foo: any;
};
function AParser(): v.ObjectSchema<A, undefined> {
return v.object({
foo: v.any()
});
}
const result = v.safeParse(AParser(), {
foo: 'bar',
});
console.log(result);
type InferA = v.InferOutput<ReturnType<typeof AParser>>;
// =>
// type InferA = {
// foo: any;
// } So, is the schema to be generated correct with the intention of ref: colinhacks/zod#951 |
@MH4GF Thank you for your question. In zod, I employed a hack to define a schema for the any type that excludes undefined and null. I hope to create something that aligns with this intention. Does this answer your question? |
@MH4GF Big Thanks!! I just published valibot support version! |
Consider Valibot over Zod: achieves lighter bundles & modularity, enhancing performance & flexibility.
https://bundlephobia.com/package/zod@3.22.4
It's 57KB gziped.
See: https://github.com/fabian-hiller/valibot
The text was updated successfully, but these errors were encountered: