@putout/compare
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -8,6 +8,2 @@ 'use strict'; | ||
isExpressionStatement, | ||
isArrayPattern, | ||
isArrayExpression, | ||
isObjectPattern, | ||
isObjectExpression, | ||
isClassBody, | ||
@@ -167,2 +163,5 @@ isBlock, | ||
const __OBJECT_TYPE = 'ObjectPattern|ObjectExpression'; | ||
const __ARRAY_TYPE = 'ArrayPattern|ArrayExpression'; | ||
function isEqualAnyArray(node, id) { | ||
@@ -172,6 +171,4 @@ if (!isAnyArray(id)) | ||
if (!isArrayPattern(node) && !isArrayExpression(node)) | ||
return false; | ||
return true; | ||
const {type} = node; | ||
return __ARRAY_TYPE.includes(type); | ||
} | ||
@@ -183,6 +180,4 @@ | ||
if (!isObjectPattern(node) && !isObjectExpression(node)) | ||
return false; | ||
return true; | ||
const {type} = node; | ||
return __OBJECT_TYPE.includes(type); | ||
} | ||
@@ -192,13 +187,13 @@ | ||
const node = template.ast(tmpl); | ||
if (tmpl === '__object') | ||
return [node, 'ObjectPattern|ObjectExpression']; | ||
return [node, __OBJECT_TYPE]; | ||
if (tmpl === '__array') | ||
return [node, 'ArrayPattern|ArrayExpression']; | ||
return [node, __ARRAY_TYPE]; | ||
const {type} = node; | ||
return [node, type]; | ||
} | ||
{ | ||
"name": "@putout/compare", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", | ||
@@ -5,0 +5,0 @@ "description": "compare ast-nodes", |
9425
162