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

Function printDiagnostics

typescript/verify.js:140–160  ·  view source on GitHub ↗

* Prints the diagnostics to stdout. * @param {typeof ts} compiler The TypeScript compiler that produced them. * @param {ts.Diagnostic[]} diagnostics The diagnostics to report.

(compiler, diagnostics)

Source from the content-addressed store, hash-verified

138 * @param {ts.Diagnostic[]} diagnostics The diagnostics to report.
139 */
140function printDiagnostics(compiler, diagnostics) {
141 diagnostics.forEach((diagnostic) => {
142 let message = '';
143
144 if (diagnostic.file && diagnostic.start) {
145 let start = diagnostic.file.getLineAndCharacterOfPosition(
146 diagnostic.start
147 );
148
149 message += ` ${diagnostic.file.fileName} (${start.line + 1},${
150 start.character + 1
151 })`;
152 }
153
154 message +=
155 ': ' +
156 compiler.flattenDiagnosticMessageText(diagnostic.messageText, ' \n');
157
158 process.stdout.write(`\x1b[30m ${message}\x1b[0m\n`);
159 });
160}

Callers 1

verifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected