feat: 当节点端口号为合法端口号时, 将类型转为整数(便于脚本判断)

This commit is contained in:
xream
2023-12-23 21:02:39 +08:00
parent 5ac73b863a
commit 36db057e32
3 changed files with 20 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
import download from '@/utils/download';
import { isIPv4, isIPv6 } from '@/utils';
import { isIPv4, isIPv6, isValidPortNumber } from '@/utils';
import PROXY_PROCESSORS, { ApplyProcessor } from './processors';
import PROXY_PREPROCESSORS from './preprocessors';
import PROXY_PRODUCERS from './producers';
@@ -214,6 +214,9 @@ function safeMatch(parser, line) {
}
function lastParse(proxy) {
if (isValidPortNumber(proxy.port)) {
proxy.port = parseInt(proxy.port, 10);
}
if (proxy.server) {
proxy.server = proxy.server
.trim()