Skip to content

Commit

Permalink
Release v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilafian committed Oct 14, 2022
1 parent 3c549bf commit 90d191f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
28 changes: 15 additions & 13 deletions dist/w3c-html-validator.d.ts
Original file line number Diff line number Diff line change
@@ -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<ValidatorSettings>;
export declare type ValidatorResultsMessage = {
type: 'info' | 'error' | 'non-document-error' | 'network-error';
subType?: 'warning' | 'fatal' | 'io' | 'schema' | 'internal';
Expand All @@ -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<ReporterSettings>;
declare const w3cHtmlValidator: {
version: string;
validate(options: ValidatorOptions): Promise<ValidatorResults>;
Expand Down
8 changes: 4 additions & 4 deletions dist/w3c-html-validator.js
Original file line number Diff line number Diff line change
@@ -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 = {
Expand All @@ -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')
Expand Down
10 changes: 5 additions & 5 deletions dist/w3c-html-validator.umd.cjs
Original file line number Diff line number Diff line change
@@ -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 };
Expand All @@ -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 = {
Expand All @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 90d191f

Please sign in to comment.