MCPcopy Create free account
hub / github.com/cure53/dompurify / printDiagnostics

Function printDiagnostics

typescript/verify.js:103–122  ·  view source on GitHub ↗

* Prints the diagnostics to stdout. * @param {ts.Diagnostic[]} diagnostics The diagnostics to report.

(diagnostics)

Source from the content-addressed store, hash-verified

101 * @param {ts.Diagnostic[]} diagnostics The diagnostics to report.
102 */
103function printDiagnostics(diagnostics) {
104 diagnostics.forEach((diagnostic) => {
105 let message = '';
106
107 if (diagnostic.file && diagnostic.start) {
108 let start = diagnostic.file.getLineAndCharacterOfPosition(
109 diagnostic.start
110 );
111
112 message += ` ${diagnostic.file.fileName} (${start.line + 1},${
113 start.character + 1
114 })`;
115 }
116
117 message +=
118 ': ' + ts.flattenDiagnosticMessageText(diagnostic.messageText, ' \n');
119
120 process.stdout.write(`\x1b[30m ${message}\x1b[0m\n`);
121 });
122}

Callers 1

verifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected