aboutsummaryrefslogtreecommitdiff
path: root/src/tools/ipv4-range-expander/ipv4-range-expander.service.ts
diff options
context:
space:
mode:
authorGravatar renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> 2023-08-21 18:27:08 +0000
committerGravatar GitHub <noreply@github.com> 2023-08-21 18:27:08 +0000
commit6ff9a01cc841b9d15c9ccaea4790746b9de2cb4b (patch)
tree01aca2b6077c897f46aa0d66078c81832078738a /src/tools/ipv4-range-expander/ipv4-range-expander.service.ts
parenta2b9b157e5b8dd725afd8ed78710bca7deb7e31d (diff)
downloadit-tools-6ff9a01cc841b9d15c9ccaea4790746b9de2cb4b.tar.gz
it-tools-6ff9a01cc841b9d15c9ccaea4790746b9de2cb4b.tar.zst
it-tools-6ff9a01cc841b9d15c9ccaea4790746b9de2cb4b.zip
chore(deps): update dependency @antfu/eslint-config to ^0.40.0 (#552)
* chore(deps): update dependency @antfu/eslint-config to ^0.40.0 * chore(deps): updated eslint --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Corentin Thomasset <corentin.thomasset74@gmail.com>
Diffstat (limited to 'src/tools/ipv4-range-expander/ipv4-range-expander.service.ts')
-rw-r--r--src/tools/ipv4-range-expander/ipv4-range-expander.service.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/ipv4-range-expander/ipv4-range-expander.service.ts b/src/tools/ipv4-range-expander/ipv4-range-expander.service.ts
index 78fbde5..14761f5 100644
--- a/src/tools/ipv4-range-expander/ipv4-range-expander.service.ts
+++ b/src/tools/ipv4-range-expander/ipv4-range-expander.service.ts
@@ -13,7 +13,7 @@ function getRangesize(start: string, end: string) {
return -1;
}
- return 1 + parseInt(end, 2) - parseInt(start, 2);
+ return 1 + Number.parseInt(end, 2) - Number.parseInt(start, 2);
}
function getCidr(start: string, end: string) {
@@ -55,8 +55,8 @@ function calculateCidr({ startIp, endIp }: { startIp: string; endIp: string }) {
const cidr = getCidr(start, end);
if (cidr != null) {
const result: Ipv4RangeExpanderResult = {};
- result.newEnd = bits2ip(parseInt(cidr.end, 2));
- result.newStart = bits2ip(parseInt(cidr.start, 2));
+ result.newEnd = bits2ip(Number.parseInt(cidr.end, 2));
+ result.newStart = bits2ip(Number.parseInt(cidr.start, 2));
result.newCidr = `${result.newStart}/${cidr.mask}`;
result.newSize = getRangesize(cidr.start, cidr.end);