@putout/printer 1.129.0 → 1.130.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
|
@@ -12,6 +12,12 @@ module.exports.ImportAttribute = (path, {print}) => {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
module.exports.printAttributes = (path, {write, traverse}) => {
|
|
15
|
+
if (isAssertions(path))
|
|
16
|
+
printAssertions(path, {
|
|
17
|
+
write,
|
|
18
|
+
traverse,
|
|
19
|
+
});
|
|
20
|
+
|
|
15
21
|
const attributes = path.get('attributes');
|
|
16
22
|
|
|
17
23
|
if (!attributes.length)
|
|
@@ -24,3 +30,19 @@ module.exports.printAttributes = (path, {write, traverse}) => {
|
|
|
24
30
|
traverse(attr);
|
|
25
31
|
}
|
|
26
32
|
};
|
|
33
|
+
|
|
34
|
+
const isAssertions = (path) => path.node.assertions;
|
|
35
|
+
|
|
36
|
+
function printAssertions(path, {write, traverse}) {
|
|
37
|
+
const attributes = path.get('assertions');
|
|
38
|
+
|
|
39
|
+
if (!attributes.length)
|
|
40
|
+
return;
|
|
41
|
+
|
|
42
|
+
write(' assert');
|
|
43
|
+
write.space();
|
|
44
|
+
|
|
45
|
+
for (const attr of attributes) {
|
|
46
|
+
traverse(attr);
|
|
47
|
+
}
|
|
48
|
+
}
|
package/package.json
CHANGED