lighthouse-reporting 1.6.5 → 1.6.6

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.
@@ -58,9 +58,10 @@
58
58
  }
59
59
  throw error;
60
60
  };
61
- const getScores = (result) => Object.entries(result.lhr.categories).filter((c) => typeof c[1].score === "number").reduce(
61
+ const getScores = (result) => Object.entries(result.lhr.categories).reduce(
62
62
  (prev, [key, c]) => {
63
- prev[key] = Math.floor(c.score * 100);
63
+ const score = typeof c.score === "number" ? c.score : 0;
64
+ prev[key] = Math.floor(score * 100);
64
65
  return prev;
65
66
  },
66
67
  {}
@@ -38,9 +38,10 @@ const writeHtmlListEntryWithRetry = async (htmlFilePath, name, scores, threshold
38
38
  }
39
39
  throw error;
40
40
  };
41
- const getScores = (result) => Object.entries(result.lhr.categories).filter((c) => typeof c[1].score === "number").reduce(
41
+ const getScores = (result) => Object.entries(result.lhr.categories).reduce(
42
42
  (prev, [key, c]) => {
43
- prev[key] = Math.floor(c.score * 100);
43
+ const score = typeof c.score === "number" ? c.score : 0;
44
+ prev[key] = Math.floor(score * 100);
44
45
  return prev;
45
46
  },
46
47
  {}
@@ -36,9 +36,10 @@ const writeHtmlListEntryWithRetry = async (htmlFilePath, name, scores, threshold
36
36
  }
37
37
  throw error;
38
38
  };
39
- const getScores = (result) => Object.entries(result.lhr.categories).filter((c) => typeof c[1].score === "number").reduce(
39
+ const getScores = (result) => Object.entries(result.lhr.categories).reduce(
40
40
  (prev, [key, c]) => {
41
- prev[key] = Math.floor(c.score * 100);
41
+ const score = typeof c.score === "number" ? c.score : 0;
42
+ prev[key] = Math.floor(score * 100);
42
43
  return prev;
43
44
  },
44
45
  {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lighthouse-reporting",
3
- "version": "1.6.5",
3
+ "version": "1.6.6",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "vite build && vite build -c vite.umd.config.ts && tsc -p ./tsconfig.build.json",
@@ -30,20 +30,20 @@
30
30
  "devDependencies": {
31
31
  "@playwright/test": "^1.34.3",
32
32
  "@types/fs-extra": "^11.0.4",
33
- "@types/node": "^20.11.6",
34
- "@typescript-eslint/eslint-plugin": "^6.19.1",
35
- "@typescript-eslint/parser": "^6.19.1",
33
+ "@types/node": "^20.11.16",
34
+ "@typescript-eslint/eslint-plugin": "^6.20.0",
35
+ "@typescript-eslint/parser": "^6.20.0",
36
36
  "eslint": "^8.56.0",
37
37
  "eslint-config-prettier": "^9.1.0",
38
38
  "eslint-plugin-prettier": "^5.1.3",
39
39
  "get-port": "^7.0.0",
40
- "husky": "^8.0.3",
40
+ "husky": "^9.0.10",
41
41
  "npm-run-all": "^4.1.5",
42
42
  "prettier": "^3.2.4",
43
43
  "semantic-release": "^23.0.0",
44
44
  "typescript": "^5.3.3",
45
45
  "vite": "^5.0.12",
46
- "vite-plugin-static-copy": "^1.0.0"
46
+ "vite-plugin-static-copy": "^1.0.1"
47
47
  },
48
48
  "dependencies": {
49
49
  "fs-extra": "^11.2.0"