@pi-r/html-validate 0.2.2 → 0.4.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.
Files changed (2) hide show
  1. package/index.js +2 -2
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const Document = require("@e-mc/document");
4
4
  const removeQuotes = (value) => value[0] === '"' && value[value.length - 1] === '"' ? value.substring(1, value.length - 1) : value;
5
- function transform(context, value, options) {
5
+ async function transform(context, value, options) {
6
6
  context = options.upgrade(context, __dirname);
7
7
  const { pathname, filename } = options;
8
8
  const baseConfig = options.toBaseConfig();
9
9
  baseConfig.root = true;
10
10
  const timeStamp = Date.now();
11
- const report = new context.HtmlValidate(baseConfig).validateString(value);
11
+ const report = await new context.HtmlValidate(baseConfig).validateString(value);
12
12
  if (!report.valid) {
13
13
  options.out[Document.hasLogType(options.logType.STDOUT) ? 'logQueued' : 'logAppend'] = Document.generateLintTable(report.results[0].messages.map(item => ({
14
14
  ruleId: item.ruleId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/html-validate",
3
- "version": "0.2.2",
3
+ "version": "0.4.0",
4
4
  "description": "html-validate transform function for E-mc.",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
@@ -20,7 +20,7 @@
20
20
  "license": "MIT",
21
21
  "homepage": "https://github.com/anpham6/pi-r#readme",
22
22
  "dependencies": {
23
- "@e-mc/document": "^0.5.3",
24
- "html-validate": "^7.17.0"
23
+ "@e-mc/document": "^0.6.0",
24
+ "html-validate": "^8.1.0"
25
25
  }
26
26
  }