MCPcopy Index your code
hub / github.com/angular/angular / exitCodeFromResult

Function exitCodeFromResult

packages/compiler-cli/src/perform_compile.ts:244–253  ·  view source on GitHub ↗
(diags: ReadonlyArray<ts.Diagnostic> | undefined)

Source from the content-addressed store, hash-verified

242}
243
244export function exitCodeFromResult(diags: ReadonlyArray<ts.Diagnostic> | undefined): number {
245 if (!diags) return 0;
246 if (diags.every((diag) => diag.category !== ts.DiagnosticCategory.Error)) {
247 // If we have a result and didn't get any errors, we succeeded.
248 return 0;
249 }
250
251 // Return 2 if any of the errors were unknown.
252 return diags.some((d) => d.source === 'angular' && d.code === api.UNKNOWN_ERROR_CODE) ? 2 : 1;
253}
254
255export function performCompilation<CbEmitRes extends ts.EmitResult = ts.EmitResult>({
256 rootNames,

Callers 3

doCompilationFunction · 0.90
mainDiagnosticsForTestFunction · 0.90
reportErrorsAndExitFunction · 0.90

Calls 1

someMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…