@putout/printer 1.128.0 → 1.128.1
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
|
@@ -5,7 +5,9 @@ const isArg = (path) => path.parentPath.isFunction();
|
|
|
5
5
|
module.exports.AssignmentPattern = {
|
|
6
6
|
print(path, {print, maybe}) {
|
|
7
7
|
maybe.print(shouldPrint(path), '__left');
|
|
8
|
-
print(
|
|
8
|
+
print.space();
|
|
9
|
+
print('=');
|
|
10
|
+
print.space();
|
|
9
11
|
print('__right');
|
|
10
12
|
},
|
|
11
13
|
};
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const isOneArgArrow = (path) => {
|
|
4
|
-
if (path.type !== 'ArrowFunctionExpression')
|
|
5
|
-
return false;
|
|
6
|
-
|
|
7
|
-
return path.node.params.length === 1;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
3
|
module.exports.printParams = (path, {print}) => {
|
|
11
|
-
printBraceOpen(path, {
|
|
4
|
+
printBraceOpen(path, {
|
|
5
|
+
print,
|
|
6
|
+
});
|
|
12
7
|
|
|
13
8
|
const params = path.get('params');
|
|
14
9
|
const n = params.length;
|
|
@@ -22,7 +17,9 @@ module.exports.printParams = (path, {print}) => {
|
|
|
22
17
|
}
|
|
23
18
|
}
|
|
24
19
|
|
|
25
|
-
printBraceClose(path, {
|
|
20
|
+
printBraceClose(path, {
|
|
21
|
+
print,
|
|
22
|
+
});
|
|
26
23
|
};
|
|
27
24
|
|
|
28
25
|
function printBraceOpen(path, {print}) {
|
|
@@ -38,3 +35,16 @@ function printBraceClose(path, {print}) {
|
|
|
38
35
|
|
|
39
36
|
print(')');
|
|
40
37
|
}
|
|
38
|
+
|
|
39
|
+
function isOneArgArrow(path) {
|
|
40
|
+
if (path.type !== 'ArrowFunctionExpression')
|
|
41
|
+
return false;
|
|
42
|
+
|
|
43
|
+
const {params} = path.node;
|
|
44
|
+
const [param] = params;
|
|
45
|
+
|
|
46
|
+
if (params.length !== 1)
|
|
47
|
+
return false;
|
|
48
|
+
|
|
49
|
+
return param.type === 'Identifier';
|
|
50
|
+
}
|
package/package.json
CHANGED