@putout/printer 1.133.1 → 1.134.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.05, v1.134.0
2
+
3
+ feature:
4
+ - c8a3dc3 @putout/printer: ArrayExpression: tuple
5
+
1
6
  2023.06.05, v1.133.1
2
7
 
3
8
  fix:
@@ -9,6 +9,7 @@ const {
9
9
  isIdentifier,
10
10
  isCallExpression,
11
11
  isBooleanLiteral,
12
+ isNullLiteral,
12
13
  isObjectExpression,
13
14
  } = require('@babel/types');
14
15
 
@@ -27,6 +28,7 @@ const isIdentifierAndIdentifier = ([a, b]) => isIdentifier(a) && isIdentifier(b)
27
28
  const isInsideArray = (path) => path.parentPath.isArrayExpression();
28
29
  const isSimpleAndCall = ([a, b]) => isSimple(a) && isCallExpression(b);
29
30
  const isBooleanAndSimple = ([a, b]) => isBooleanLiteral(a) && isSimple(b);
31
+ const isNullAndSimple = ([a, b]) => isNullLiteral(a) && isSimple(b);
30
32
 
31
33
  const isTwoLongStrings = ([a, b]) => {
32
34
  const LONG_STRING = 20;
@@ -236,6 +238,9 @@ function isNewlineBetweenElements(path, {elements}) {
236
238
  if (isBooleanAndSimple(elements))
237
239
  return false;
238
240
 
241
+ if (isNullAndSimple(elements))
242
+ return false;
243
+
239
244
  if (isSimpleAndCall(elements))
240
245
  return false;
241
246
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "1.133.1",
3
+ "version": "1.134.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",