@@ -14,7 +14,7 @@ console.log(
1414 '\n' +
1515 '\n' +
1616 '<h1 align="center">\n' +
17- 'Open Template Hub - Server Generator v3\n' +
17+ 'Open Template Hub - UI Generator v3\n' +
1818 ' <br/>\n' +
1919 '(outdated packages)\n' +
2020 '</h1>\n' +
@@ -26,25 +26,36 @@ for ( const line of lines ) {
2626 if ( line . length === 0 ) {
2727 continue ;
2828 }
29-
29+
3030 if ( lines . indexOf ( line ) === 0 ) {
3131 columnIndexes [ 0 ] = line . indexOf ( 'Current' ) ;
3232 columnIndexes [ 1 ] = line . indexOf ( 'Wanted' ) + 3 ;
3333 columnIndexes [ 2 ] = line . indexOf ( 'Latest' ) + 6 ;
3434 columnIndexes [ 3 ] = line . indexOf ( 'Location' ) + 9 ;
3535 }
36-
37- let modifiedLine = line ;
38-
36+
37+ let modifiedLine = '' ;
38+
3939 if ( columnIndexes [ 0 ] >= 0 ) {
40- for ( const columnIndex of columnIndexes ) {
41- modifiedLine = modifiedLine . substring ( 0 , columnIndex ) + ' | ' + modifiedLine . substring ( columnIndex , modifiedLine . length ) ;
40+ const stringParts = line . split ( / ( \s + ) / ) ;
41+
42+ modifiedLine += '| ' ;
43+
44+ for ( let part of stringParts ) {
45+ if ( part . match ( / \s + / ) ) {
46+ modifiedLine += ' | ' ;
47+ } else {
48+ modifiedLine += part ;
49+ }
4250 }
43- console . log ( '| ' + modifiedLine + ' |' ) ;
51+
52+ modifiedLine += ' |' ;
53+
54+ console . log ( modifiedLine ) ;
4455 } else {
4556 console . log ( modifiedLine ) ;
4657 }
47-
58+
4859 if ( lines . indexOf ( line ) === 0 ) {
4960 console . log ( '| --- | --- | --- | --- | --- |' ) ;
5061 }
0 commit comments