source: trip-planner-front/node_modules/@ngtools/webpack/src/ivy/diagnostics.js@ 8d391a1

Last change on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.3 KB
Line 
1"use strict";
2/**
3 * @license
4 * Copyright Google LLC All Rights Reserved.
5 *
6 * Use of this source code is governed by an MIT-style license that can be
7 * found in the LICENSE file at https://angular.io/license
8 */
9Object.defineProperty(exports, "__esModule", { value: true });
10exports.addError = exports.addWarning = exports.createDiagnosticsReporter = void 0;
11const compiler_cli_1 = require("@angular/compiler-cli");
12const typescript_1 = require("typescript");
13function createDiagnosticsReporter(compilation) {
14 return (diagnostics) => {
15 for (const diagnostic of diagnostics) {
16 const text = compiler_cli_1.formatDiagnostics([diagnostic]);
17 if (diagnostic.category === typescript_1.DiagnosticCategory.Error) {
18 addError(compilation, text);
19 }
20 else {
21 addWarning(compilation, text);
22 }
23 }
24 };
25}
26exports.createDiagnosticsReporter = createDiagnosticsReporter;
27function addWarning(compilation, message) {
28 compilation.warnings.push(new compilation.compiler.webpack.WebpackError(message));
29}
30exports.addWarning = addWarning;
31function addError(compilation, message) {
32 compilation.errors.push(new compilation.compiler.webpack.WebpackError(message));
33}
34exports.addError = addError;
Note: See TracBrowser for help on using the repository browser.