@putout/printer 2.26.0 → 2.27.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
|
@@ -5,13 +5,18 @@ const {printParams} = require('./params');
|
|
|
5
5
|
|
|
6
6
|
const ClassMethod = {
|
|
7
7
|
print(path, {print, maybe}) {
|
|
8
|
-
const {kind} = path.node;
|
|
8
|
+
const {kind, computed} = path.node;
|
|
9
9
|
const isConstructor = kind === 'constructor';
|
|
10
10
|
const isMethod = kind === 'method';
|
|
11
11
|
const isGetter = /get|set/.test(kind);
|
|
12
12
|
|
|
13
13
|
maybe.print(isConstructor, kind);
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
if (isMethod) {
|
|
16
|
+
maybe.print(computed, '[');
|
|
17
|
+
print('__key');
|
|
18
|
+
maybe.print(computed, ']');
|
|
19
|
+
}
|
|
15
20
|
|
|
16
21
|
if (isGetter) {
|
|
17
22
|
print(kind);
|
|
@@ -38,7 +38,7 @@ module.exports.ObjectPattern = {
|
|
|
38
38
|
|
|
39
39
|
for (const [i, property] of properties.entries()) {
|
|
40
40
|
if (property.isRestElement()) {
|
|
41
|
-
const couple =
|
|
41
|
+
const couple = is || hasObject;
|
|
42
42
|
|
|
43
43
|
maybe.indent(couple);
|
|
44
44
|
print(property);
|
|
@@ -50,10 +50,7 @@ module.exports.ObjectPattern = {
|
|
|
50
50
|
const keyPath = property.get('key');
|
|
51
51
|
const isAssign = valuePath.isAssignmentPattern();
|
|
52
52
|
|
|
53
|
-
const {
|
|
54
|
-
shorthand,
|
|
55
|
-
computed,
|
|
56
|
-
} = property.node;
|
|
53
|
+
const {shorthand, computed} = property.node;
|
|
57
54
|
|
|
58
55
|
const couple = isCoupleLines(valuePath) && !exists(property.getPrevSibling()) && !path.parentPath.isObjectProperty();
|
|
59
56
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/printer",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.27.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",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@putout/plugin-minify": "^1.8.0",
|
|
51
51
|
"@putout/plugin-printer": "^1.0.0",
|
|
52
|
+
"@putout/plugin-react-hook-form": "^3.4.1",
|
|
52
53
|
"@putout/plugin-react-hooks": "^5.0.0",
|
|
53
54
|
"@putout/test": "^6.0.1",
|
|
54
55
|
"acorn": "^8.8.2",
|