File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,19 +85,16 @@ export function stringify(token: any): string {
8585 }
8686
8787 if ( Array . isArray ( token ) ) {
88- return '[' + token . map ( stringify ) . join ( ', ' ) + ']' ;
88+ return `[ ${ token . map ( stringify ) . join ( ', ' ) } ]` ;
8989 }
9090
9191 if ( token == null ) {
9292 return '' + token ;
9393 }
9494
95- if ( token . overriddenName ) {
96- return `${ token . overriddenName } ` ;
97- }
98-
99- if ( token . name ) {
100- return `${ token . name } ` ;
95+ const name = token . overriddenName || token . name ;
96+ if ( name ) {
97+ return `${ name } ` ;
10198 }
10299
103100 if ( ! token . toString ) {
@@ -106,14 +103,14 @@ export function stringify(token: any): string {
106103
107104 // WARNING: do not try to `JSON.stringify(token)` here
108105 // see https://github.com/angular/angular/issues/23440
109- const res = token . toString ( ) ;
106+ const result = token . toString ( ) ;
110107
111- if ( res == null ) {
112- return '' + res ;
108+ if ( result == null ) {
109+ return '' + result ;
113110 }
114111
115- const newLineIndex = res . indexOf ( '\n' ) ;
116- return newLineIndex === - 1 ? res : res . substring ( 0 , newLineIndex ) ;
112+ const newLineIndex = result . indexOf ( '\n' ) ;
113+ return newLineIndex >= 0 ? result . slice ( 0 , newLineIndex ) : result ;
117114}
118115
119116export class Version {
You can’t perform that action at this time.
0 commit comments