@compodoc/compodoc
Version:
The missing documentation tool for your Angular application
20 lines (16 loc) • 440 B
text/typescript
import { ts } from 'ts-morph';
export class TsPrinterUtil {
private printer: ts.Printer;
constructor() {
this.printer = ts.createPrinter({
newLine: ts.NewLineKind.LineFeed
});
}
public print(node: ts.Node): string {
return this.printer.printNode(
ts.EmitHint.Unspecified,
node,
ts.createSourceFile('', '', ts.ScriptTarget.Latest)
);
}
}