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