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
+34
View File
@@ -0,0 +1,34 @@
/**
* PeiQian 专用节点清理脚本
* 负责清理推荐、用途、hy2、倍率等 PeiQian 节点文案。
*/
// noinspection JSUnusedGlobalSymbols
function operator(proxies) {
return proxies.map(proxy => {
if (typeof proxy.name !== 'string') {
return proxy;
}
proxy.name = proxy.name
.replace(/^AWS\s*新加坡\s*/i, '新加坡 AWS ')
.replace(/\s*\|\s*合适下载使用\s*-\s*(\d+(?:\.\d+)?)倍/gi, ' $1x')
.replace(/\s*\|\s*合适下载使用/gi, '')
.replace(/\s*\|\s*避免晚高峰使用/gi, '')
.replace(/\s*\|\s*电信联通移动推荐\s*-\s*hy2/gi, ' [三网 HY2]')
.replace(/\s*\|\s*电信联通移动推荐/gi, ' [三网]')
.replace(/\s*\|\s*电信联通推荐\s*-\s*hy2/gi, ' [电联 HY2]')
.replace(/\s*\|\s*电信联通推荐/gi, ' [电联]')
.replace(/\s*\|\s*移动联通推荐\s*-\s*hy2/gi, ' [移联 HY2]')
.replace(/\s*\|\s*移动联通推荐/gi, ' [移联]')
.replace(/\s*\|\s*高速专线(?:推荐)?\s*-\s*hy2/gi, ' [HY2]')
.replace(/\s*\|\s*高速专线推荐/gi, ' [专线]')
.replace(/\s*\|\s*三网推荐/gi, ' [三网]')
.replace(/-\s*(\d+(?:\.\d+)?)倍/gi, ' $1x')
.replace(/(\d+(?:\.\d+)?)倍/gi, '$1x')
.replace(/\s+\[/g, ' [')
.replace(/\s{2,}/g, ' ')
.trim();
return proxy;
});
}