@putout/plugin-putout 29.28.0 → 29.30.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.
@@ -5,6 +5,7 @@ import jsx from './jsx.js';
5
5
  import keyword from './keyword.js';
6
6
  import parens from './parens.js';
7
7
  import regexp from './regexp.js';
8
+ import markdown from './markdown.js';
8
9
  import creators from './creators.json' with {
9
10
  type: 'json',
10
11
  };
@@ -18,6 +19,7 @@ export default {
18
19
  ...keyword,
19
20
  ...parens,
20
21
  ...regexp,
22
+ ...markdown,
21
23
  operator: `import {operator} from 'putout'`,
22
24
  compare: 'const {compare} = operator',
23
25
  compareAll: 'const {compareAll} = operator',
@@ -9,4 +9,5 @@ export default {
9
9
  __toml: 'const {__toml} = operator',
10
10
  __markdown: 'const {__markdown} = operator',
11
11
  __sql: 'const {__sql} = operator',
12
+ __css: 'const {__css} = operator',
12
13
  };
@@ -0,0 +1,3 @@
1
+ export default {
2
+ indentCodeblock: 'const {indentCodeblock} = operator',
3
+ };
@@ -6,6 +6,7 @@ const {
6
6
  fromJS,
7
7
  compare,
8
8
  sortProperties,
9
+ indentCodeblock,
9
10
  } = operator;
10
11
 
11
12
  export const report = () => `Sort 'Configuration'`;
@@ -26,24 +27,8 @@ export const replace = () => ({
26
27
  ],
27
28
  });
28
29
 
29
- const json = indent(fromJS(code)).trimEnd();
30
+ const json = indentCodeblock(fromJS(code)).trimEnd();
30
31
 
31
32
  return `codeblock("json", \`${json}\n\`)`;
32
33
  },
33
34
  });
34
-
35
- const indent = (a, prefixCount = 4) => {
36
- const lines = a.split('\n');
37
- const result = [''];
38
-
39
- const prefix = ' '.repeat(prefixCount * 2);
40
- const suffix = ' '.repeat(prefixCount);
41
-
42
- for (const line of lines) {
43
- result.push(`${prefix}${line}`);
44
- }
45
-
46
- result.push(suffix);
47
-
48
- return result.join('\n');
49
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout",
3
- "version": "29.28.0",
3
+ "version": "29.30.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",