@putout/compare
Advanced tools
Comparing version 15.0.2 to 15.1.0
@@ -12,3 +12,3 @@ 'use strict'; | ||
const {runComparators} = require('./comparators'); | ||
const {runComparators} = require('./run-comparators'); | ||
const {runTopLevelComparators} = require('./top-level-comparators'); | ||
@@ -25,2 +25,3 @@ | ||
const {extractExpression} = template; | ||
const addWaterMark = (a) => a; | ||
@@ -33,3 +34,3 @@ const {keys} = Object; | ||
const compareType = (type) => (path) => path.type === type; | ||
const superPush = (array) => (a, b) => array.push([a, b]); | ||
const superPush = (array) => (a, b, c = {}) => array.push([a, b, c]); | ||
const maybeArray = (a) => isArray(a) ? a : [a]; | ||
@@ -77,3 +78,3 @@ | ||
const node = extractExpression(parseNode(path)); | ||
const node = addWaterMark(extractExpression(parseNode(path))); | ||
const templateNode = extractExpression(parseNode(template)); | ||
@@ -121,3 +122,4 @@ | ||
// @babel/template creates empty array directives// extra duplicate value | ||
// @babel/template creates empty array directives | ||
// extra duplicate value | ||
const ignore = [ | ||
@@ -149,3 +151,3 @@ 'loc', | ||
while (item = array.pop()) { | ||
const [node, template] = item; | ||
const [node, template, {plain} = {}] = item; | ||
@@ -165,2 +167,3 @@ if (!node || isEmptyArray(node) && !isEmptyArray(template)) | ||
templateStore, | ||
plain, | ||
}); | ||
@@ -167,0 +170,0 @@ |
@@ -27,4 +27,2 @@ 'use strict'; | ||
return node.typeName.name; | ||
// if (isTSMappedType(node)) | ||
// return node.key.name; | ||
}; | ||
@@ -46,5 +44,7 @@ | ||
add(templateStore[name], nodeValue); | ||
add(templateStore[name], nodeValue, { | ||
plain: true, | ||
}); | ||
return true; | ||
}; |
{ | ||
"name": "@putout/compare", | ||
"version": "15.0.2", | ||
"version": "15.1.0", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", |
31309
12
784