Aller au contenu principal

debugComment()

debugComment(ctx, comment): string

Experimental

Generates a debug comment for the generated code. Only produces output when debug mode is enabled.


Parameters

ctx: GeneratorContext

The generator context

comment: string

The comment text


Returns: string

The formatted comment string, or empty string if not in debug mode


Since

2.0.0


Example

debugComment(ctx, "Type check: string");
// In debug mode: " // Type check: string"
// Not in debug mode: ""