lighthouse-reporting 1.6.2 → 1.6.3

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.
@@ -72,12 +72,12 @@
72
72
  },
73
73
  {}
74
74
  );
75
- const accessibilityViolations = result.artifacts.Accessibility.violations.map((v) => {
75
+ const accessibilityViolations = result.artifacts.Accessibility ? result.artifacts.Accessibility.violations.map((v) => {
76
76
  return {
77
77
  title: result.lhr.audits[v.id].title,
78
78
  nodes: v.nodes.length
79
79
  };
80
- });
80
+ }) : [];
81
81
  if (accessibilityViolations.length > 0) {
82
82
  json.accessibility.issues = accessibilityViolations;
83
83
  }
@@ -53,12 +53,12 @@ const writeScoresToJson = async (lhScoresDir, name, scores, result) => {
53
53
  },
54
54
  {}
55
55
  );
56
- const accessibilityViolations = result.artifacts.Accessibility.violations.map((v) => {
56
+ const accessibilityViolations = result.artifacts.Accessibility ? result.artifacts.Accessibility.violations.map((v) => {
57
57
  return {
58
58
  title: result.lhr.audits[v.id].title,
59
59
  nodes: v.nodes.length
60
60
  };
61
- });
61
+ }) : [];
62
62
  if (accessibilityViolations.length > 0) {
63
63
  json.accessibility.issues = accessibilityViolations;
64
64
  }
@@ -38,7 +38,7 @@ export interface LighthouseResult {
38
38
  };
39
39
  };
40
40
  artifacts: {
41
- Accessibility: {
41
+ Accessibility?: {
42
42
  violations: Array<AxeRuleResult>;
43
43
  };
44
44
  };
@@ -51,12 +51,12 @@ const writeScoresToJson = async (lhScoresDir, name, scores, result) => {
51
51
  },
52
52
  {}
53
53
  );
54
- const accessibilityViolations = result.artifacts.Accessibility.violations.map((v) => {
54
+ const accessibilityViolations = result.artifacts.Accessibility ? result.artifacts.Accessibility.violations.map((v) => {
55
55
  return {
56
56
  title: result.lhr.audits[v.id].title,
57
57
  nodes: v.nodes.length
58
58
  };
59
- });
59
+ }) : [];
60
60
  if (accessibilityViolations.length > 0) {
61
61
  json.accessibility.issues = accessibilityViolations;
62
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lighthouse-reporting",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "vite build && vite build -c vite.umd.config.ts && tsc -p ./tsconfig.build.json",