@ywfe/fe-tools 1.2.1-beta.36 → 1.2.1-beta.38

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,3 @@
1
+ export { default as request } from './request'
1
2
  export { default as userInputToJson } from './userInputToJson'
2
- export { default as handler } from './handler'
3
+ 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,3 @@
1
+ export { default as request } from './request';
1
2
  export { default as userInputToJson } from './userInputToJson';
2
- export { default as handler } from './handler';
3
+ export { default as JSON2String } from './JSON2String';
@@ -0,0 +1,9 @@
1
+ interface RequestOptions {
2
+ url: string;
3
+ method?: string;
4
+ params?: any;
5
+ }
6
+ declare function request({ input }: {
7
+ input: RequestOptions;
8
+ }): Promise<any>;
9
+ export default request;
@@ -4,5 +4,9 @@ interface userInput {
4
4
  }
5
5
  declare function userInputToJson({ input }: {
6
6
  input: userInput;
7
- }): Promise<string>;
7
+ }): Promise<{
8
+ message: string;
9
+ success: boolean;
10
+ data: any;
11
+ }>;
8
12
  export default userInputToJson;