@ywfe/fe-tools 1.2.1-beta.13 → 1.2.1-beta.15
Sign up to get free protection for your applications and to get access to all the features.
- package/JSON2String.ts +13 -0
- package/index.ts +1 -1
- package/lib/JSON2String.d.ts +4 -0
- package/lib/index.d.ts +1 -1
- package/lib/ywfe-tools.cjs +2013 -47
- package/lib/ywfe-tools.cjs.map +1 -1
- package/lib/ywfe-tools.esm.js +2013 -47
- package/lib/ywfe-tools.esm.js.map +1 -1
- package/lib/ywfe-tools.umd.js +4 -0
- package/lib/ywfe-tools.umd.js.map +1 -0
- package/package.json +5 -4
- package/request.ts +40 -34
- package/lib/userInputToJson.d.ts +0 -8
- package/userInputToJson.ts +0 -24
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,2 @@
|
|
1
1
|
export { default as request } from './request'
|
2
|
-
export { default as
|
2
|
+
export { default as JSON2String } from './JSON2String'
|
package/lib/index.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
export { default as request } from './request';
|
2
|
-
export { default as
|
2
|
+
export { default as JSON2String } from './JSON2String';
|