@putout/printer 1.131.0 → 1.132.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,3 +1,8 @@
1
+ 2023.06.04, v1.132.0
2
+
3
+ feature:
4
+ - b83ad0c @putout/printer: ArrayExpression: Tuple
5
+
1
6
  2023.06.03, v1.131.0
2
7
 
3
8
  feature:
@@ -8,6 +8,7 @@ const {
8
8
  isArrayExpression,
9
9
  isIdentifier,
10
10
  isCallExpression,
11
+ isBooleanLiteral,
11
12
  } = require('@babel/types');
12
13
 
13
14
  const {isSimple} = require('@putout/operate');
@@ -24,6 +25,7 @@ const isStringAndString = ([a, b]) => isStringLiteral(a) && isStringLiteral(b);
24
25
  const isIdentifierAndIdentifier = ([a, b]) => isIdentifier(a) && isIdentifier(b);
25
26
  const isInsideArray = (path) => path.parentPath.isArrayExpression();
26
27
  const isSimpleAndCall = ([a, b]) => isSimple(a) && isCallExpression(b);
28
+ const isBooleanAndSimple = ([a, b]) => isBooleanLiteral(a) && isSimple(b);
27
29
 
28
30
  const isTwoLongStrings = ([a, b]) => {
29
31
  const LONG_STRING = 20;
@@ -230,6 +232,9 @@ function isNewlineBetweenElements(path, {elements}) {
230
232
  if (isInsideLoop(path))
231
233
  return false;
232
234
 
235
+ if (isBooleanAndSimple(elements))
236
+ return false;
237
+
233
238
  if (isSimpleAndCall(elements))
234
239
  return false;
235
240
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "1.131.0",
3
+ "version": "1.132.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Simplest possible opinionated Babel AST printer for 🐊Putout",