@@ -175,7 +175,7 @@ export class MatIconRegistry implements OnDestroy {
175
175
options ?: IconOptions ) : this {
176
176
const cleanLiteral = this . _sanitizer . sanitize ( SecurityContext . HTML , literal ) ;
177
177
178
- if ( ! cleanLiteral && ( typeof ngDevMode === 'undefined' || ngDevMode ) ) {
178
+ if ( ! cleanLiteral ) {
179
179
throw getMatIconFailedToSanitizeLiteralError ( literal ) ;
180
180
}
181
181
@@ -217,7 +217,7 @@ export class MatIconRegistry implements OnDestroy {
217
217
options ?: IconOptions ) : this {
218
218
const cleanLiteral = this . _sanitizer . sanitize ( SecurityContext . HTML , literal ) ;
219
219
220
- if ( ! cleanLiteral && ( typeof ngDevMode === 'undefined' || ngDevMode ) ) {
220
+ if ( ! cleanLiteral ) {
221
221
throw getMatIconFailedToSanitizeLiteralError ( literal ) ;
222
222
}
223
223
@@ -381,11 +381,11 @@ export class MatIconRegistry implements OnDestroy {
381
381
return forkJoin ( iconSetFetchRequests ) . pipe ( map ( ( ) => {
382
382
const foundIcon = this . _extractIconWithNameFromAnySet ( name , iconSetConfigs ) ;
383
383
384
- if ( ! foundIcon && ( typeof ngDevMode === 'undefined' || ngDevMode ) ) {
384
+ if ( ! foundIcon ) {
385
385
throw getMatIconNameNotFoundError ( name ) ;
386
386
}
387
387
388
- return foundIcon ! ;
388
+ return foundIcon ;
389
389
} ) ) ;
390
390
}
391
391
@@ -491,7 +491,7 @@ export class MatIconRegistry implements OnDestroy {
491
491
div . innerHTML = str ;
492
492
const svg = div . querySelector ( 'svg' ) as SVGElement ;
493
493
494
- if ( ! svg && ( typeof ngDevMode === 'undefined' || ngDevMode ) ) {
494
+ if ( ! svg ) {
495
495
throw Error ( '<svg> tag not found' ) ;
496
496
}
497
497
@@ -552,31 +552,31 @@ export class MatIconRegistry implements OnDestroy {
552
552
throw getMatIconNoHttpProviderError ( ) ;
553
553
}
554
554
555
- if ( safeUrl == null && ( typeof ngDevMode === 'undefined' || ngDevMode ) ) {
555
+ if ( safeUrl == null ) {
556
556
throw Error ( `Cannot fetch icon from URL "${ safeUrl } ".` ) ;
557
557
}
558
558
559
559
const url = this . _sanitizer . sanitize ( SecurityContext . RESOURCE_URL , safeUrl ) ;
560
560
561
- if ( ! url && ( typeof ngDevMode === 'undefined' || ngDevMode ) ) {
562
- throw getMatIconFailedToSanitizeUrlError ( safeUrl ! ) ;
561
+ if ( ! url ) {
562
+ throw getMatIconFailedToSanitizeUrlError ( safeUrl ) ;
563
563
}
564
564
565
565
// Store in-progress fetches to avoid sending a duplicate request for a URL when there is
566
566
// already a request in progress for that URL. It's necessary to call share() on the
567
567
// Observable returned by http.get() so that multiple subscribers don't cause multiple XHRs.
568
- const inProgressFetch = this . _inProgressUrlFetches . get ( url ! ) ;
568
+ const inProgressFetch = this . _inProgressUrlFetches . get ( url ) ;
569
569
570
570
if ( inProgressFetch ) {
571
571
return inProgressFetch ;
572
572
}
573
573
574
- const req = this . _httpClient . get ( url ! , { responseType : 'text' , withCredentials} ) . pipe (
575
- finalize ( ( ) => this . _inProgressUrlFetches . delete ( url ! ) ) ,
574
+ const req = this . _httpClient . get ( url , { responseType : 'text' , withCredentials} ) . pipe (
575
+ finalize ( ( ) => this . _inProgressUrlFetches . delete ( url ) ) ,
576
576
share ( ) ,
577
577
) ;
578
578
579
- this . _inProgressUrlFetches . set ( url ! , req ) ;
579
+ this . _inProgressUrlFetches . set ( url , req ) ;
580
580
return req ;
581
581
}
582
582
0 commit comments