diff --git a/dist/w3c-html-validator.d.ts b/dist/w3c-html-validator.d.ts index ed096fc..104b95f 100644 --- a/dist/w3c-html-validator.d.ts +++ b/dist/w3c-html-validator.d.ts @@ -1,14 +1,15 @@ -//! w3c-html-validator v1.1.3 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License +//! w3c-html-validator v1.2.0 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License -export declare type ValidatorOptions = { - html?: string; - filename?: string; - website?: string; - checkUrl?: string; - ignoreLevel?: 'info' | 'warning'; - ignoreMessages?: string | RegExp; - output?: ValidatorResultsOutput; +export declare type ValidatorSettings = { + html: string; + filename: string; + website: string; + checkUrl: string; + ignoreLevel: 'info' | 'warning'; + ignoreMessages: string | RegExp; + output: ValidatorResultsOutput; }; +export declare type ValidatorOptions = Partial; export declare type ValidatorResultsMessage = { type: 'info' | 'error' | 'non-document-error' | 'network-error'; subType?: 'warning' | 'fatal' | 'io' | 'schema' | 'internal'; @@ -35,11 +36,12 @@ export declare type ValidatorResults = { display: string | null; }; export declare type ValidatorResultsOutput = ValidatorResults['output']; -export declare type ReporterOptions = { - maxMessageLen?: number | null; - quiet?: boolean; - title?: string | null; +export declare type ReporterSettings = { + maxMessageLen: number | null; + quiet: boolean; + title: string | null; }; +export declare type ReporterOptions = Partial; declare const w3cHtmlValidator: { version: string; validate(options: ValidatorOptions): Promise; diff --git a/dist/w3c-html-validator.js b/dist/w3c-html-validator.js index a1d2950..72e91b5 100644 --- a/dist/w3c-html-validator.js +++ b/dist/w3c-html-validator.js @@ -1,11 +1,11 @@ -//! w3c-html-validator v1.1.3 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License +//! w3c-html-validator v1.2.0 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License -import { readFileSync } from 'fs'; import chalk from 'chalk'; +import fs from 'fs'; import log from 'fancy-log'; import request from 'superagent'; const w3cHtmlValidator = { - version: '1.1.3', + version: '1.2.0', validate(options) { var _a; const defaults = { @@ -22,7 +22,7 @@ const w3cHtmlValidator = { if (settings.output !== 'json' && settings.output !== 'html') throw Error('[w3c-html-validator] Option "output" must be "json" or "html".'); const mode = settings.html ? 'html' : settings.filename ? 'filename' : 'website'; - const readFile = (filename) => readFileSync(filename, 'utf8').replace(/\r/g, ''); + const readFile = (filename) => fs.readFileSync(filename, 'utf-8').replace(/\r/g, ''); const inputHtml = (_a = settings.html) !== null && _a !== void 0 ? _a : (settings.filename ? readFile(settings.filename) : null); const makePostRequest = () => request.post(settings.checkUrl) .set('Content-Type', 'text/html; encoding=utf-8') diff --git a/dist/w3c-html-validator.umd.cjs b/dist/w3c-html-validator.umd.cjs index 9620c18..018b23c 100644 --- a/dist/w3c-html-validator.umd.cjs +++ b/dist/w3c-html-validator.umd.cjs @@ -1,4 +1,4 @@ -//! w3c-html-validator v1.1.3 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License +//! w3c-html-validator v1.2.0 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; @@ -9,18 +9,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) { if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { - define(["require", "exports", "fs", "chalk", "fancy-log", "superagent"], factory); + define(["require", "exports", "chalk", "fs", "fancy-log", "superagent"], factory); } })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.w3cHtmlValidator = void 0; - const fs_1 = require("fs"); const chalk_1 = __importDefault(require("chalk")); + const fs_1 = __importDefault(require("fs")); const fancy_log_1 = __importDefault(require("fancy-log")); const superagent_1 = __importDefault(require("superagent")); const w3cHtmlValidator = { - version: '1.1.3', + version: '1.2.0', validate(options) { var _a; const defaults = { @@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { if (settings.output !== 'json' && settings.output !== 'html') throw Error('[w3c-html-validator] Option "output" must be "json" or "html".'); const mode = settings.html ? 'html' : settings.filename ? 'filename' : 'website'; - const readFile = (filename) => (0, fs_1.readFileSync)(filename, 'utf8').replace(/\r/g, ''); + const readFile = (filename) => fs_1.default.readFileSync(filename, 'utf-8').replace(/\r/g, ''); const inputHtml = (_a = settings.html) !== null && _a !== void 0 ? _a : (settings.filename ? readFile(settings.filename) : null); const makePostRequest = () => superagent_1.default.post(settings.checkUrl) .set('Content-Type', 'text/html; encoding=utf-8') diff --git a/package.json b/package.json index 3555043..03c6568 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "w3c-html-validator", - "version": "1.1.3", + "version": "1.2.0", "description": "Check the markup validity of HTML files using the W3C validator", "license": "MIT", "type": "module",