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

Function verify

typescript/verify.js:45–63  ·  view source on GitHub ↗

* Verifies that a TypeScript project compiles. * @param {string} name The name of the project. * @param {string} directory The project directory. * @returns {Promise }

(name, directory)

Source from the content-addressed store, hash-verified

43 * @returns {Promise<void>}
44 */
45async function verify(name, directory) {
46 let line = ` ${name}...`;
47 process.stdout.write(line);
48
49 let diagnostics = await compile(path.join(directory, 'tsconfig.json'));
50 let success = diagnostics.length === 0;
51 let report = `\x1b${success ? '[32m✔' : '[31mX'}\x1b[0m`;
52
53 if (process.stdout.isTTY) {
54 process.stdout.write(`\x1b[${line.length}D${report} ${name} \n`);
55 } else {
56 process.stdout.write(` ${report}\n`);
57 }
58
59 if (!success) {
60 printDiagnostics(diagnostics);
61 process.exitCode = 1;
62 }
63}
64
65/**
66 * Compiles a TypeScript project.

Callers 1

runFunction · 0.85

Calls 2

compileFunction · 0.85
printDiagnosticsFunction · 0.85

Tested by

no test coverage detected