html-validator
Advanced tools
Comparing version 3.1.1 to 3.1.2
@@ -9,3 +9,3 @@ const request = require('request') | ||
if (!options) { | ||
let error = new Error('Missing required input: options object') | ||
const error = new Error('Missing required input: options object') | ||
return callback ? callback(error, null) : reject(error) | ||
@@ -15,3 +15,3 @@ } | ||
if (!options.url && !options.data) { | ||
let error = new Error('Missing required params: url or data') | ||
const error = new Error('Missing required params: url or data') | ||
return callback ? callback(error, null) : reject(error) | ||
@@ -21,3 +21,3 @@ } | ||
if (options.url && !validUrl.isWebUri(options.url)) { | ||
let error = new Error('Invalid url') | ||
const error = new Error('Invalid url') | ||
return callback ? callback(error, null) : reject(error) | ||
@@ -35,3 +35,3 @@ } | ||
if (response && response.statusCode !== 200) { | ||
let error = new Error('Validator returned unexpected statuscode: ' + response.statusCode) | ||
const error = new Error('Validator returned unexpected statuscode: ' + response.statusCode) | ||
return callback ? callback(error, null) : reject(error) | ||
@@ -38,0 +38,0 @@ } |
@@ -6,3 +6,3 @@ module.exports = function (options) { | ||
const format = ignore ? 'text' : options.format || 'json' | ||
let newOpts = { | ||
const newOpts = { | ||
uri: 'https://validator.w3.org/nu/', | ||
@@ -9,0 +9,0 @@ headers: Object.assign({ |
@@ -5,3 +5,3 @@ module.exports = function (data, ignore) { | ||
let errors = false | ||
let results = [] | ||
const results = [] | ||
list.forEach(function (line, index) { | ||
@@ -8,0 +8,0 @@ if (line.startsWith('Error') && filters.indexOf(line) === -1) { |
{ | ||
"name": "html-validator", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "Validate html using validator.w3.org/nu", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
24009