ts-morph
Generators
Nodes like FunctionDeclaration
and MethodDeclaration
can be generators.
Tell if a generator
functionDeclaration.isGenerator(); // returns: boolean
Set as a generator
functionDeclaration.setIsGenerator(true); // or false to set as not one
Get asterisk token (*
)
Gets the asterisk token or undefined if not exists:
functionDeclaration.getAsteriskToken();