@putout/operator-ignore 1.1.0 → 1.2.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/lib/ignore.js +6 -0
- package/package.json +1 -1
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.
|
|
3
|
+
"version": "1.2.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",
|