@ywfe/fe-tools 1.2.1-beta.23 → 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 ADDED
@@ -0,0 +1,17 @@
1
+ interface Input {
2
+ data: object;
3
+ }
4
+ // Ctrl-S保存代码
5
+ function JSON2String({input}: { input: Input }){
6
+ const { data } = input;
7
+ const result:{content: string} = {content:''};
8
+ try {
9
+ const str = JSON.stringify(data);
10
+ result.content = '```json' + str + 'json```';
11
+ return result;
12
+ } catch (error) {
13
+ result.content = '```json' + '{}' + 'json```';
14
+ return result;
15
+ }
16
+ }
17
+ export default JSON2String
package/index.ts CHANGED
@@ -1,2 +1 @@
1
- export { default as request } from './request'
2
- export { default as userInputToJson } from './userInputToJson'
1
+ export { default as JSON2String } from './JSON2String'
@@ -0,0 +1,9 @@
1
+ interface Input {
2
+ data: object;
3
+ }
4
+ declare function JSON2String({ input }: {
5
+ input: Input;
6
+ }): {
7
+ content: string;
8
+ };
9
+ export default JSON2String;
package/lib/index.d.ts CHANGED
@@ -1,2 +1 @@
1
- export { default as request } from './request';
2
- export { default as userInputToJson } from './userInputToJson';
1
+ export { default as JSON2String } from './JSON2String';