Fixed compilation errors

This commit is contained in:
Michael Rowley 2021-12-30 14:37:33 +00:00
parent ea8acc6035
commit 05f51b30d0

View file

@ -398,11 +398,11 @@ export function strToIpv6(ipStr, retArr=true) {
export function expandIpv6(ipStr) { export function expandIpv6(ipStr) {
const compactIndex = ipStr.search("::"); const compactIndex = ipStr.search("::");
let expandedStr = ipStr.substring(0, compactIndex); // 1234:5678::.. let expandedStr = ipStr.substring(0, compactIndex); // 1234:5678::..
const insertOffset = compactIndex == 0; const insertOffset = compactIndex === 0; // 0 / 1
const ipEnd = ipStr.substring(compactIndex + 1); // :7ABC:DEFG:... const ipEnd = ipStr.substring(compactIndex + 1); // :7ABC:DEFG:...
const missingChars = 39 - (expandedStr.length + ipEnd.length); const missingChars = 39 - (expandedStr.length + ipEnd.length);
for (let i = insertOffset; i < missingChars + insertOffset; i++) { for (let i = insertOffset; i < missingChars + insertOffset; i++) {
if (i % 5 == 0) { if (i % 5 === 0) {
expandedStr += ":"; expandedStr += ":";
continue; continue;
} }