WIP ESLint fixes
This commit is contained in:
@ -44,7 +44,7 @@ export function IPInputWithMask(p: {
|
||||
return;
|
||||
}
|
||||
|
||||
const split = v?.split("/");
|
||||
const split = v.split("/");
|
||||
const ip =
|
||||
p.version === 4 ? sanitizeIpV4(split[0]) : sanitizeIpV6(split[0]);
|
||||
let mask = undefined;
|
||||
@ -69,7 +69,7 @@ export function IPInputWithMask(p: {
|
||||
function sanitizeIpV4(s: string | undefined): string | undefined {
|
||||
if (s === "" || s === undefined) return s;
|
||||
|
||||
let split = s.split(".");
|
||||
const split = s.split(".");
|
||||
if (split.length > 4) split.splice(4);
|
||||
|
||||
let needAnotherIteration = false;
|
||||
@ -106,7 +106,7 @@ function sanitizeIpV6(s: string | undefined): string | undefined {
|
||||
const num = parseInt(e, 16);
|
||||
if (isNaN(num)) return "0";
|
||||
|
||||
let s = num.toString(16);
|
||||
const s = num.toString(16);
|
||||
if (num > 0xffff) {
|
||||
needAnotherIteration = true;
|
||||
return s.slice(0, 4) + ":" + s.slice(4);
|
||||
|
Reference in New Issue
Block a user