Zod

Z

Zod

Discussion for Zod, a runtime type library for TypeScript, and the surrounding ecosystem of libraries.

Join

Gludek - Hey,Quick question, is there any way ...

Hey, Quick question, is there any way to validate blobs/file uploads? TBH I'm not even sure if it even makes sense to do....

Leozinn - const AuthorSchema = z.object({ ...

``` const AuthorSchema = z.object({ name: z.string().max(256), url: z.string().url().optional().nullable(), icon_url: z.string().url().optional().nullable(),...
No description

Leozinn - i'm compiled my project, and interfac...

i'm compiled my project, and interfaces.d.ts return this... How am I going to use typing in my project, if it is like a zod object?...
No description

hinogi - tsconst a = z.object({ foo: z.strin...

```ts const a = z.object({ foo: z.string() }) ...
Solution:
ok so foo has to be foo: null | undefined and {} is not a valid solutions. also, if null, the key will persist, if undefined the key is gone 😄 thanks playground
Zod Community - Answer Overflow