Sub-Store 节点按延迟排序
1. 先自己按需配置 节点测活(完善版)
2. 然后加入排序逻辑(随便写的, 延迟从小到大)
function operator(proxies) {
const withLatency = proxies.filter(p => p._latency !== undefined)
const withoutLatency = proxies.filter(p => p._latency === undefined)
withLatency.sort((a, b) => Number(a._latency) - Number(b._latency))
return [...withLatency, ...withoutLatency]
}
🤭 Sub-Store 合集 🧐 频道资源合集 😄 恰饭推荐 💬 群组
🥰 #SubStore #Sub-Store #小课堂 #tips #排序 #节点 #延迟 #延迟排序
1. 先自己按需配置 节点测活(完善版)
2. 然后加入排序逻辑(随便写的, 延迟从小到大)
function operator(proxies) {
const withLatency = proxies.filter(p => p._latency !== undefined)
const withoutLatency = proxies.filter(p => p._latency === undefined)
withLatency.sort((a, b) => Number(a._latency) - Number(b._latency))
return [...withLatency, ...withoutLatency]
}
🤭 Sub-Store 合集 🧐 频道资源合集 😄 恰饭推荐 💬 群组
🥰 #SubStore #Sub-Store #小课堂 #tips #排序 #节点 #延迟 #延迟排序