Skip to content

Commit

Permalink
update dependency checker
Browse files Browse the repository at this point in the history
  • Loading branch information
furknyavuz committed Dec 13, 2021
1 parent fd6c636 commit e6218dd
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions dependency-checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,36 @@ for ( const line of lines ) {
if ( line.length === 0 ) {
continue;
}

if ( lines.indexOf( line ) === 0 ) {
columnIndexes[ 0 ] = line.indexOf( 'Current' );
columnIndexes[ 1 ] = line.indexOf( 'Wanted' ) + 3;
columnIndexes[ 2 ] = line.indexOf( 'Latest' ) + 6;
columnIndexes[ 3 ] = line.indexOf( 'Location' ) + 9;
}

let modifiedLine = line;

let modifiedLine = '';
if ( columnIndexes [ 0 ] >= 0 ) {
for ( const columnIndex of columnIndexes ) {
modifiedLine = modifiedLine.substring( 0, columnIndex ) + ' | ' + modifiedLine.substring( columnIndex, modifiedLine.length );
const stringParts = line.split( /(\s+)/ );

modifiedLine += '| ';

for ( let part of stringParts ) {
if ( part.match( /\s+/ ) ) {
modifiedLine += ' | ';
} else {
modifiedLine += part;
}
}
console.log( '| ' + modifiedLine + ' |' );

modifiedLine += ' |';

console.log( modifiedLine );
} else {
console.log( modifiedLine );
}

if ( lines.indexOf( line ) === 0 ) {
console.log( '| --- | --- | --- | --- | --- |' );
}
Expand Down

0 comments on commit e6218dd

Please sign in to comment.