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