@ywfe/fe-tools 1.2.1-beta.39 → 1.2.1-beta.40

Sign up to get free protection for your applications and to get access to all the features.
package/JSON2String.ts CHANGED
@@ -4,14 +4,11 @@ interface Input {
4
4
  // Ctrl-S保存代码
5
5
  function JSON2String({input}: { input: Input }){
6
6
  const { data } = input;
7
- const result:{content: string} = {content:''};
8
7
  try {
9
8
  const str = JSON.stringify(data);
10
- result.content = '```json' + str + 'json```';
11
- return result;
9
+ return '```json' + str + 'json```'
12
10
  } catch (error) {
13
- result.content = '```json' + '{}' + 'json```';
14
- return result;
11
+ return '```json' + '{}' + 'json```'
15
12
  }
16
13
  }
17
14
  export default JSON2String
@@ -3,7 +3,5 @@ interface Input {
3
3
  }
4
4
  declare function JSON2String({ input }: {
5
5
  input: Input;
6
- }): {
7
- content: string;
8
- };
6
+ }): string;
9
7
  export default JSON2String;
@@ -8785,15 +8785,12 @@ function userInputToJson(_a) {
8785
8785
  function JSON2String(_a) {
8786
8786
  var input = _a.input;
8787
8787
  var data = input.data;
8788
- var result = { content: '' };
8789
8788
  try {
8790
8789
  var str = JSON.stringify(data);
8791
- result.content = '```json' + str + 'json```';
8792
- return result;
8790
+ return '```json' + str + 'json```';
8793
8791
  }
8794
8792
  catch (error) {
8795
- result.content = '```json' + '{}' + 'json```';
8796
- return result;
8793
+ return '```json' + '{}' + 'json```';
8797
8794
  }
8798
8795
  }
8799
8796