@putout/plugin-printer 8.5.0 → 8.5.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.
@@ -11,6 +11,7 @@ const ARROW_NOT = ' -> !';
11
11
  const ARROW_LENGTH = ARROW.length;
12
12
  const ARROW_NOT_LENGTH = ARROW_NOT.length;
13
13
  const MARK = '🧨';
14
+ const NOT = '!';
14
15
 
15
16
  export const report = ({type}) => {
16
17
  return `Unknown type detected: '${type}'`;
@@ -36,10 +37,10 @@ export const traverse = ({push}) => ({
36
37
  if (value.includes(MARK))
37
38
  return;
38
39
 
39
- if (value.endsWith('->'))
40
+ if (!value.includes(ARROW))
40
41
  return;
41
42
 
42
- if (value.includes('!')) {
43
+ if (value.includes(NOT)) {
43
44
  const arrowNotIndex = value.indexOf(ARROW_NOT);
44
45
  const typeNotIndex = arrowNotIndex + ARROW_NOT_LENGTH;
45
46
 
@@ -59,9 +60,6 @@ export const traverse = ({push}) => ({
59
60
 
60
61
  const type = value.slice(typeIndex, value.length);
61
62
 
62
- if (!type)
63
- return;
64
-
65
63
  if (!types[`is${type}`])
66
64
  push({
67
65
  path,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-printer",
3
- "version": "8.5.0",
3
+ "version": "8.5.1",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin adds support of transformations for @putout/printer",