@putout/printer
Advanced tools
Comparing version 12.3.0 to 12.4.0
@@ -17,4 +17,8 @@ 'use strict'; | ||
const {likeChain} = require('../member-expression/member-expressions'); | ||
const {isInsideTuple} = require('./is-inside-tuple'); | ||
const {isStringLiteral} = types; | ||
const { | ||
isStringLiteral, | ||
isArrayExpression, | ||
} = types; | ||
@@ -41,6 +45,6 @@ const isBodyOfArrow = (path) => path.parentPath.node.body === path.node; | ||
function isInsideNestedArrayCall({parentPath}) { | ||
if (!parentPath.isArrayExpression()) | ||
if (!isArrayExpression(parentPath)) | ||
return false; | ||
if (!parentPath.parentPath.isArrayExpression()) | ||
if (!isArrayExpression(parentPath.parentPath)) | ||
return false; | ||
@@ -52,2 +56,5 @@ | ||
function isInsideNestedTuple({parentPath}) { | ||
if (!isArrayExpression(parentPath.parentPath)) | ||
return false; | ||
const {elements} = parentPath.parentPath.node; | ||
@@ -67,3 +74,3 @@ const [first] = elements; | ||
const insideNestedArrayCall = isInsideNestedArrayCall(path); | ||
const insideNestedArrayCall = isInsideTuple(path) || isInsideNestedArrayCall(path); | ||
@@ -70,0 +77,0 @@ maybe.indent.inc(!insideNestedArrayCall); |
{ | ||
"name": "@putout/printer", | ||
"version": "12.3.0", | ||
"version": "12.4.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
247242
146
5382