@putout/printer 1.27.0 → 1.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ChangeLog
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const {isCoupleLines} = require('../is');
|
|
4
|
+
const {isFunction} = require('@babel/types');
|
|
4
5
|
|
|
5
6
|
const isBodyOfArrow = (path) => path
|
|
6
7
|
.parentPath.node.body === path.node;
|
|
@@ -104,6 +105,9 @@ function isOneLine(path) {
|
|
|
104
105
|
if (isIf(path))
|
|
105
106
|
return ONE_LINE;
|
|
106
107
|
|
|
108
|
+
if (path.parentPath.isCallExpression() && isFunction(path.parentPath.node.arguments[1]))
|
|
109
|
+
return ONE_LINE;
|
|
110
|
+
|
|
107
111
|
if (isCoupleLines(path))
|
|
108
112
|
return MANY_LINES;
|
|
109
113
|
|
|
@@ -119,3 +123,4 @@ function isParens(path) {
|
|
|
119
123
|
|
|
120
124
|
return false;
|
|
121
125
|
}
|
|
126
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/printer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.28.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "Easiest possible opinionated Babel AST printer made with ❤️ to use in 🐊Putout",
|