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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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';