@canyonjs/cli 1.0.18 → 1.0.19

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.
package/README.md CHANGED
@@ -1 +0,0 @@
1
- 合并本地覆盖率
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import node_fs from "node:fs";
5
5
  import node_path from "node:path";
6
6
  import axios from "axios";
7
7
  var package_namespaceObject = {
8
- rE: "1.0.18"
8
+ rE: "1.0.19"
9
9
  };
10
10
  function mergeNumberMaps(a = {}, b = {}) {
11
11
  const result = {
@@ -66,10 +66,12 @@ async function mapCommand(params, options) {
66
66
  const files = node_fs.readdirSync(node_path.resolve(process.cwd(), '.canyon_output'));
67
67
  let data = {};
68
68
  for(let i = 0; i < files.length; i++){
69
- const fileCoverageString = node_fs.readFileSync(node_path.resolve(process.cwd(), '.canyon_output', files[i]), 'utf-8');
69
+ const fileName = files[i];
70
+ const isCoverageFinalFile = /^coverage-final-.*\.json$/.test(fileName);
71
+ const fileCoverageString = node_fs.readFileSync(node_path.resolve(process.cwd(), '.canyon_output', fileName), 'utf-8');
70
72
  const fileCoverage = JSON.parse(fileCoverageString);
71
73
  let toMerge = fileCoverage;
72
- if (filter && 'string' == typeof filter) {
74
+ if (filter && 'string' == typeof filter && isCoverageFinalFile) {
73
75
  const filteredEntries = Object.entries(fileCoverage).filter(([filePath])=>filePath.includes(filter));
74
76
  if (0 === filteredEntries.length) continue;
75
77
  toMerge = Object.fromEntries(filteredEntries);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canyonjs/cli",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {