I am using the TypeScript Compiler API to harvest Interface details so I can create database tables. Works well but I would like to identify whether fields are nullable, or in TS jargon, have a type guard like string|undefined.
Eg
export default interface IAccount{
name: string;
description?: string;
}
I would like to be able to identify property "description" as string|undefined and hence, "nullable". I can access the node text via the compiler API and find "?" but is there a better way?