@ywfe/fe-tools 1.2.1-beta.24 → 1.2.1-beta.26
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/JSON2String.ts +6 -3
- package/index.ts +0 -1
- package/lib/JSON2String.d.ts +3 -1
- package/lib/index.d.ts +0 -1
- package/lib/ywfe-tools.cjs +11 -38
- package/lib/ywfe-tools.cjs.map +1 -1
- package/lib/ywfe-tools.esm.js +12 -38
- package/lib/ywfe-tools.esm.js.map +1 -1
- package/lib/ywfe-tools.umd.js +2 -2
- package/lib/ywfe-tools.umd.js.map +1 -1
- package/package.json +1 -1
- package/request.ts +6 -6
- package/lib/userInputToJson.d.ts +0 -8
- package/userInputToJson.ts +0 -24
package/package.json
CHANGED
package/request.ts
CHANGED
@@ -19,12 +19,12 @@ async function request({ input }: { input: RequestOptions }) {
|
|
19
19
|
};
|
20
20
|
const isValidURL = (url:string) => {
|
21
21
|
var pattern = new RegExp(
|
22
|
-
"^(https
|
23
|
-
"((([a-z
|
24
|
-
"((
|
25
|
-
"(
|
26
|
-
"(
|
27
|
-
"(
|
22
|
+
"^(https?:\/\/)?" + // protocol
|
23
|
+
"((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}|" + // domain name
|
24
|
+
"((\d{1,3}\.){3}\d{1,3}))" + // OR ip (v4) address
|
25
|
+
"(\:\d+)?(\/[-a-z\d%_.~+]*)*" + // port and path
|
26
|
+
"(\?[;&a-z\d%_.~+=-]*)?" + // query string
|
27
|
+
"(\#[-a-z\d_]*)?$",
|
28
28
|
"i"
|
29
29
|
); // fragment locator
|
30
30
|
return !!pattern.test(url);
|
package/lib/userInputToJson.d.ts
DELETED
package/userInputToJson.ts
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
import {request} from './index'
|
2
|
-
// Ctrl-S保存代码
|
3
|
-
interface userInput {
|
4
|
-
userInput?: string;
|
5
|
-
rules?: string;
|
6
|
-
}
|
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
|
-
}
|
23
|
-
}
|
24
|
-
export default userInputToJson
|