refactor(yinyun-rename): 重构代理节点名称处理逻辑
- 移除永久官网TG频道等信息节点的正则匹配函数 - 简化代理过滤逻辑去除冗余的字符串类型检查 - 优化代理节点映射流程提升代码可读性 - 统一代理名称清理和标签剥离处理逻辑
This commit is contained in:
@@ -80,8 +80,7 @@ async function operator(proxies) {
|
||||
];
|
||||
const regionResolver = utils.createRegionResolver(regionAliases);
|
||||
|
||||
const isInfoNode = name => /(?:永久官网|TG频道|YinYun\.Ltd|YINYUNLTD)/i.test(name);
|
||||
|
||||
return proxies.map(proxy => {
|
||||
const stripBackupLabel = name => String(name)
|
||||
.replace(/\s*(?:ᴮᴬᴷ|BAK|BACKUP)\s*$/iu, '')
|
||||
.trim();
|
||||
@@ -100,10 +99,6 @@ async function operator(proxies) {
|
||||
return proxies.filter(proxy => (
|
||||
typeof proxy.name !== 'string' || !isInfoNode(proxy.name)
|
||||
)).map(proxy => {
|
||||
if (typeof proxy.name !== 'string') {
|
||||
return proxy;
|
||||
}
|
||||
|
||||
const cleanName = utils.stripSubscriptionSuffix(proxy.name, 'YinYun');
|
||||
const { text } = utils.splitLeadingOrInlineFlag(cleanName);
|
||||
const coreName = stripLineType(stripBackupLabel(text));
|
||||
|
||||
Reference in New Issue
Block a user