escover 3.3.1 → 3.4.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.
package/ChangeLog CHANGED
@@ -1,3 +1,13 @@
1
+ 2023.06.08, v3.4.0
2
+
3
+ feature:
4
+ - 2a602d2 escover: expression
5
+
6
+ 2023.06.08, v3.3.2
7
+
8
+ fix:
9
+ - 2792d33 drop console.log
10
+
1
11
  2023.05.31, v3.3.1
2
12
 
3
13
  feature:
@@ -9,4 +9,3 @@ export const version = () => {
9
9
 
10
10
  return version;
11
11
  };
12
-
package/lib/config.js CHANGED
@@ -42,4 +42,3 @@ export const readConfig = () => {
42
42
  ...parse(data),
43
43
  };
44
44
  };
45
-
@@ -38,4 +38,3 @@ export const readCoverage = () => {
38
38
 
39
39
  return parseLcov(data);
40
40
  };
41
-
@@ -51,4 +51,3 @@ export const parseLcov = (lcov) => {
51
51
 
52
52
  return files;
53
53
  };
54
-
package/lib/escover.js CHANGED
@@ -12,6 +12,8 @@ import {
12
12
 
13
13
  global.__createC4 = createFileEntry;
14
14
 
15
+ const port = {};
16
+
15
17
  const CWD = process.cwd();
16
18
 
17
19
  const {exclude} = readConfig();
@@ -35,7 +37,6 @@ export function globalPreload({port}) {
35
37
  loader,
36
38
  } = data;
37
39
 
38
- console.log(loader);
39
40
  if (loader !== 'escover')
40
41
  return;
41
42
 
package/lib/exclude.js CHANGED
@@ -6,4 +6,3 @@ export const exclude = (url, names) => {
6
6
 
7
7
  return false;
8
8
  };
9
-
package/lib/exit.js CHANGED
@@ -4,4 +4,3 @@ import {writeCoverage} from './coverage-file/coverage-file.js';
4
4
  export const exit = once(() => {
5
5
  writeCoverage();
6
6
  });
7
-
@@ -25,4 +25,3 @@ export const instrument = (url, source) => {
25
25
 
26
26
  return code;
27
27
  };
28
-
@@ -4,16 +4,14 @@ const {SequenceExpression} = types;
4
4
 
5
5
  export const addMarkToArgument = (path, lineNode) => {
6
6
  const {node} = path;
7
- const {expression} = lineNode;
8
7
 
9
8
  if (!node.argument) {
10
- node.argument = expression;
9
+ node.argument = lineNode;
11
10
  return;
12
11
  }
13
12
 
14
13
  node.argument = SequenceExpression([
15
- expression,
14
+ lineNode,
16
15
  node.argument,
17
16
  ]);
18
17
  };
19
-
@@ -4,11 +4,9 @@ const {SequenceExpression} = types;
4
4
 
5
5
  export const addMarkToArrowFunction = (path, lineNode) => {
6
6
  const {node} = path;
7
- const {expression} = lineNode;
8
7
 
9
8
  node.body = SequenceExpression([
10
- expression,
9
+ lineNode,
11
10
  node.body,
12
11
  ]);
13
12
  };
14
-
@@ -78,23 +78,20 @@ export const fix = (path, {options}) => {
78
78
  if (path.isCallExpression() || path.isNewExpression()) {
79
79
  const {node} = path;
80
80
 
81
- replaceWith(path, SequenceExpression([
82
- lineNode.expression,
83
- node,
84
- ]));
81
+ replaceWith(path, SequenceExpression([lineNode, node]));
85
82
 
86
83
  return;
87
84
  }
88
85
 
89
86
  if (path.parentPath.isLogicalExpression())
90
87
  return replaceWith(path, SequenceExpression([
91
- lineNode.expression,
88
+ lineNode,
92
89
  path.node,
93
90
  ]));
94
91
 
95
92
  if (path.isAssignmentPattern() || path.isAssignmentExpression()) {
96
93
  replaceWith(path.get('right'), SequenceExpression([
97
- lineNode.expression,
94
+ lineNode,
98
95
  node.right,
99
96
  ]));
100
97
  return;
@@ -116,10 +113,7 @@ export const fix = (path, {options}) => {
116
113
  if (path.isExpression()) {
117
114
  const {node} = path;
118
115
 
119
- replaceWith(path, SequenceExpression([
120
- lineNode.expression,
121
- node,
122
- ]));
116
+ replaceWith(path, SequenceExpression([lineNode, node]));
123
117
 
124
118
  return;
125
119
  }
@@ -237,4 +231,3 @@ export const traverse = ({push}) => ({
237
231
  }
238
232
  },
239
233
  });
240
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "escover",
3
- "version": "3.3.1",
3
+ "version": "3.4.0",
4
4
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
5
  "description": "Coverage for EcmaScript Modules",
6
6
  "main": "lib/escover.js",