escover 3.1.1 → 3.1.2

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,8 @@
1
+ 2023.05.05, v3.1.2
2
+
3
+ feature:
4
+ - 520372c escover: improve support of OptionalChaining
5
+
1
6
  2023.05.05, v3.1.1
2
7
 
3
8
  fix:
@@ -40,7 +40,23 @@ export const report = () => 'Mark line';
40
40
 
41
41
  const isLoc = (path) => path.node.loc;
42
42
 
43
- const findLoc = (path) => path.find(isLoc).node.loc;
43
+ const findLoc = (path) => {
44
+ const current = path.find(isLoc);
45
+ const {loc} = current.node;
46
+
47
+ if (current.__escover_loc_column) {
48
+ return {
49
+ start: {
50
+ ...loc.start,
51
+ column: ++current.__escover_loc_column,
52
+ },
53
+ };
54
+ }
55
+
56
+ current.__escover_loc_column = 1;
57
+
58
+ return loc;
59
+ };
44
60
 
45
61
  export const fix = (path, {options}) => {
46
62
  const {node} = path;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "escover",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
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",