fix(yinyun-rename): 修复脚本逻辑并简化代码结构
- 移除了多余的数组映射操作 - 简化了代理节点过滤和重命名逻辑 - 优化了备份标签剥离函数的实现 - 统一了节点名称清理和编号处理流程 - 修正了信息节点过滤条件的判断逻辑 - 更新了文档描述以反映功能变更
This commit is contained in:
+1
-1
@@ -163,7 +163,7 @@ https://git.orionc.me/orion/script/raw/branch/main/substore/common.js?v=20260702
|
||||
|
||||
## YinYun 规则
|
||||
|
||||
`yinyun-rename.js` 建议挂在 YinYun 单条订阅里使用。YinYun 的节点名主要由中文地区名、`优选`/数字编号、`(T)`/`(R)` 线路标记和可选 `ᴮᴬᴷ` 备份标签组成;脚本会忽略这些原始线路细节,按地区出现顺序重新连续编号,过滤官网/TG 信息节点,最后再交给全局 `rename.js` 追加订阅后缀。
|
||||
`yinyun-rename.js` 建议挂在 YinYun 单条订阅里使用。YinYun 的节点名主要由中文地区名、`优选`/数字编号、`(T)`/`(R)` 线路标记和可选 `ᴮᴬᴷ` 备份标签组成;脚本会忽略这些原始线路细节,按地区出现顺序重新连续编号,最后再交给全局 `rename.js` 追加订阅后缀。
|
||||
|
||||
```text
|
||||
香港 优选(T)
|
||||
|
||||
@@ -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