feat(substore): 新增 peiqian 和 yuetong 重命名脚本并优化现有脚本注释

This commit is contained in:
Orion
2026-06-03 10:12:11 +08:00
parent 93bb6a7a6c
commit 07ef71bf4a
5 changed files with 78 additions and 9 deletions
+5 -1
View File
@@ -3,6 +3,7 @@
* 核心架构:动态按长度排序编译正则 + 智能边界识别 + O(1) 映射提取
* 维护说明:仅需修改 featureMap 字典即可,底部逻辑永远无需改动。
*/
// noinspection JSUnusedGlobalSymbols
function operator(proxies) {
// ================= 唯一配置区 =================
// 在这里新增或修改关键词。格式:"节点关键词": "想要注入的标签"
@@ -29,7 +30,10 @@ function operator(proxies) {
const normalizedFeatureMap = {};
const featureKeywords = Object.keys(featureMap);
const normalizeFeatureKeyword = keyword => keyword.toUpperCase().replace(/\s+/g, '');
const escapeRegexKeyword = keyword => keyword.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
const regexSpecialChars = new Set(['.', '*', '+', '?', '^', '$', '{', '}', '(', ')', '|', '[', ']', '\\']);
const escapeRegexKeyword = keyword => [...keyword]
.map(char => regexSpecialChars.has(char) ? `\\${char}` : char)
.join('');
for (const featureKeyword of featureKeywords) {
normalizedFeatureMap[normalizeFeatureKeyword(featureKeyword)] = featureMap[featureKeyword];
}