From 7b0e9459e7361956237e02baff92568d83b7f1ed Mon Sep 17 00:00:00 2001 From: James Nylen Date: Fri, 20 Jul 2018 13:30:21 -0500 Subject: [PATCH] Add a couple more validation checks (#456) --- lib/index.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/index.js b/lib/index.js index ceaf04cf..a062e65e 100755 --- a/lib/index.js +++ b/lib/index.js @@ -139,6 +139,23 @@ exports.parseFromDirectory = contentPath => { ); } + if ( + $td.eq( 1 ).children().length !== 1 || + ! $td.eq( 1 ).children().eq( 0 ).is( 'a' ) + ) { + readmeError( + 'Invalid content in Website column: %s', + $( tr ).html().replace( /\n/g, '' ) + ); + } + + if ( $td.eq( 2 ).children().length > 0 ) { + readmeError( + 'Extra content in Region column: %s', + $( tr ).html().replace( /\n/g, '' ) + ); + } + if ( lastCompanyName && readmeEntry.name.toLowerCase() < lastCompanyName.toLowerCase()