@ywfe/fe-tools 1.2.1-beta.24 → 1.2.1-beta.25

Sign up to get free protection for your applications and to get access to all the features.
package/JSON2String.ts CHANGED
@@ -4,11 +4,14 @@ interface Input {
4
4
  // Ctrl-S保存代码
5
5
  function JSON2String({input}: { input: Input }){
6
6
  const { data } = input;
7
+ const result:{content: string} = {content:''};
7
8
  try {
8
- const str = JSON.stringify(data)
9
- return '```json' + str + 'json```'
9
+ const str = JSON.stringify(data);
10
+ result.content = '```json' + str + 'json```';
11
+ return result;
10
12
  } catch (error) {
11
- return '```json' + '{}' + 'json```'
13
+ result.content = '```json' + '{}' + 'json```';
14
+ return result;
12
15
  }
13
16
  }
14
17
  export default JSON2String
package/index.ts CHANGED
@@ -1,3 +1 @@
1
- export { default as request } from './request'
2
- export { default as userInputToJson } from './userInputToJson'
3
1
  export { default as JSON2String } from './JSON2String'
@@ -3,5 +3,7 @@ interface Input {
3
3
  }
4
4
  declare function JSON2String({ input }: {
5
5
  input: Input;
6
- }): string;
6
+ }): {
7
+ content: string;
8
+ };
7
9
  export default JSON2String;
package/lib/index.d.ts CHANGED
@@ -1,3 +1 @@
1
- export { default as request } from './request';
2
- export { default as userInputToJson } from './userInputToJson';
3
1
  export { default as JSON2String } from './JSON2String';