29 lines
1.1 KiB
JavaScript
29 lines
1.1 KiB
JavaScript
/**
|
|
* 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*/gi, '')
|
|
.replace(/\s*\|\s*合适下载使用\s*-\s*(\d+(?:\.\d+)?)倍/gi, ' $1x')
|
|
.replace(/\s*\|\s*合适下载使用/gi, '')
|
|
.replace(/\s*\|\s*避免晚高峰使用/gi, '')
|
|
.replace(/\s*\|\s*(?:电信联通移动|电信联通|移动联通|三网)推荐(?:\s*-\s*hy2)?/gi, '')
|
|
.replace(/\s*\|\s*高速专线(?:推荐)?(?:\s*-\s*hy2)?/gi, '')
|
|
.replace(/-\s*(\d+(?:\.\d+)?)倍/gi, ' $1x')
|
|
.replace(/(\d+(?:\.\d+)?)倍/gi, '$1x')
|
|
.replace(/\s*\[(?:专线|移联|电联|三网|HY2)(?:\s+(?:专线|移联|电联|三网|HY2))*\]/gi, '')
|
|
.replace(/\s+\[/g, ' [')
|
|
.replace(/\s{2,}/g, ' ')
|
|
.trim();
|
|
|
|
return proxy;
|
|
});
|
|
}
|