w3c-html-validator 1.0.4 → 1.1.0
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,11 +1,11 @@
|
|
|
1
|
-
//! w3c-html-validator v1.0
|
|
1
|
+
//! w3c-html-validator v1.1.0 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License
|
|
2
2
|
|
|
3
3
|
import { readFileSync } from 'fs';
|
|
4
4
|
import chalk from 'chalk';
|
|
5
5
|
import log from 'fancy-log';
|
|
6
6
|
import request from 'superagent';
|
|
7
7
|
const w3cHtmlValidator = {
|
|
8
|
-
version: '1.0
|
|
8
|
+
version: '1.1.0',
|
|
9
9
|
validate(options) {
|
|
10
10
|
const defaults = {
|
|
11
11
|
checkUrl: 'https://validator.w3.org/nu/',
|
|
@@ -88,9 +88,9 @@ const w3cHtmlValidator = {
|
|
|
88
88
|
throw Error('[w3c-html-validator] Invalid results for reporter(): ' + String(results));
|
|
89
89
|
const messages = (_a = results.messages) !== null && _a !== void 0 ? _a : [];
|
|
90
90
|
const title = (_b = settings.title) !== null && _b !== void 0 ? _b : results.title;
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
log(chalk.gray('w3c-html-validator'), chalk.blue.bold(title),
|
|
91
|
+
const status = results.validates ? chalk.green.bold('✔ pass') : chalk.red.bold('✘ fail');
|
|
92
|
+
const count = results.validates ? '' : '(messages: ' + messages.length + ')';
|
|
93
|
+
log(chalk.gray('w3c-html-validator'), status, chalk.blue.bold(title), chalk.white(count));
|
|
94
94
|
const typeColorMap = {
|
|
95
95
|
error: chalk.red.bold,
|
|
96
96
|
warning: chalk.yellow.bold,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//! w3c-html-validator v1.0
|
|
1
|
+
//! w3c-html-validator v1.1.0 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License
|
|
2
2
|
|
|
3
3
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -20,7 +20,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
20
20
|
const fancy_log_1 = __importDefault(require("fancy-log"));
|
|
21
21
|
const superagent_1 = __importDefault(require("superagent"));
|
|
22
22
|
const w3cHtmlValidator = {
|
|
23
|
-
version: '1.0
|
|
23
|
+
version: '1.1.0',
|
|
24
24
|
validate(options) {
|
|
25
25
|
const defaults = {
|
|
26
26
|
checkUrl: 'https://validator.w3.org/nu/',
|
|
@@ -103,9 +103,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
103
103
|
throw Error('[w3c-html-validator] Invalid results for reporter(): ' + String(results));
|
|
104
104
|
const messages = (_a = results.messages) !== null && _a !== void 0 ? _a : [];
|
|
105
105
|
const title = (_b = settings.title) !== null && _b !== void 0 ? _b : results.title;
|
|
106
|
-
const
|
|
107
|
-
const
|
|
108
|
-
(0, fancy_log_1.default)(chalk_1.default.gray('w3c-html-validator'), chalk_1.default.blue.bold(title),
|
|
106
|
+
const status = results.validates ? chalk_1.default.green.bold('✔ pass') : chalk_1.default.red.bold('✘ fail');
|
|
107
|
+
const count = results.validates ? '' : '(messages: ' + messages.length + ')';
|
|
108
|
+
(0, fancy_log_1.default)(chalk_1.default.gray('w3c-html-validator'), status, chalk_1.default.blue.bold(title), chalk_1.default.white(count));
|
|
109
109
|
const typeColorMap = {
|
|
110
110
|
error: chalk_1.default.red.bold,
|
|
111
111
|
warning: chalk_1.default.yellow.bold,
|
package/package.json
CHANGED