@putout/operator-ignore 1.1.0 → 1.3.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/README.md CHANGED
@@ -15,7 +15,7 @@ npm i putout @putout/operator-ignore
15
15
 
16
16
  ### `__ignore`
17
17
 
18
- ```
18
+ ```js
19
19
  const {operator, ignore} = require('putout');
20
20
  const {__ignore} = operator;
21
21
 
@@ -33,16 +33,14 @@ module.exports = ignore(__ignore, {
33
33
 
34
34
  ### `__json`
35
35
 
36
- ```
36
+ ```js
37
37
  const {operator, ignore} = require('putout');
38
38
  const {__json} = operator;
39
39
 
40
40
  module.exports = ignore(__json, {
41
41
  name: '.nycrc.json',
42
42
  field: 'exclude',
43
- list: [
44
- '*.config.*',
45
- ],
43
+ list: ['*.config.*'],
46
44
  });
47
45
  ```
48
46
 
package/lib/ignore.js CHANGED
@@ -38,6 +38,9 @@ const createMatch = ({type, property, collector, list}) => ({options}) => {
38
38
  collector,
39
39
  });
40
40
 
41
+ if (!elements)
42
+ return false;
43
+
41
44
  const list = elements.map(getValue);
42
45
 
43
46
  for (const name of newNames) {
@@ -94,5 +97,8 @@ function parseElements(vars, {property, collector}) {
94
97
 
95
98
  const [prop] = traverseProperties(node, property);
96
99
 
100
+ if (!prop)
101
+ return null;
102
+
97
103
  return prop.node.value.elements;
98
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/operator-ignore",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout operator adds ability to ignore referenced variables that was not defined",
@@ -11,7 +11,7 @@
11
11
  "changelog": false,
12
12
  "repository": {
13
13
  "type": "git",
14
- "url": "git://github.com/coderaiser/putout.git"
14
+ "url": "git+https://github.com/coderaiser/putout.git"
15
15
  },
16
16
  "scripts": {
17
17
  "test": "madrun test",
@@ -30,16 +30,16 @@
30
30
  "ignore"
31
31
  ],
32
32
  "devDependencies": {
33
- "@putout/test": "^9.0.0",
34
- "c8": "^9.0.0",
33
+ "@putout/test": "^11.0.0",
34
+ "c8": "^10.0.0",
35
35
  "eslint": "^9.0.0",
36
36
  "eslint-plugin-n": "^17.0.0",
37
- "eslint-plugin-putout": "^22.0.0",
37
+ "eslint-plugin-putout": "^23.0.0",
38
38
  "lerna": "^6.0.1",
39
39
  "madrun": "^10.0.0",
40
40
  "montag": "^1.2.1",
41
41
  "nodemon": "^3.0.1",
42
- "putout": "^35.13.0",
42
+ "putout": "*",
43
43
  "supertape": "^10.0.0",
44
44
  "try-catch": "^3.0.0"
45
45
  },
@@ -51,7 +51,7 @@
51
51
  "access": "public"
52
52
  },
53
53
  "dependencies": {
54
- "@putout/babel": "^2.4.0",
54
+ "@putout/babel": "^3.0.0",
55
55
  "@putout/operate": "^12.5.0"
56
56
  }
57
57
  }