w3c-html-validator 1.6.3 → 1.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- //! w3c-html-validator v1.6.3 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License
1
+ //! w3c-html-validator v1.6.4 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License
2
2
 
3
3
  export type ValidatorSettings = {
4
4
  html: string;
@@ -1,4 +1,4 @@
1
- //! w3c-html-validator v1.6.3 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License
1
+ //! w3c-html-validator v1.6.4 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License
2
2
 
3
3
  import chalk from 'chalk';
4
4
  import fs from 'fs';
@@ -6,7 +6,7 @@ import log from 'fancy-log';
6
6
  import request from 'superagent';
7
7
  import slash from 'slash';
8
8
  const w3cHtmlValidator = {
9
- version: '1.6.3',
9
+ version: '1.6.4',
10
10
  validate(options) {
11
11
  const defaults = {
12
12
  checkUrl: 'https://validator.w3.org/nu/',
@@ -65,8 +65,9 @@ const w3cHtmlValidator = {
65
65
  const response = reason.response;
66
66
  const getMsg = () => [response.status, response.res.statusMessage, response.request.url];
67
67
  const message = response ? getMsg() : [reason.errno, reason.message];
68
- response.body = { messages: [{ type: 'network-error', message: message.join(' ') }] };
69
- return toValidatorResults(response);
68
+ const errRes = response ?? {};
69
+ errRes.body = { messages: [{ type: 'network-error', message: message.join(' ') }] };
70
+ return toValidatorResults(errRes);
70
71
  };
71
72
  return w3cRequest.then(filterMessages).then(toValidatorResults).catch(handleError);
72
73
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "w3c-html-validator",
3
- "version": "1.6.3",
3
+ "version": "1.6.4",
4
4
  "description": "Check the markup validity of HTML files using the W3C validator",
5
5
  "license": "MIT",
6
6
  "type": "module",