maltejur / directus-extension-generate-types

Create types for your directus project in your favourite language.
Other
199 stars 24 forks source link

Nullable fields are only possibly undefined #17

Closed CodesDoWork closed 1 year ago

CodesDoWork commented 1 year ago

In typescript, the types of nullable field are just made possibly undefined. But there is missing the | null in the type. For example, the avatar of a DirectusUser has the following type: avatar?: string | DirectusFiles; But it should have this type: avatar: string | DirectusFiles | null;

I think it would be a good approach on this. In the meanwhile, we can check those fields for falsy values.

Btw, thank you for this great extension! Currently, there is no other tool, that satisfies my needs for type generation for Directus.