mirror of
https://github.com/viarotel-org/escrcpy.git
synced 2026-06-19 20:27:20 +08:00
perf: ♻️ optimize Codec
This commit is contained in:
@@ -17,8 +17,12 @@ export function isIPWithPort(ip) {
|
||||
return regex.test(ip)
|
||||
}
|
||||
|
||||
export function replaceIP(value, to = '_') {
|
||||
return value.replaceAll('.', to).replaceAll(':', to)
|
||||
export function replaceIP(value) {
|
||||
return value.replaceAll('.', '_').replaceAll(':', '-')
|
||||
}
|
||||
|
||||
export function restoreIP(value) {
|
||||
return value.replaceAll('_', '.').replaceAll('-', ':')
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user