@ywfe/fe-tools 1.2.1-beta.0 → 1.2.1-beta.10
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/userInputToJson.d.ts +1 -1
- package/lib/ywfe-tools.cjs +21 -8
- package/lib/ywfe-tools.cjs.map +1 -1
- package/lib/ywfe-tools.esm.js +21 -8
- package/lib/ywfe-tools.esm.js.map +1 -1
- package/package.json +1 -2
- package/rollup.config.js +1 -4
- package/userInputToJson.ts +19 -11
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"private": false,
|
3
3
|
"name": "@ywfe/fe-tools",
|
4
|
-
"version": "1.2.1-beta.
|
4
|
+
"version": "1.2.1-beta.10",
|
5
5
|
"description": "工具函数库",
|
6
6
|
"main": "./lib/ywfe-tools.cjs",
|
7
7
|
"module": "./lib/ywfe-tools.esm.js",
|
@@ -12,7 +12,6 @@
|
|
12
12
|
"prepublishOnly": "npm run build && npm run build:type",
|
13
13
|
"test": "jest --coverage"
|
14
14
|
},
|
15
|
-
"repository": "ywfe",
|
16
15
|
"author": {
|
17
16
|
"name": "YWFE",
|
18
17
|
"email": "ywfe@ywwl.com",
|
package/rollup.config.js
CHANGED
@@ -39,7 +39,7 @@ const formats = {
|
|
39
39
|
|
40
40
|
const config = {
|
41
41
|
input: './index.ts',
|
42
|
-
inlineDynamicImports: true,
|
42
|
+
// inlineDynamicImports: true,
|
43
43
|
output: [formats.esm, formats.commonjs],
|
44
44
|
external: ['react', 'react-dom'],
|
45
45
|
plugins: [
|
@@ -49,9 +49,6 @@ const config = {
|
|
49
49
|
progress({
|
50
50
|
clearLine: false,
|
51
51
|
}),
|
52
|
-
replace({
|
53
|
-
NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development'),
|
54
|
-
}),
|
55
52
|
nodeResolver(),
|
56
53
|
commonjs(),
|
57
54
|
typescript(),
|
package/userInputToJson.ts
CHANGED
@@ -1,16 +1,24 @@
|
|
1
|
+
import {request} from './index'
|
1
2
|
// Ctrl-S保存代码
|
2
3
|
interface userInput {
|
3
|
-
userInput?:string
|
4
|
-
rules?:string
|
4
|
+
userInput?: string;
|
5
|
+
rules?: string;
|
5
6
|
}
|
6
|
-
async function userInputToJson({input}:{input:userInput}){
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
async function userInputToJson({ input }: { input: userInput }) {
|
8
|
+
console.log("input", input);
|
9
|
+
const res: { message: string; success: boolean; data: any } =
|
10
|
+
await request({
|
11
|
+
input: {
|
12
|
+
url: "https://fc-typechat.ywwl.com/userInputToJson",
|
13
|
+
method: "GET",
|
14
|
+
params: input,
|
15
|
+
},
|
16
|
+
});
|
17
|
+
if (res.success) {
|
18
|
+
const result = res.data;
|
19
|
+
return result.success ? result.data : result;
|
20
|
+
} else {
|
21
|
+
return res.success ? res.data : res;
|
22
|
+
}
|
15
23
|
}
|
16
24
|
export default userInputToJson
|