移除cat.js

This commit is contained in:
Saul Hetherman
2024-07-11 17:44:51 +08:00
parent d23c9bf421
commit b3dc3f31f1
14 changed files with 96 additions and 27466 deletions

4
js/core/CryptoJS.min.js vendored Normal file

File diff suppressed because one or more lines are too long

6
js/core/JSEncrypt.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

16
js/core/cheerio.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

56
js/core/uzUtils.js Normal file
View File

@@ -0,0 +1,56 @@
class UZUtils {
/**
* 从链接中获取域名
* @param {string} url
* @returns
*/
static getHostFromURL(url) {
const protocolEndIndex = url.indexOf("://");
if (protocolEndIndex === -1) {
return null;
}
const hostStartIndex = protocolEndIndex + 3;
const hostEndIndex = url.indexOf("/", hostStartIndex);
const host =
hostEndIndex === -1
? url.slice(hostStartIndex)
: url.slice(hostStartIndex, hostEndIndex);
return `${url.slice(0, protocolEndIndex + 3)}${host}`;
}
/**
* 去除尾部的斜杠
* @param {string} str
* @returns
*/
static removeTrailingSlash(str) {
if (str.endsWith("/")) {
return str.slice(0, -1);
}
return str;
}
/**
* 根据正则表达式获取字符串
* @param {*} pattern
* @param {string} str
* @returns {string}
*/
static getStrByRegexDefault(pattern, str) {
let matcher = pattern.exec(str);
if (matcher !== null) {
if (matcher.length >= 1) {
if (matcher.length >= 1) return matcher[1];
}
}
return str;
}
/**
* 用于在 uz 脚本调试模式中展示 log 信息
*/
static debugLog() {
sendMessage("debugLog", JSON.stringify([...arguments]));
}
}