escover 1.3.2 → 1.3.3

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,9 @@
1
+ 2022.01.15, v1.3.3
2
+
3
+ feature:
4
+ - escover: exclude not from current path
5
+
6
+
1
7
  2022.01.15, v1.3.2
2
8
 
3
9
  fix:
package/lib/escover.js CHANGED
@@ -9,6 +9,7 @@ import {createFileEntry} from './c4.js';
9
9
  global.__createC4 = createFileEntry;
10
10
 
11
11
  process.once('exit', exit);
12
+ const CWD = process.cwd();
12
13
 
13
14
  const EXCLUDE = [
14
15
  '.spec.',
@@ -26,6 +27,12 @@ export async function load(url, context, defaultLoad) {
26
27
  format,
27
28
  };
28
29
 
30
+ if (!url.includes(CWD))
31
+ return {
32
+ format,
33
+ source: rawSource,
34
+ };
35
+
29
36
  if (exclude(url, EXCLUDE))
30
37
  return {
31
38
  format,
@@ -35,15 +35,9 @@ function getLineNode(c4, {line, column}) {
35
35
  export const report = () => 'Mark line';
36
36
 
37
37
  export const fix = (path, {options}) => {
38
- const {
39
- parentPath,
40
- node,
41
- } = path;
38
+ const {node} = path;
42
39
 
43
- const {start} = path.node.loc || parentPath.node.loc || {};
44
-
45
- if (!start)
46
- return;
40
+ const {start} = path.node.loc;
47
41
 
48
42
  const {
49
43
  c4 = {
@@ -99,8 +93,9 @@ export const fix = (path, {options}) => {
99
93
  if (path.isReturnStatement())
100
94
  return addMarkToReturn(path, lineNode);
101
95
 
102
- if (path.isArrowFunctionExpression())
96
+ if (path.isArrowFunctionExpression()) {
103
97
  return addMarkToArrowFunction(path, lineNode);
98
+ }
104
99
 
105
100
  if (path.isThrowStatement())
106
101
  return addMarkToThrow(path, lineNode);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "escover",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
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",
@@ -54,7 +54,7 @@
54
54
  "devDependencies": {
55
55
  "@putout/test": "^4.1.0",
56
56
  "c8": "^7.8.0",
57
- "escover": ".",
57
+ "escover": "^1.0.0",
58
58
  "eslint": "^8.3.0",
59
59
  "eslint-plugin-node": "^11.1.0",
60
60
  "eslint-plugin-putout": "^13.0.1",