@ywfe/fe-tools 1.2.1-beta.13 → 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 +13 -0
- package/index.ts +1 -2
- package/lib/JSON2String.d.ts +4 -0
- package/lib/index.d.ts +1 -2
- package/lib/ywfe-tools.cjs +10 -8784
- package/lib/ywfe-tools.cjs.map +1 -1
- package/lib/ywfe-tools.esm.js +10 -8783
- package/lib/ywfe-tools.esm.js.map +1 -1
- package/lib/ywfe-tools.umd.js +2 -0
- package/lib/ywfe-tools.umd.js.map +1 -0
- package/package.json +5 -4
- package/lib/request.d.ts +0 -9
- package/lib/userInputToJson.d.ts +0 -8
- package/request.ts +0 -49
- 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 @@
|
|
1
|
-
export { default as
|
2
|
-
export { default as userInputToJson } from './userInputToJson'
|
1
|
+
export { default as JSON2String } from './JSON2String'
|
package/lib/index.d.ts
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
export { default as
|
2
|
-
export { default as userInputToJson } from './userInputToJson';
|
1
|
+
export { default as JSON2String } from './JSON2String';
|