mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-13 09:26:52 -04:00
chore(lint): switched to a better lint config
This commit is contained in:
parent
4d2b037dbe
commit
33c9b6643f
178 changed files with 4105 additions and 3371 deletions
|
@ -10,7 +10,7 @@ function ipv4ToInt({ ip }: { ip: string }) {
|
|||
return ip
|
||||
.trim()
|
||||
.split('.')
|
||||
.reduce((acc, part, index) => acc + Number(part) * Math.pow(256, 3 - index), 0);
|
||||
.reduce((acc, part, index) => acc + Number(part) * 256 ** (3 - index), 0);
|
||||
}
|
||||
|
||||
function ipv4ToIpv6({ ip, prefix = '0000:0000:0000:0000:0000:ffff:' }: { ip: string; prefix?: string }) {
|
||||
|
@ -19,13 +19,13 @@ function ipv4ToIpv6({ ip, prefix = '0000:0000:0000:0000:0000:ffff:' }: { ip: str
|
|||
}
|
||||
|
||||
return (
|
||||
prefix +
|
||||
_.chain(ip)
|
||||
prefix
|
||||
+ _.chain(ip)
|
||||
.trim()
|
||||
.split('.')
|
||||
.map((part) => parseInt(part).toString(16).padStart(2, '0'))
|
||||
.map(part => parseInt(part).toString(16).padStart(2, '0'))
|
||||
.chunk(2)
|
||||
.map((blocks) => blocks.join(''))
|
||||
.map(blocks => blocks.join(''))
|
||||
.join(':')
|
||||
.value()
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue