@pi-r/html-validate 0.11.2 → 0.12.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 +5 -3
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
- const Document = require("@e-mc/document");
3
- const removeQuotes = (value) => value.startsWith('"') && value.endsWith('"') ? value.substring(1, value.length - 1) : value;
2
+
3
+ const Document = require('@e-mc/document');
4
+ const removeQuotes = (value) => value.at(0) === '"' && value.at(-1) === '"' ? value.slice(1, -1) : value;
4
5
  async function transform(context, value, options) {
5
6
  context = options.upgrade(context, __dirname);
6
7
  const { pathname, filename } = options;
7
8
  const baseConfig = options.toBaseConfig();
8
- baseConfig.root = true;
9
9
  const timeStamp = Date.now();
10
+ baseConfig.root = true;
10
11
  const report = await new context.HtmlValidate(baseConfig).validateString(value);
11
12
  if (!report.valid) {
12
13
  options.out[Document.hasLogType(32768) ? 'logQueued' : 'logAppend'] = Document.generateLintTable(report.results[0].messages.map(item => ({
@@ -22,4 +23,5 @@ async function transform(context, value, options) {
22
23
  }
23
24
  return value;
24
25
  }
26
+
25
27
  module.exports = transform;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/html-validate",
3
- "version": "0.11.2",
3
+ "version": "0.12.0",
4
4
  "description": "html-validate transform function for E-mc.",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
@@ -19,7 +19,7 @@
19
19
  "license": "MIT",
20
20
  "homepage": "https://github.com/anpham6/pi-r#readme",
21
21
  "dependencies": {
22
- "@e-mc/document": "^0.13.9",
23
- "html-validate": "^10.11.2"
22
+ "@e-mc/document": "^0.14.0",
23
+ "html-validate": "^10.13.1"
24
24
  }
25
25
  }