codestop-js-proof
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -46,5 +46,8 @@ "use strict"; | ||
if (_.has(node, subNode) && (node[subNode] instanceof Array || node[subNode] instanceof Object)) { | ||
if (subNode == 'declarations' || subNode == 'body' || subNode == 'cases') { | ||
if (subNode == 'declarations' || subNode == 'cases') { | ||
nodes = [...nodes, ...node[subNode]]; | ||
} | ||
else if (subNode == 'body') { | ||
nodes = [...nodes, ...node[subNode][subNode]]; | ||
} | ||
else { | ||
@@ -51,0 +54,0 @@ if (subNode == 'arguments' || subNode == 'params') { |
@@ -8,7 +8,7 @@ "use strict"; | ||
return (node) => { | ||
return (node['type'] == 'FunctionDeclaration' | ||
return (node['type'] === 'FunctionDeclaration' | ||
&& | ||
filters['name'] | ||
? node['id']['name'] == filters['name'] | ||
: true); | ||
(filters && filters['name'] | ||
? node['id']['name'] == filters['name'] | ||
: true)); | ||
}; | ||
@@ -15,0 +15,0 @@ } |
{ | ||
"name": "codestop-js-proof", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "## Usage", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -55,4 +55,6 @@ import * as _ from 'lodash'; | ||
if (_.has(node, subNode) && (node[subNode] instanceof Array || node[subNode] instanceof Object)) { | ||
if (subNode == 'declarations' || subNode == 'body' || subNode == 'cases') { | ||
if (subNode == 'declarations' || subNode == 'cases') { | ||
nodes = [...nodes, ...node[subNode]]; | ||
} else if (subNode == 'body') { | ||
nodes = [...nodes, ...node[subNode][subNode]]; | ||
} else { | ||
@@ -59,0 +61,0 @@ if (subNode == 'arguments' || subNode == 'params') { |
@@ -9,7 +9,9 @@ import Rule from '../Rule'; | ||
return ( | ||
node['type'] == 'FunctionDeclaration' | ||
node['type'] === 'FunctionDeclaration' | ||
&& | ||
filters['name'] | ||
( | ||
filters && filters['name'] | ||
? node['id']['name'] == filters['name'] | ||
: true | ||
) | ||
); | ||
@@ -16,0 +18,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
136484
4025