♻️ refactor(substore): 重构 regex 缓存机制并升级公共脚本版本

This commit is contained in:
2026-06-08 10:23:12 +08:00
parent afc8c70b95
commit 9c9b78ded9
8 changed files with 84 additions and 47 deletions
+3 -2
View File
@@ -6,7 +6,7 @@
* - 不追加订阅后缀,整合订阅最后仍交给 rename.js 处理
*/
// noinspection JSUnusedGlobalSymbols
const COMMON_SCRIPT_VERSION = '20260603-7';
const COMMON_SCRIPT_VERSION = '20260608-1';
const COMMON_SCRIPT_URL = `https://git.orionc.me/orion/script/raw/branch/main/substore/common.js?v=${COMMON_SCRIPT_VERSION}`;
const hasCurrentRenameUtils = utils => Boolean(
utils && utils.version === COMMON_SCRIPT_VERSION
@@ -132,13 +132,14 @@ async function operator(proxies) {
};
const countryOrder = Object.create(null);
let countryOrderCount = 0;
const normalizedItems = proxies.map((proxy, proxyIndex) => {
const normalizedItem = normalizeProxy(proxy, proxyIndex);
if (
normalizedItem.countryCode &&
countryOrder[normalizedItem.countryCode] === undefined
) {
countryOrder[normalizedItem.countryCode] = Object.keys(countryOrder).length;
countryOrder[normalizedItem.countryCode] = countryOrderCount++;
}
return normalizedItem;
});