CSharpToTypeScript icon indicating copy to clipboard operation
CSharpToTypeScript copied to clipboard

Nullable for non-primitive fields

Open antal-huck opened this issue 4 years ago • 0 comments

Since non-primitives in C# are nullable, would it make sense if all the transformed non-primitive fields in the TypeScript interfaces also get nullable?

Example: Suppose we have a C# class ExampleClass with one field a of type NestedClass. Then the transformed TypeScript interface could automatically be:

export interface ExampleClass { a: NestedClass | null; }

instead of

export interface ExampleClass { a: NestedClass; }

antal-huck avatar May 21 '21 18:05 antal-huck