| 692 | 692 | } |
| 693 | 693 | } |
| 694 | 694 | |
| 695 | +export function urlHostnameToIPv6(hostname) { |
| 696 | + if (hostname.charAt(0) === '[') { |
| 697 | + hostname = hostname.slice(1); |
| 698 | + } |
| 699 | + if (hostname.charAt(hostname.length - 1) === ']') { |
| 700 | + hostname = hostname.slice(0, -1); |
| 701 | + } |
| 702 | + // console.log(hostname) |
| 703 | + return hostname |
| 704 | +} |
| 705 | + |
| 706 | +export function stringToBool(str) { |
| 707 | + if (str === 'true') return true; |
| 708 | + if (str === 'false') return false; |
| 709 | + return str; |
| 710 | +} |
| 711 | + |
| 695 | 712 | /** |
| 696 | 713 | * MemoryLimitedMap class that limits the memory usage of string values. |
| 697 | 714 | */ |