@putout/plugin-putout 29.17.0 → 29.19.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.
@@ -2,7 +2,7 @@ import {operator} from 'putout';
2
2
  import regexpEscapePolifyll from 'regexp.escape';
3
3
 
4
4
  const {
5
- escape: regexpEscape = regexpEscapePolifyll,
5
+ escape = regexpEscapePolifyll,
6
6
  } = RegExp;
7
7
 
8
8
  const {
@@ -89,7 +89,7 @@ const check = ({__a}, path) => {
89
89
  if (name.includes(')'))
90
90
  return false;
91
91
 
92
- const safeName = regexpEscape(name);
92
+ const safeName = escape(name);
93
93
 
94
94
  const regEnd = RegExp(`: ${safeName}$`);
95
95
  const regMiddle = RegExp(`: ${safeName}: .*`);
@@ -68,7 +68,10 @@ export const replace = () => ({
68
68
  const name = toKebabCase(value.name);
69
69
 
70
70
  path.node.arguments[1] = arrayExpression([
71
- arrayExpression([stringLiteral(name), value]),
71
+ arrayExpression([
72
+ stringLiteral(name),
73
+ value,
74
+ ]),
72
75
  ]);
73
76
 
74
77
  return path;
@@ -75,7 +75,9 @@ export const fix = (path, {options}) => {
75
75
  if (path.parentPath.parentPath.isTSModuleBlock()) {
76
76
  const key = identifier(getVar());
77
77
 
78
- replaceWith(path, variableDeclaration('var', [variableDeclarator(key)]));
78
+ replaceWith(path, variableDeclaration('var', [
79
+ variableDeclarator(key),
80
+ ]));
79
81
 
80
82
  return;
81
83
  }
@@ -14,6 +14,7 @@ const {
14
14
  compute,
15
15
  __json,
16
16
  __yaml,
17
+ __toml,
17
18
  } = operator;
18
19
 
19
20
  const name = '__putout_plugin_check_replace_code';
@@ -160,6 +161,9 @@ function parseKey(propertyPath) {
160
161
  if (keyPath.isIdentifier({name: '__yaml'}))
161
162
  return [null, __yaml];
162
163
 
164
+ if (keyPath.isIdentifier({name: '__toml'}))
165
+ return [null, __toml];
166
+
163
167
  const [isComputed, key] = compute(keyPath);
164
168
 
165
169
  if (!isComputed)
@@ -7,4 +7,5 @@ export default {
7
7
  __ignore: 'const {__ignore} = operator',
8
8
  __docker: 'const {__docker} = operator',
9
9
  __toml: 'const {__toml} = operator',
10
+ __markdown: 'const {__markdown} = operator',
10
11
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout",
3
- "version": "29.17.0",
3
+ "version": "29.19.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin helps with plugins development",