Skip to main content

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: ""