refactor(localize): remove unnecessary ! operator (#38082)

The messages property always exists so there is no need for the ! operator.

PR Close #38082
This commit is contained in:
Pete Bacon Darwin 2020-07-15 20:53:32 +01:00 committed by Andrew Kushnir
parent 6c9401c338
commit 56dd3e77ac
1 changed files with 2 additions and 2 deletions

View File

@ -35,8 +35,8 @@ export class Diagnostics {
this.messages.push(...other.messages); this.messages.push(...other.messages);
} }
formatDiagnostics(message: string): string { formatDiagnostics(message: string): string {
const errors = this.messages!.filter(d => d.type === 'error').map(d => ' - ' + d.message); const errors = this.messages.filter(d => d.type === 'error').map(d => ' - ' + d.message);
const warnings = this.messages!.filter(d => d.type === 'warning').map(d => ' - ' + d.message); const warnings = this.messages.filter(d => d.type === 'warning').map(d => ' - ' + d.message);
if (errors.length) { if (errors.length) {
message += '\nERRORS:\n' + errors.join('\n'); message += '\nERRORS:\n' + errors.join('\n');
} }