@putout/printer 8.35.1 → 8.35.2

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
+ 2024.05.16, v8.35.2
2
+
3
+ fix:
4
+ - 3dc22a9 @putout/printer: AssignmentExpression: no loc
5
+
1
6
  2024.05.14, v8.35.1
2
7
 
3
8
  fix:
@@ -41,8 +41,8 @@ const isPrevCoupleLines = (path) => {
41
41
  if (!prev.node)
42
42
  return false;
43
43
 
44
- const currentStart = path.node?.loc.start.line;
45
- const prevEnd = prev.node?.loc.end.line;
44
+ const currentStart = path.node?.loc?.start.line;
45
+ const prevEnd = prev.node?.loc?.end.line;
46
46
 
47
47
  if (!isCoupleLines(prev))
48
48
  return false;
@@ -51,6 +51,7 @@ module.exports.isIndented = (path = {}) => {
51
51
  const {parentPath, node} = path;
52
52
  return node.loc?.start.column !== parentPath.node.loc.start.column;
53
53
  };
54
+
54
55
  module.exports.isCoupleLines = isCoupleLines;
55
56
 
56
57
  function isCoupleLines(path) {
@@ -79,6 +80,7 @@ module.exports.isSimpleAndEmptyObject = ([a, b]) => {
79
80
  module.exports.isIdentifierAndIdentifier = ([a, b]) => {
80
81
  return isIdentifier(a) && isIdentifier(b);
81
82
  };
83
+
82
84
  module.exports.isStringAndMember = ([a, b]) => isStringLiteral(a) && isMemberExpression(b);
83
85
  module.exports.isIdentifierAndString = ([a, b]) => isIdentifier(a) && isStringLiteral(b);
84
86
  module.exports.isStringAndArray = ([a, b]) => {
@@ -137,6 +139,7 @@ module.exports.hasTrailingComment = (path) => {
137
139
  const node = parseNode(path);
138
140
  return node.trailingComments?.length;
139
141
  };
142
+
140
143
  module.exports.hasLeadingComment = (path) => path.node?.leadingComments?.length;
141
144
 
142
145
  module.exports.noTrailingComment = (path) => !path.node.trailingComments?.length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "8.35.1",
3
+ "version": "8.35.2",
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",