@putout/printer 15.11.0 → 15.12.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,28 +5,19 @@ module.exports.ImportAttribute = (path, {print}) => {
|
|
|
5
5
|
print(':');
|
|
6
6
|
print.space();
|
|
7
7
|
print('__value');
|
|
8
|
+
print(',');
|
|
8
9
|
};
|
|
9
10
|
|
|
10
|
-
module.exports.maybePrintAttributes = (path,
|
|
11
|
+
module.exports.maybePrintAttributes = (path, printer) => {
|
|
11
12
|
if (isAssertions(path))
|
|
12
|
-
return printAttributes(path,
|
|
13
|
-
write,
|
|
14
|
-
traverse,
|
|
15
|
-
|
|
16
|
-
keyword: 'assert',
|
|
17
|
-
});
|
|
13
|
+
return printAttributes(path, 'assert', printer);
|
|
18
14
|
|
|
19
|
-
printAttributes(path,
|
|
20
|
-
write,
|
|
21
|
-
traverse,
|
|
22
|
-
|
|
23
|
-
keyword: 'with',
|
|
24
|
-
});
|
|
15
|
+
printAttributes(path, 'with', printer);
|
|
25
16
|
};
|
|
26
17
|
|
|
27
18
|
const isAssertions = (path) => path.node.extra?.deprecatedAssertSyntax;
|
|
28
19
|
|
|
29
|
-
function printAttributes(path, {write, traverse,
|
|
20
|
+
function printAttributes(path, keyword, {write, traverse, indent}) {
|
|
30
21
|
const attributes = path.get('attributes');
|
|
31
22
|
|
|
32
23
|
if (!attributes.length)
|
|
@@ -36,12 +27,16 @@ function printAttributes(path, {write, traverse, keyword}) {
|
|
|
36
27
|
write.space();
|
|
37
28
|
|
|
38
29
|
write('{');
|
|
39
|
-
write.
|
|
30
|
+
write.breakline();
|
|
31
|
+
indent.inc();
|
|
40
32
|
|
|
41
33
|
for (const attr of attributes) {
|
|
34
|
+
indent();
|
|
42
35
|
traverse(attr);
|
|
36
|
+
write.newline();
|
|
43
37
|
}
|
|
44
38
|
|
|
45
|
-
|
|
39
|
+
indent.dec();
|
|
46
40
|
write('}');
|
|
47
41
|
}
|
|
42
|
+
|
package/package.json
CHANGED