From 9b2d2c65caf9959ecc18587ced101c990625d2c4 Mon Sep 17 00:00:00 2001 From: Michael Rowley Date: Thu, 30 Dec 2021 01:54:20 +0000 Subject: [PATCH] Fixed errors --- src/core/lib/IP.mjs | 2 +- src/core/operations/Sort.mjs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/lib/IP.mjs b/src/core/lib/IP.mjs index 350bca7a..e5d18dd7 100644 --- a/src/core/lib/IP.mjs +++ b/src/core/lib/IP.mjs @@ -355,7 +355,7 @@ export function strToIpv6(ipStr, retArr=true) { if (ipStr.length % 2 === 1) { ipStr = "0" + ipStr; } - return BigInt("0x" + ipStr.replace(":", "")); + return Number("0x" + ipStr.replace(":", "")); } let j = 0; const blocks = ipStr.split(":"), diff --git a/src/core/operations/Sort.mjs b/src/core/operations/Sort.mjs index 354a01ed..da7ded80 100644 --- a/src/core/operations/Sort.mjs +++ b/src/core/operations/Sort.mjs @@ -116,8 +116,7 @@ class Sort extends Operation { */ static _ipv6Sort(a, b) { const ipLib = require("../lib/IP.mjs"); - const numericalA = ipLib.strToIpv6(a, false), - numericalB = ipLib.strToIpv6(b, false); + const numericalA = ipLib.strToIpv6(a, false), numericalB = ipLib.strToIpv6(b, false); return numericalA < numericalB ? -1 : 1; }