@ywfe/fe-tools 1.2.1-beta.33 → 1.2.1-beta.34

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;
@@ -8784,15 +8784,12 @@ function userInputToJson(_a) {
8784
8784
  function JSON2String(_a) {
8785
8785
  var input = _a.input;
8786
8786
  var data = input.data;
8787
- var result = { content: '' };
8788
8787
  try {
8789
8788
  var str = JSON.stringify(data);
8790
- result.content = '```json' + str + 'json```';
8791
- return result;
8789
+ return '```json' + str + 'json```';
8792
8790
  }
8793
8791
  catch (error) {
8794
- result.content = '```json' + '{}' + 'json```';
8795
- return result;
8792
+ return '```json' + '{}' + 'json```';
8796
8793
  }
8797
8794
  }
8798
8795