@ywfe/fe-tools 1.2.1-beta.24 → 1.2.1-beta.25
Sign up to get free protection for your applications and to get access to all the features.
- package/JSON2String.ts +6 -3
- package/index.ts +0 -2
- package/lib/JSON2String.d.ts +3 -1
- package/lib/index.d.ts +0 -2
- package/lib/ywfe-tools.cjs +5 -8795
- package/lib/ywfe-tools.cjs.map +1 -1
- package/lib/ywfe-tools.esm.js +6 -8794
- package/lib/ywfe-tools.esm.js.map +1 -1
- package/lib/ywfe-tools.umd.js +1 -3
- package/lib/ywfe-tools.umd.js.map +1 -1
- package/package.json +1 -1
- package/lib/request.d.ts +0 -9
- package/lib/userInputToJson.d.ts +0 -8
- package/request.ts +0 -55
- package/userInputToJson.ts +0 -24
package/JSON2String.ts
CHANGED
@@ -4,11 +4,14 @@ interface Input {
|
|
4
4
|
// Ctrl-S保存代码
|
5
5
|
function JSON2String({input}: { input: Input }){
|
6
6
|
const { data } = input;
|
7
|
+
const result:{content: string} = {content:''};
|
7
8
|
try {
|
8
|
-
const str = JSON.stringify(data)
|
9
|
-
|
9
|
+
const str = JSON.stringify(data);
|
10
|
+
result.content = '```json' + str + 'json```';
|
11
|
+
return result;
|
10
12
|
} catch (error) {
|
11
|
-
|
13
|
+
result.content = '```json' + '{}' + 'json```';
|
14
|
+
return result;
|
12
15
|
}
|
13
16
|
}
|
14
17
|
export default JSON2String
|
package/index.ts
CHANGED
package/lib/JSON2String.d.ts
CHANGED
package/lib/index.d.ts
CHANGED