@putout/plugin-printer 4.1.0 → 4.1.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/lib/apply-types/index.js +12 -1
- package/package.json +1 -1
package/lib/apply-types/index.js
CHANGED
|
@@ -13,13 +13,24 @@ module.exports.match = () => ({
|
|
|
13
13
|
if (!isObjectPattern(__a))
|
|
14
14
|
return false;
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const {properties} = __a;
|
|
17
|
+
|
|
18
|
+
if (properties.length > 1) {
|
|
19
|
+
const [, second] = properties;
|
|
20
|
+
return TYPES.includes(second.value.name);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const [first] = properties;
|
|
17
24
|
|
|
18
25
|
return TYPES.includes(first.value.name);
|
|
19
26
|
},
|
|
20
27
|
});
|
|
21
28
|
|
|
22
29
|
module.exports.replace = () => ({
|
|
30
|
+
'const {types, __a} = require("@putout/babel")': `{
|
|
31
|
+
const {types} = require("@putout/babel");
|
|
32
|
+
const {__a} = types;
|
|
33
|
+
}`,
|
|
23
34
|
'const __a = require("@putout/babel")': 'const __a = require("@putout/babel").types',
|
|
24
35
|
'const __a = require("@putout/babel").types': `{
|
|
25
36
|
const {types} = require("@putout/babel");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-printer",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "🐊Putout plugin adds support of transformations for @putout/printer",
|