Show ipv6 with correct in-url syntax (#3776)
This commit is contained in:
parent
e8e2911a92
commit
622b939f00
6 changed files with 16 additions and 10 deletions
|
@ -63,3 +63,7 @@ export function encodePathSegments (path: string): string {
|
|||
export function hashToPath (hash: string): string {
|
||||
return hash.length > 0 ? decodeURIComponent(hash.substr(1)) : '/';
|
||||
}
|
||||
|
||||
export function formatIp (ip: string): string {
|
||||
return /([a-f0-9:]+:+)+[a-f0-9]+/.test(ip) ? `[${ip}]` : ip;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue