mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-24 00:36:14 -04:00
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>
This commit is contained in:
parent
a2b9b157e5
commit
6ff9a01cc8
13 changed files with 349 additions and 409 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue