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

Sign up to get free protection for your applications and to get access to all the features.
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';