@putout/plugin-putout 19.3.0 → 19.4.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.
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const {operator} = require('putout');
3
+ const {operator, types} = require('putout');
4
+ const {isObjectPattern} = types;
4
5
  const {
5
6
  getTemplateValues,
6
7
  remove,
@@ -17,10 +18,18 @@ module.exports.fix = ({path}) => {
17
18
  module.exports.traverse = ({push}) => ({
18
19
  [GET_PROPERTIES]: (path) => {
19
20
  const {__a} = getTemplateValues(path, GET_PROPERTIES);
21
+
22
+ if (!isObjectPattern(__a))
23
+ return;
24
+
20
25
  const __cPath = path.get('declarations.0.init.arguments.1');
21
26
 
22
27
  for (const nameProp of __cPath.get('elements')) {
23
28
  let used = false;
29
+
30
+ if (!nameProp.isStringLiteral())
31
+ break;
32
+
24
33
  const {value} = nameProp.node;
25
34
 
26
35
  for (const prop of __a.properties) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout",
3
- "version": "19.3.0",
3
+ "version": "19.4.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin helps with plugins development",