File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,17 +6,17 @@ const filterData = require('./lib/filter-data')
66module . exports = function ( options , callback ) {
77 return new Promise ( function ( resolve , reject ) {
88 if ( ! options ) {
9- let error = new Error ( 'Missing required input: options object' )
9+ const error = new Error ( 'Missing required input: options object' )
1010 return callback ? callback ( error , null ) : reject ( error )
1111 }
1212
1313 if ( ! options . url && ! options . data ) {
14- let error = new Error ( 'Missing required params: url or data' )
14+ const error = new Error ( 'Missing required params: url or data' )
1515 return callback ? callback ( error , null ) : reject ( error )
1616 }
1717
1818 if ( options . url && ! validUrl . isWebUri ( options . url ) ) {
19- let error = new Error ( 'Invalid url' )
19+ const error = new Error ( 'Invalid url' )
2020 return callback ? callback ( error , null ) : reject ( error )
2121 }
2222
@@ -29,7 +29,7 @@ module.exports = function (options, callback) {
2929 }
3030
3131 if ( response && response . statusCode !== 200 ) {
32- let error = new Error ( 'Validator returned unexpected statuscode: ' + response . statusCode )
32+ const error = new Error ( 'Validator returned unexpected statuscode: ' + response . statusCode )
3333 return callback ? callback ( error , null ) : reject ( error )
3434 }
3535
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module.exports = function (options) {
33 const userAgent = `${ pkg . name } v ${ pkg . version } `
44 const ignore = options . ignore
55 const format = ignore ? 'text' : options . format || 'json'
6- let newOpts = {
6+ const newOpts = {
77 uri : 'https://validator.w3.org/nu/' ,
88 headers : Object . assign ( {
99 'User-Agent' : userAgent
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ module.exports = function (data, ignore) {
22 const list = data . split ( '\n' )
33 const filters = Array . isArray ( ignore ) ? ignore : [ ignore ]
44 let errors = false
5- let results = [ ]
5+ const results = [ ]
66 list . forEach ( function ( line , index ) {
77 if ( line . startsWith ( 'Error' ) && filters . indexOf ( line ) === - 1 ) {
88 results . push ( line )
You can’t perform that action at this time.
0 commit comments