@ywfe/fe-tools 1.0.2-beta.10 → 1.0.2-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@ywfe/fe-tools",
4
- "version": "1.0.2-beta.10",
4
+ "version": "1.0.2-beta.12",
5
5
  "description": "工具函数库",
6
6
  "main": "./lib/ywfe-tools.esm.js",
7
7
  "module": "./lib/ywfe-tools.esm.js",
@@ -9,7 +9,7 @@
9
9
  "scripts": {
10
10
  "build": "rollup -c",
11
11
  "build:type": "tsc -p ./tsconfig.type.json",
12
- "prepublishOnly": "npm run build",
12
+ "prepublishOnly": "npm run build && npm run build:type",
13
13
  "test": "jest --coverage"
14
14
  },
15
15
  "repository": "ywfe",
package/request.ts CHANGED
@@ -17,7 +17,7 @@ async function request({input}:{input:RequestOptions}){
17
17
  const env = '{{env}}';
18
18
  return basePathMap.get(env);
19
19
  };
20
- const isValidURL = (url:string)=> {
20
+ const isValidURL = (url)=> {
21
21
  var pattern = new RegExp(
22
22
  '^(https?:\\/\\/)?' + // protocol
23
23
  '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
@@ -0,0 +1,17 @@
1
+ // Ctrl-S保存代码
2
+ interface userInput {
3
+ userInput?:string,
4
+ rules?:string,
5
+ }
6
+ async function userInputToJson({input}:{input:userInput}){
7
+ const {userInput, rules} = input
8
+ //@ts-ignore
9
+ const res = await feTools.request({
10
+ input:{
11
+ url:"https://fc-typechat.ywwl.com/userInputToJson",
12
+ method:"GET"
13
+ }
14
+ })
15
+ return res
16
+ }
17
+ export default userInputToJson