@putout/printer
Advanced tools
Comparing version 6.11.3 to 6.11.4
@@ -15,2 +15,3 @@ 'use strict'; | ||
isSpreadElement, | ||
isNumericLiteral, | ||
} = require('@putout/babel').types; | ||
@@ -26,3 +27,2 @@ | ||
satisfy, | ||
} = require('../../is'); | ||
@@ -94,8 +94,20 @@ | ||
if (tooLong(path) || isCoupleLines(path) || !isNumbers(elements) && !isForOf(path) && isLastArg(path) && !isParentProperty(path)) | ||
if (tooLong(path) || isCoupleLines(path)) | ||
return MULTI_LINE; | ||
if (notNumbersInsideForOf(path)) | ||
return MULTI_LINE; | ||
return ONE_LINE; | ||
}; | ||
function notNumbersInsideForOf(path) { | ||
const {elements} = path.node; | ||
if (isNumbers(elements)) | ||
return false; | ||
return !isForOf(path) && isLastArg(path) && !isParentProperty(path); | ||
} | ||
const isParentIsArrayWithFirstArrayElement = ({parentPath}) => { | ||
@@ -217,3 +229,3 @@ if (!isArrayExpression(parentPath)) | ||
for (const element of elements) { | ||
if (element.isNumericLiteral()) | ||
if (isNumericLiteral(element)) | ||
return true; | ||
@@ -220,0 +232,0 @@ } |
{ | ||
"name": "@putout/printer", | ||
"version": "6.11.3", | ||
"version": "6.11.4", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", |
Sorry, the diff of this file is not supported yet
200237
4531