@putout/printer
Advanced tools
Comparing version 6.4.1 to 6.5.0
@@ -17,8 +17,10 @@ 'use strict'; | ||
const {types} = require('@putout/babel'); | ||
const { | ||
isObjectExpression, | ||
isStringLiteral, | ||
} = require('@putout/babel').types; | ||
} = types; | ||
const isNextObject = (a) => a.getNextSibling().isObjectExpression(); | ||
const isArrayInsideArray = (path) => path.isArrayExpression() && path.parentPath.isArrayExpression(); | ||
@@ -67,3 +69,3 @@ const isInsideOneElementArray = ({parentPath}) => parentPath.node.elements.length === 1; | ||
const indented = !isTwoLongStrings(elements) || !isInsideArray(path) && isIndented(elements[0]); | ||
const indented = !isArrayInsideArray(path) && (!isTwoLongStrings(elements) || !isInsideArray(path) && isIndented(elements[0])); | ||
@@ -108,3 +110,3 @@ if (indented) | ||
indent.inc(); | ||
} else if (!isObjectExpression(elements.at(-1))) { | ||
} else if (!isArrayInsideArray(path) && !isObjectExpression(elements.at(-1))) { | ||
maybe.indent(elements.length && isNewLine); | ||
@@ -111,0 +113,0 @@ } |
{ | ||
"name": "@putout/printer", | ||
"version": "6.4.1", | ||
"version": "6.5.0", | ||
"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
196811
4453