monocart-coverage-reports 2.12.10 → 2.12.11

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/lib/utils/util.js CHANGED
@@ -76,23 +76,24 @@ const Util = {
76
76
  },
77
77
 
78
78
  strToObj: (str) => {
79
- if (typeof str === 'string') {
80
- str = str.trim();
81
- if (str.startsWith('{') && str.endsWith('}')) {
82
- let fun;
83
- let err;
84
- try {
85
- fun = new Function(`return ${str}`);
86
- } catch (e) {
87
- err = e;
88
- }
89
- if (!err) {
90
- const obj = fun();
91
- if (obj && typeof obj === 'object') {
92
- return obj;
93
- }
94
- }
79
+ if (typeof str !== 'string') {
80
+ return;
81
+ }
82
+ str = str.trim();
83
+ if (!(str.startsWith('{') && str.endsWith('}'))) {
84
+ return;
85
+ }
86
+ // Accept JSON-like objects using single or double quotes, e.g.
87
+ // {'**/node_modules/**':false,'**/src/*.js':true}
88
+ // Normalize single quotes to double quotes, then JSON.parse (safe, no code execution).
89
+ const normalized = str.replace(/'/g, '"');
90
+ try {
91
+ const obj = JSON.parse(normalized);
92
+ if (obj && typeof obj === 'object') {
93
+ return obj;
95
94
  }
95
+ } catch (e) {
96
+ // not a parseable object literal
96
97
  }
97
98
  },
98
99
 
@@ -744,7 +745,6 @@ const Util = {
744
745
  // skip \s and comments
745
746
  fixSourceRange: (locator, start, end) => {
746
747
 
747
- let fixedStart = start;
748
748
  let fixedEnd = end;
749
749
 
750
750
  const rangeText = locator.getSlice(start, end);
@@ -814,7 +814,7 @@ const Util = {
814
814
  startOffset += 1;
815
815
  }
816
816
 
817
- fixedStart = start + startOffset;
817
+ const fixedStart = start + startOffset;
818
818
 
819
819
  return {
820
820
  fixedStart,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monocart-coverage-reports",
3
- "version": "2.12.10",
3
+ "version": "2.12.11",
4
4
  "description": "A code coverage tool to generate native V8 reports or Istanbul reports.",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {
@@ -51,6 +51,7 @@
51
51
  "test-merge-v8": "node ./test/test-merge-v8.js",
52
52
  "test-merge-cli": "npx mcr merge -r console-details,v8 --inputDir .temp/code-coverage/raw --outputDir .temp/merge-cli",
53
53
  "test-client": "node ./test/test-client.js",
54
+ "test-cp": "npx mcr node test/test-cp.mjs --outputDir .temp/test-cp",
54
55
  "test-all": "node ./test/test.js",
55
56
  "test-pr": "node --inspect=9230 ./test/test-pr.js",
56
57
  "test": "npm run test-unit && npx mcr npm run test-all -c test/mcr.config.mcr.js && node ./scripts/docs.js",
@@ -91,7 +92,7 @@
91
92
  "@jsdevtools/coverage-istanbul-loader": "^3.0.5",
92
93
  "@rollup/plugin-commonjs": "^29.0.2",
93
94
  "@rollup/plugin-typescript": "^12.3.0",
94
- "@swc/core": "^1.15.26",
95
+ "@swc/core": "^1.15.30",
95
96
  "@types/node": "^25.6.0",
96
97
  "async-tick": "^1.0.2",
97
98
  "babel-loader": "^10.1.1",
@@ -100,7 +101,7 @@
100
101
  "cross-env": "^10.1.0",
101
102
  "diff-sequences": "^29.6.3",
102
103
  "esbuild": "^0.28.0",
103
- "eslint": "~10.2.0",
104
+ "eslint": "~10.2.1",
104
105
  "eslint-config-plus": "^2.0.4",
105
106
  "eslint-plugin-html": "^8.1.4",
106
107
  "eslint-plugin-vue": "^10.8.0",
@@ -115,9 +116,9 @@
115
116
  "node-stream-zip": "^1.15.0",
116
117
  "open": "^11.0.0",
117
118
  "playwright": "^1.59.1",
118
- "postcss": "^8.5.9",
119
- "puppeteer": "^24.40.0",
120
- "rollup": "^4.60.1",
119
+ "postcss": "^8.5.10",
120
+ "puppeteer": "^24.41.0",
121
+ "rollup": "^4.60.2",
121
122
  "starfall-cli": "^2.0.24",
122
123
  "stylelint": "^17.8.0",
123
124
  "stylelint-config-plus": "^1.1.6",
@@ -126,7 +127,7 @@
126
127
  "ts-loader": "^9.5.7",
127
128
  "tsx": "^4.21.0",
128
129
  "turbogrid": "^3.2.4",
129
- "typescript": "^6.0.2",
130
+ "typescript": "^6.0.3",
130
131
  "vine-ui": "^3.1.18",
131
132
  "webpack": "^5.106.2",
132
133
  "ws": "^8.20.0",