@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
|
@@ -41,8 +41,8 @@ const isPrevCoupleLines = (path) => {
|
|
|
41
41
|
if (!prev.node)
|
|
42
42
|
return false;
|
|
43
43
|
|
|
44
|
-
const currentStart = path.node?.loc
|
|
45
|
-
const prevEnd = prev.node?.loc
|
|
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;
|
package/lib/tokenize/is.js
CHANGED
|
@@ -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