escover 1.7.2 → 1.8.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,12 @@
1
+ 2022.01.19, v1.8.0
2
+
3
+ fix:
4
+ - chore: instrument: rm useless fixture
5
+
6
+ feature:
7
+ - escover: when one of expressions lin line not covered - line not covered
8
+
9
+
1
10
  2022.01.18, v1.7.2
2
11
 
3
12
  feature:
package/README.md CHANGED
@@ -47,7 +47,7 @@ escover npm test
47
47
 
48
48
  ## Config
49
49
 
50
- `exclude` section of configuration file `.nyrc.json` supported.
50
+ `exclude` section of configuration file `.nyrc.json` supported.
51
51
 
52
52
  ## How it looks like?
53
53
 
package/lib/transform.js CHANGED
@@ -1,17 +1,13 @@
1
1
  const sort = (a) => new Map(Array.from(a.entries()).sort());
2
2
 
3
+ const isBool = (a) => typeof a === 'boolean';
4
+
3
5
  export const transform = (files) => {
4
6
  const result = [];
5
7
  const sorted = sort(files);
6
8
 
7
9
  for (const [rawName, places] of sorted.entries()) {
8
- const rawLines = {};
9
-
10
- for (const [place, covered] of places.entries()) {
11
- const [line] = place.split(':');
12
-
13
- rawLines[line] = covered;
14
- }
10
+ const rawLines = mergeLines(places);
15
11
 
16
12
  result.push({
17
13
  rawName,
@@ -22,3 +18,20 @@ export const transform = (files) => {
22
18
  return result;
23
19
  };
24
20
 
21
+ function mergeLines(places) {
22
+ const result = {};
23
+
24
+ for (const [place, covered] of places.entries()) {
25
+ const [line] = place.split(':');
26
+
27
+ if (isBool(result[line])) {
28
+ result[line] &= covered;
29
+ continue;
30
+ }
31
+
32
+ result[line] = covered;
33
+ }
34
+
35
+ return result;
36
+ }
37
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "escover",
3
- "version": "1.7.2",
3
+ "version": "1.8.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",