fix(yinyun-rename): 修复脚本逻辑并简化代码结构
- 移除了多余的数组映射操作 - 简化了代理节点过滤和重命名逻辑 - 优化了备份标签剥离函数的实现 - 统一了节点名称清理和编号处理流程 - 修正了信息节点过滤条件的判断逻辑 - 更新了文档描述以反映功能变更
This commit is contained in:
@@ -80,7 +80,6 @@ async function operator(proxies) {
|
||||
];
|
||||
const regionResolver = utils.createRegionResolver(regionAliases);
|
||||
|
||||
return proxies.map(proxy => {
|
||||
const stripBackupLabel = name => String(name)
|
||||
.replace(/\s*(?:ᴮᴬᴷ|BAK|BACKUP)\s*$/iu, '')
|
||||
.trim();
|
||||
@@ -96,9 +95,11 @@ async function operator(proxies) {
|
||||
|
||||
const nextSequence = utils.createSequenceCounter();
|
||||
|
||||
return proxies.filter(proxy => (
|
||||
typeof proxy.name !== 'string' || !isInfoNode(proxy.name)
|
||||
)).map(proxy => {
|
||||
return proxies.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