mercredi 7 avril 2021

Get class attributes from class defintion

I would like to get a list of attributes from the class itself (not a class instance)

class A { a:string; b:string; }
getAttributes(A); // returns ['a', 'b']

Is this possible in typescript ?





Aucun commentaire:

Enregistrer un commentaire