@ywfe/fe-tools 1.2.1-beta.13 → 1.2.1-beta.14

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,13 @@
1
+ interface userInput {
2
+ data?: object;
3
+ }
4
+ function JSON2String({ input }) {
5
+ const { data = {} } = input;
6
+ try {
7
+ return "```json" + JSON.stringify(data) + "json```";
8
+ } catch (error) {
9
+ return "```json" + JSON.stringify({}) + "json```";
10
+ }
11
+ }
12
+
13
+ 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,4 @@
1
+ declare function JSON2String({ input }: {
2
+ input: any;
3
+ }): string;
4
+ 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';