fix: codeql

This commit is contained in:
ShareVB committed 2025-01-12 21:39:52 +01:00
1 parent eead4e135f
commit 14e3d8e8ab
2 files changed
+367 -210

No files matched your search

+210 -210
View File
@@ -4,229 +4,229 @@ import { getIPNetworkType, getNetworksCount, getSubnets, parseAsCIDR, to6to4Pref
describe('ipv4/6 util', () => {
describe('parseAsCIDR', () => {
it('returns cidr', () => {
expect(parseAsCIDR('1.1.1.1/6')).to.eql('1.1.1.1/6');
expect(parseAsCIDR('172.16.2.2/16')).to.eql('172.16.2.2/16');
expect(parseAsCIDR('1a:b:c::d:e:f/ffff:ffff:f4ff:ffff:ffff:ff5f:ffff:ff00')).to.eql('');
expect(parseAsCIDR('10.1.2.3/255.255.255.252')).to.eql('10.1.2.0/30');
expect(parseAsCIDR('10.*.0.*')).to.eql('');
expect(parseAsCIDR('10.1.0.*')).to.eql('10.1.0.0/24');
expect(parseAsCIDR('10.2.*.*')).to.eql('10.2.0.0/16');
expect(parseAsCIDR('a:b:0:8000::/ffff:ffff:ffff:8000::')).to.eql('a:b:0:8000::/49');
expect(parseAsCIDR('::/::')).to.eql('::/0');
expect(parseAsCIDR('10.20.30.64-10.20.30.127')).to.eql('10.20.30.64/26');
expect(parseAsCIDR('10.0.128.0/255.0.128.0')).to.eql('');
expect(parseAsCIDR('a::bc:1234/128')).to.eql('a::bc:1234/128');
expect(parseAsCIDR('a::bc:ff00-a::bc:ff0f')).to.eql('a::bc:ff00/124');
expect(parseAsCIDR('10.0.1.1/255.255.1.0')).to.eql('');
expect(parseAsCIDR('10.0.0.0/255.255.0.0')).to.eql('10.0.0.0/16');
expect(parseAsCIDR('1.1.1.1/6')).to.eql('1.1.1.1/6'); // NOSONAR
expect(parseAsCIDR('172.16.2.2/16')).to.eql('172.16.2.2/16'); // NOSONAR
expect(parseAsCIDR('1a:b:c::d:e:f/ffff:ffff:f4ff:ffff:ffff:ff5f:ffff:ff00')).to.eql(''); // NOSONAR
expect(parseAsCIDR('10.1.2.3/255.255.255.252')).to.eql('10.1.2.0/30'); // NOSONAR
expect(parseAsCIDR('10.*.0.*')).to.eql(''); // NOSONAR
expect(parseAsCIDR('10.1.0.*')).to.eql('10.1.0.0/24'); // NOSONAR
expect(parseAsCIDR('10.2.*.*')).to.eql('10.2.0.0/16'); // NOSONAR
expect(parseAsCIDR('a:b:0:8000::/ffff:ffff:ffff:8000::')).to.eql('a:b:0:8000::/49'); // NOSONAR
expect(parseAsCIDR('::/::')).to.eql('::/0'); // NOSONAR
expect(parseAsCIDR('10.20.30.64-10.20.30.127')).to.eql('10.20.30.64/26'); // NOSONAR
expect(parseAsCIDR('10.0.128.0/255.0.128.0')).to.eql(''); // NOSONAR
expect(parseAsCIDR('a::bc:1234/128')).to.eql('a::bc:1234/128'); // NOSONAR
expect(parseAsCIDR('a::bc:ff00-a::bc:ff0f')).to.eql('a::bc:ff00/124'); // NOSONAR
expect(parseAsCIDR('10.0.1.1/255.255.1.0')).to.eql(''); // NOSONAR
expect(parseAsCIDR('10.0.0.0/255.255.0.0')).to.eql('10.0.0.0/16'); // NOSONAR
});
});
}); // NOSONAR
describe('getSubnets', () => {
it('returns subnets', () => {
expect(getSubnets('1.1.1.1/1')).to.eql([
'0.0.0.0/1',
'128.0.0.0/1',
]);
expect(getSubnets('1.1.1.1/6')).to.eql([
'0.0.0.0/6',
'4.0.0.0/6',
'8.0.0.0/6',
'12.0.0.0/6',
'16.0.0.0/6',
'20.0.0.0/6',
'24.0.0.0/6',
'28.0.0.0/6',
'32.0.0.0/6',
'36.0.0.0/6',
'40.0.0.0/6',
'44.0.0.0/6',
'48.0.0.0/6',
'52.0.0.0/6',
'56.0.0.0/6',
'60.0.0.0/6',
'64.0.0.0/6',
'68.0.0.0/6',
'72.0.0.0/6',
'76.0.0.0/6',
'80.0.0.0/6',
'84.0.0.0/6',
'88.0.0.0/6',
'92.0.0.0/6',
'96.0.0.0/6',
'100.0.0.0/6',
'104.0.0.0/6',
'108.0.0.0/6',
'112.0.0.0/6',
'116.0.0.0/6',
'120.0.0.0/6',
'124.0.0.0/6',
'128.0.0.0/6',
'132.0.0.0/6',
'136.0.0.0/6',
'140.0.0.0/6',
'144.0.0.0/6',
'148.0.0.0/6',
'152.0.0.0/6',
'156.0.0.0/6',
'160.0.0.0/6',
'164.0.0.0/6',
'168.0.0.0/6',
'172.0.0.0/6',
'176.0.0.0/6',
'180.0.0.0/6',
'184.0.0.0/6',
'188.0.0.0/6',
'192.0.0.0/6',
'196.0.0.0/6',
'200.0.0.0/6',
'204.0.0.0/6',
'208.0.0.0/6',
'212.0.0.0/6',
'216.0.0.0/6',
'220.0.0.0/6',
'224.0.0.0/6',
'228.0.0.0/6',
'232.0.0.0/6',
'236.0.0.0/6',
'240.0.0.0/6',
'244.0.0.0/6',
'248.0.0.0/6',
'252.0.0.0/6',
]);
expect(getSubnets('1.1.1.1/8')).to.eql([]);
expect(getSubnets('1.1.1.1/11')).to.eql([
'1.0.0.0/11',
'1.32.0.0/11',
'1.64.0.0/11',
'1.96.0.0/11',
'1.128.0.0/11',
'1.160.0.0/11',
'1.192.0.0/11',
'1.224.0.0/11',
]);
expect(getSubnets('172.16.2.2/16')).to.eql([]);
expect(getSubnets('172.16.2.2/26')).to.eql([
'172.16.2.0/26',
'172.16.2.64/26',
'172.16.2.128/26',
'172.16.2.192/26',
]);
expect(getSubnets('172.16.2.2/31').length).to.eql(128);
expect(getSubnets('255.255.255.0/32')).to.eql([]);
expect(getSubnets('2001:db8:0:85a3::ac1f:8001/62')).to.eql([]);
expect(getSubnets('2001:db8:0:85a3:0:0:ac1f:8001/62')).to.eql([]);
expect(getSubnets('2001:db8:0:85a3::ac1f:8001/112')).to.eql([]);
expect(getSubnets('2001:db8:0:85a3:0:0:ac1f:8001/112')).to.eql([]);
});
});
expect(getSubnets('1.1.1.1/1')).to.eql([ // NOSONAR
'0.0.0.0/1', // NOSONAR
'128.0.0.0/1', // NOSONAR
]); // NOSONAR
expect(getSubnets('1.1.1.1/6')).to.eql([ // NOSONAR
'0.0.0.0/6', // NOSONAR
'4.0.0.0/6', // NOSONAR
'8.0.0.0/6', // NOSONAR
'12.0.0.0/6', // NOSONAR
'16.0.0.0/6', // NOSONAR
'20.0.0.0/6', // NOSONAR
'24.0.0.0/6', // NOSONAR
'28.0.0.0/6', // NOSONAR
'32.0.0.0/6', // NOSONAR
'36.0.0.0/6', // NOSONAR
'40.0.0.0/6', // NOSONAR
'44.0.0.0/6', // NOSONAR
'48.0.0.0/6', // NOSONAR
'52.0.0.0/6', // NOSONAR
'56.0.0.0/6', // NOSONAR
'60.0.0.0/6', // NOSONAR
'64.0.0.0/6', // NOSONAR
'68.0.0.0/6', // NOSONAR
'72.0.0.0/6', // NOSONAR
'76.0.0.0/6', // NOSONAR
'80.0.0.0/6', // NOSONAR
'84.0.0.0/6', // NOSONAR
'88.0.0.0/6', // NOSONAR
'92.0.0.0/6', // NOSONAR
'96.0.0.0/6', // NOSONAR
'100.0.0.0/6', // NOSONAR
'104.0.0.0/6', // NOSONAR
'108.0.0.0/6', // NOSONAR
'112.0.0.0/6', // NOSONAR
'116.0.0.0/6', // NOSONAR
'120.0.0.0/6', // NOSONAR
'124.0.0.0/6', // NOSONAR
'128.0.0.0/6', // NOSONAR
'132.0.0.0/6', // NOSONAR
'136.0.0.0/6', // NOSONAR
'140.0.0.0/6', // NOSONAR
'144.0.0.0/6', // NOSONAR
'148.0.0.0/6', // NOSONAR
'152.0.0.0/6', // NOSONAR
'156.0.0.0/6', // NOSONAR
'160.0.0.0/6', // NOSONAR
'164.0.0.0/6', // NOSONAR
'168.0.0.0/6', // NOSONAR
'172.0.0.0/6', // NOSONAR
'176.0.0.0/6', // NOSONAR
'180.0.0.0/6', // NOSONAR
'184.0.0.0/6', // NOSONAR
'188.0.0.0/6', // NOSONAR
'192.0.0.0/6', // NOSONAR
'196.0.0.0/6', // NOSONAR
'200.0.0.0/6', // NOSONAR
'204.0.0.0/6', // NOSONAR
'208.0.0.0/6', // NOSONAR
'212.0.0.0/6', // NOSONAR
'216.0.0.0/6', // NOSONAR
'220.0.0.0/6', // NOSONAR
'224.0.0.0/6', // NOSONAR
'228.0.0.0/6', // NOSONAR
'232.0.0.0/6', // NOSONAR
'236.0.0.0/6', // NOSONAR
'240.0.0.0/6', // NOSONAR
'244.0.0.0/6', // NOSONAR
'248.0.0.0/6', // NOSONAR
'252.0.0.0/6', // NOSONAR
]); // NOSONAR
expect(getSubnets('1.1.1.1/8')).to.eql([]); // NOSONAR
expect(getSubnets('1.1.1.1/11')).to.eql([ // NOSONAR
'1.0.0.0/11', // NOSONAR
'1.32.0.0/11', // NOSONAR
'1.64.0.0/11', // NOSONAR
'1.96.0.0/11', // NOSONAR
'1.128.0.0/11', // NOSONAR
'1.160.0.0/11', // NOSONAR
'1.192.0.0/11', // NOSONAR
'1.224.0.0/11', // NOSONAR
]); // NOSONAR
expect(getSubnets('172.16.2.2/16')).to.eql([]); // NOSONAR
expect(getSubnets('172.16.2.2/26')).to.eql([ // NOSONAR
'172.16.2.0/26', // NOSONAR
'172.16.2.64/26', // NOSONAR
'172.16.2.128/26', // NOSONAR
'172.16.2.192/26', // NOSONAR
]); // NOSONAR
expect(getSubnets('172.16.2.2/31').length).to.eql(128); // NOSONAR
expect(getSubnets('255.255.255.0/32')).to.eql([]); // NOSONAR
expect(getSubnets('2001:db8:0:85a3::ac1f:8001/62')).to.eql([]); // NOSONAR
expect(getSubnets('2001:db8:0:85a3:0:0:ac1f:8001/62')).to.eql([]); // NOSONAR
expect(getSubnets('2001:db8:0:85a3::ac1f:8001/112')).to.eql([]); // NOSONAR
expect(getSubnets('2001:db8:0:85a3:0:0:ac1f:8001/112')).to.eql([]); // NOSONAR
}); // NOSONAR
}); // NOSONAR
describe('getNetworksCount', () => {
it('returns networks count', () => {
expect(getNetworksCount('1.1.1.1/1')).to.eql(2);
expect(getNetworksCount('1.1.1.1/2')).to.eql(4);
expect(getNetworksCount('1.1.1.1/3')).to.eql(8);
expect(getNetworksCount('1.1.1.1/4')).to.eql(16);
expect(getNetworksCount('1.1.1.1/5')).to.eql(32);
expect(getNetworksCount('1.1.1.1/6')).to.eql(64);
expect(getNetworksCount('1.1.1.1/7')).to.eql(128);
expect(getNetworksCount('1.1.1.1/8')).to.eql(0);
expect(getNetworksCount('1.1.1.1/9')).to.eql(2);
expect(getNetworksCount('1.1.1.1/10')).to.eql(4);
expect(getNetworksCount('1.1.1.1/11')).to.eql(8);
expect(getNetworksCount('1.1.1.1/12')).to.eql(16);
expect(getNetworksCount('1.1.1.1/13')).to.eql(32);
expect(getNetworksCount('1.1.1.1/14')).to.eql(64);
expect(getNetworksCount('1.1.1.1/15')).to.eql(128);
expect(getNetworksCount('1.1.1.1/16')).to.eql(0);
expect(getNetworksCount('1.1.1.1/17')).to.eql(2);
expect(getNetworksCount('1.1.1.1/18')).to.eql(4);
expect(getNetworksCount('1.1.1.1/19')).to.eql(8);
expect(getNetworksCount('1.1.1.1/20')).to.eql(16);
expect(getNetworksCount('1.1.1.1/21')).to.eql(32);
expect(getNetworksCount('1.1.1.1/22')).to.eql(64);
expect(getNetworksCount('1.1.1.1/23')).to.eql(128);
expect(getNetworksCount('1.1.1.1/24')).to.eql(0);
expect(getNetworksCount('1.1.1.1/25')).to.eql(2);
expect(getNetworksCount('1.1.1.1/26')).to.eql(4);
expect(getNetworksCount('1.1.1.1/27')).to.eql(8);
expect(getNetworksCount('1.1.1.1/28')).to.eql(16);
expect(getNetworksCount('1.1.1.1/29')).to.eql(32);
expect(getNetworksCount('1.1.1.1/30')).to.eql(64);
expect(getNetworksCount('1.1.1.1/31')).to.eql(128);
expect(getNetworksCount('1.1.1.1/32')).to.eql(0);
expect(getNetworksCount('2001:db8:0:85a3::ac1f:8001/32')).to.eql(4294967296n);
expect(getNetworksCount('2001:db8:0:85a3::ac1f:8001/42')).to.eql(4194304n);
expect(getNetworksCount('2001:db8:0:85a3:0:0:ac1f:8001/62')).to.eql(4n);
expect(getNetworksCount('2001:db8:0:85a3::ac1f:8001/112')).to.eql(-1);
expect(getNetworksCount('2001:db8:0:85a3:0:0:ac1f:8001/122')).to.eql(-1);
});
});
expect(getNetworksCount('1.1.1.1/1')).to.eql(2); // NOSONAR
expect(getNetworksCount('1.1.1.1/2')).to.eql(4); // NOSONAR
expect(getNetworksCount('1.1.1.1/3')).to.eql(8); // NOSONAR
expect(getNetworksCount('1.1.1.1/4')).to.eql(16); // NOSONAR
expect(getNetworksCount('1.1.1.1/5')).to.eql(32); // NOSONAR
expect(getNetworksCount('1.1.1.1/6')).to.eql(64); // NOSONAR
expect(getNetworksCount('1.1.1.1/7')).to.eql(128); // NOSONAR
expect(getNetworksCount('1.1.1.1/8')).to.eql(0); // NOSONAR
expect(getNetworksCount('1.1.1.1/9')).to.eql(2); // NOSONAR
expect(getNetworksCount('1.1.1.1/10')).to.eql(4); // NOSONAR
expect(getNetworksCount('1.1.1.1/11')).to.eql(8); // NOSONAR
expect(getNetworksCount('1.1.1.1/12')).to.eql(16); // NOSONAR
expect(getNetworksCount('1.1.1.1/13')).to.eql(32); // NOSONAR
expect(getNetworksCount('1.1.1.1/14')).to.eql(64); // NOSONAR
expect(getNetworksCount('1.1.1.1/15')).to.eql(128); // NOSONAR
expect(getNetworksCount('1.1.1.1/16')).to.eql(0); // NOSONAR
expect(getNetworksCount('1.1.1.1/17')).to.eql(2); // NOSONAR
expect(getNetworksCount('1.1.1.1/18')).to.eql(4); // NOSONAR
expect(getNetworksCount('1.1.1.1/19')).to.eql(8); // NOSONAR
expect(getNetworksCount('1.1.1.1/20')).to.eql(16); // NOSONAR
expect(getNetworksCount('1.1.1.1/21')).to.eql(32); // NOSONAR
expect(getNetworksCount('1.1.1.1/22')).to.eql(64); // NOSONAR
expect(getNetworksCount('1.1.1.1/23')).to.eql(128); // NOSONAR
expect(getNetworksCount('1.1.1.1/24')).to.eql(0); // NOSONAR
expect(getNetworksCount('1.1.1.1/25')).to.eql(2); // NOSONAR
expect(getNetworksCount('1.1.1.1/26')).to.eql(4); // NOSONAR
expect(getNetworksCount('1.1.1.1/27')).to.eql(8); // NOSONAR
expect(getNetworksCount('1.1.1.1/28')).to.eql(16); // NOSONAR
expect(getNetworksCount('1.1.1.1/29')).to.eql(32); // NOSONAR
expect(getNetworksCount('1.1.1.1/30')).to.eql(64); // NOSONAR
expect(getNetworksCount('1.1.1.1/31')).to.eql(128); // NOSONAR
expect(getNetworksCount('1.1.1.1/32')).to.eql(0); // NOSONAR
expect(getNetworksCount('2001:db8:0:85a3::ac1f:8001/32')).to.eql(4294967296n); // NOSONAR
expect(getNetworksCount('2001:db8:0:85a3::ac1f:8001/42')).to.eql(4194304n); // NOSONAR
expect(getNetworksCount('2001:db8:0:85a3:0:0:ac1f:8001/62')).to.eql(4n); // NOSONAR
expect(getNetworksCount('2001:db8:0:85a3::ac1f:8001/112')).to.eql(-1); // NOSONAR
expect(getNetworksCount('2001:db8:0:85a3:0:0:ac1f:8001/122')).to.eql(-1); // NOSONAR
}); // NOSONAR
}); // NOSONAR
describe('getIPNetworkType', () => {
it('returns network type', () => {
expect(getIPNetworkType('1.1.1.1')).to.eql('Public');
expect(getIPNetworkType('10.10.1.1')).to.eql('Private Use');
expect(getIPNetworkType('172.16.0.1')).to.eql('Private Use');
expect(getIPNetworkType('192.168.1.1')).to.eql('Private Use');
expect(getIPNetworkType('255.255.255.0')).to.eql('Reserved');
expect(getIPNetworkType('224.0.0.1')).to.eql('Multicast');
expect(getIPNetworkType('198.51.100.1')).to.eql('Documentation (TEST-NET-2)');
expect(getIPNetworkType('198.18.0.1')).to.eql('Benchmarking');
expect(getIPNetworkType('169.254.0.1')).to.eql('Link Local');
expect(getIPNetworkType('127.0.0.1')).to.eql('Loopback');
expect(getIPNetworkType('2001:db8:8:4::2')).to.eql('Documentation');
expect(getIPNetworkType('FF02::2')).to.eql('Multicast address');
expect(getIPNetworkType('2345:0425:2CA1:0000:0000:0567:5673:23b5')).to.eql('Public');
expect(getIPNetworkType('fdf8:f53b:82e4::53')).to.eql('Unique-Local');
expect(getIPNetworkType('::ffff:192.0.2.47')).to.eql('IPv4-mapped Address');
expect(getIPNetworkType('::ffff:ac12:0a09')).to.eql('IPv4-mapped Address');
expect(getIPNetworkType('::1')).to.eql('Loopback Address');
expect(getIPNetworkType('fe80::200:5aee:feaa:20a2')).to.eql('Link-Local Unicast');
expect(getIPNetworkType('2001:0002::6c::430')).to.eql('Benchmarking');
expect(getIPNetworkType('2001:0000:4136:e378:8000:63bf:3fff:fdd2')).to.eql('TEREDO');
expect(getIPNetworkType('2002:cb0a:3cdd:1::1')).to.eql('6to4');
expect(getIPNetworkType('ff01:0:0:0:0:0:0:2')).to.eql('Multicast address');
});
});
expect(getIPNetworkType('1.1.1.1')).to.eql('Public'); // NOSONAR
expect(getIPNetworkType('10.10.1.1')).to.eql('Private Use'); // NOSONAR
expect(getIPNetworkType('172.16.0.1')).to.eql('Private Use'); // NOSONAR
expect(getIPNetworkType('192.168.1.1')).to.eql('Private Use'); // NOSONAR
expect(getIPNetworkType('255.255.255.0')).to.eql('Reserved'); // NOSONAR
expect(getIPNetworkType('224.0.0.1')).to.eql('Multicast'); // NOSONAR
expect(getIPNetworkType('198.51.100.1')).to.eql('Documentation (TEST-NET-2)'); // NOSONAR
expect(getIPNetworkType('198.18.0.1')).to.eql('Benchmarking'); // NOSONAR
expect(getIPNetworkType('169.254.0.1')).to.eql('Link Local'); // NOSONAR
expect(getIPNetworkType('127.0.0.1')).to.eql('Loopback'); // NOSONAR
expect(getIPNetworkType('2001:db8:8:4::2')).to.eql('Documentation'); // NOSONAR
expect(getIPNetworkType('FF02::2')).to.eql('Multicast address'); // NOSONAR
expect(getIPNetworkType('2345:0425:2CA1:0000:0000:0567:5673:23b5')).to.eql('Public'); // NOSONAR
expect(getIPNetworkType('fdf8:f53b:82e4::53')).to.eql('Unique-Local'); // NOSONAR
expect(getIPNetworkType('::ffff:192.0.2.47')).to.eql('IPv4-mapped Address'); // NOSONAR
expect(getIPNetworkType('::ffff:ac12:0a09')).to.eql('IPv4-mapped Address'); // NOSONAR
expect(getIPNetworkType('::1')).to.eql('Loopback Address'); // NOSONAR
expect(getIPNetworkType('fe80::200:5aee:feaa:20a2')).to.eql('Link-Local Unicast'); // NOSONAR
expect(getIPNetworkType('2001:0002::6c::430')).to.eql('Benchmarking'); // NOSONAR
expect(getIPNetworkType('2001:0000:4136:e378:8000:63bf:3fff:fdd2')).to.eql('TEREDO'); // NOSONAR
expect(getIPNetworkType('2002:cb0a:3cdd:1::1')).to.eql('6to4'); // NOSONAR
expect(getIPNetworkType('ff01:0:0:0:0:0:0:2')).to.eql('Multicast address'); // NOSONAR
}); // NOSONAR
}); // NOSONAR
describe('toARPA', () => {
it('returns ARPA address', () => {
expect(toARPA('1.1.1.1')).to.eql('1.1.1.1.in-addr.arpa');
expect(toARPA('10.10.1.1')).to.eql('1.1.10.10.in-addr.arpa');
expect(toARPA('192.168.1.1')).to.eql('1.1.168.192.in-addr.arpa');
expect(toARPA('255.255.255.0')).to.eql('0.255.255.255.in-addr.arpa');
expect(toARPA('FF02::2')).to.eql('2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.f.f.ip6.arpa.');
expect(toARPA('2345:0425:2CA1:0000:0000:0567:5673:23b5')).to.eql('5.b.3.2.3.7.6.5.7.6.5.0.0.0.0.0.0.0.0.0.1.a.c.2.5.2.4.0.5.4.3.2.ip6.arpa.');
expect(toARPA('fdf8:f53b:82e4::53')).to.eql('3.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.4.e.2.8.b.3.5.f.8.f.d.f.ip6.arpa.');
expect(toARPA('::ffff:192.0.2.47')).to.eql('f.2.2.0.0.0.0.c.f.f.f.f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.');
expect(toARPA('::1')).to.eql('1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.');
});
});
expect(toARPA('1.1.1.1')).to.eql('1.1.1.1.in-addr.arpa'); // NOSONAR
expect(toARPA('10.10.1.1')).to.eql('1.1.10.10.in-addr.arpa'); // NOSONAR
expect(toARPA('192.168.1.1')).to.eql('1.1.168.192.in-addr.arpa'); // NOSONAR
expect(toARPA('255.255.255.0')).to.eql('0.255.255.255.in-addr.arpa'); // NOSONAR
expect(toARPA('FF02::2')).to.eql('2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.f.f.ip6.arpa.'); // NOSONAR
expect(toARPA('2345:0425:2CA1:0000:0000:0567:5673:23b5')).to.eql('5.b.3.2.3.7.6.5.7.6.5.0.0.0.0.0.0.0.0.0.1.a.c.2.5.2.4.0.5.4.3.2.ip6.arpa.'); // NOSONAR
expect(toARPA('fdf8:f53b:82e4::53')).to.eql('3.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.4.e.2.8.b.3.5.f.8.f.d.f.ip6.arpa.'); // NOSONAR
expect(toARPA('::ffff:192.0.2.47')).to.eql('f.2.2.0.0.0.0.c.f.f.f.f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.'); // NOSONAR
expect(toARPA('::1')).to.eql('1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.'); // NOSONAR
}); // NOSONAR
}); // NOSONAR
describe('toIPv4MappedAddress', () => {
it('returns IPv4MappedAddress', () => {
expect(toIPv4MappedAddress('1.1.1.1')).to.eql('::ffff:0101:0101');
expect(toIPv4MappedAddress('10.10.1.1')).to.eql('::ffff:0a0a:0101');
expect(toIPv4MappedAddress('172.18.10.9')).to.eql('::ffff:ac12:0a09');
expect(toIPv4MappedAddress('192.168.1.1')).to.eql('::ffff:c0a8:0101');
expect(toIPv4MappedAddress('255.255.255.0')).to.eql('::ffff:ffff:ff00');
});
});
expect(toIPv4MappedAddress('1.1.1.1')).to.eql('::ffff:0101:0101'); // NOSONAR
expect(toIPv4MappedAddress('10.10.1.1')).to.eql('::ffff:0a0a:0101'); // NOSONAR
expect(toIPv4MappedAddress('172.18.10.9')).to.eql('::ffff:ac12:0a09'); // NOSONAR
expect(toIPv4MappedAddress('192.168.1.1')).to.eql('::ffff:c0a8:0101'); // NOSONAR
expect(toIPv4MappedAddress('255.255.255.0')).to.eql('::ffff:ffff:ff00'); // NOSONAR
}); // NOSONAR
}); // NOSONAR
describe('toIPv4MappedAddressDecimal', () => {
it('returns networks count', () => {
expect(toIPv4MappedAddressDecimal('1.1.1.1')).to.eql('::ffff:1.1.1.1');
expect(toIPv4MappedAddressDecimal('10.10.1.1')).to.eql('::ffff:10.10.1.1');
expect(toIPv4MappedAddressDecimal('192.168.1.1')).to.eql('::ffff:192.168.1.1');
expect(toIPv4MappedAddressDecimal('172.18.10.9')).to.eql('::ffff:172.18.10.9');
expect(toIPv4MappedAddressDecimal('255.255.255.0')).to.eql('::ffff:255.255.255.0');
expect(toIPv4MappedAddressDecimal('2001:db8:0:85a3::ac1f:8001')).to.eql('');
});
});
expect(toIPv4MappedAddressDecimal('1.1.1.1')).to.eql('::ffff:1.1.1.1'); // NOSONAR
expect(toIPv4MappedAddressDecimal('10.10.1.1')).to.eql('::ffff:10.10.1.1'); // NOSONAR
expect(toIPv4MappedAddressDecimal('192.168.1.1')).to.eql('::ffff:192.168.1.1'); // NOSONAR
expect(toIPv4MappedAddressDecimal('172.18.10.9')).to.eql('::ffff:172.18.10.9'); // NOSONAR
expect(toIPv4MappedAddressDecimal('255.255.255.0')).to.eql('::ffff:255.255.255.0'); // NOSONAR
expect(toIPv4MappedAddressDecimal('2001:db8:0:85a3::ac1f:8001')).to.eql(''); // NOSONAR
}); // NOSONAR
}); // NOSONAR
describe('to6to4Prefix', () => {
it('returns networks count', () => {
expect(to6to4Prefix('1.1.1.1')).to.eql('2002:01:0:1:01:01::/48');
expect(to6to4Prefix('10.10.1.1')).to.eql('2002:0a:0:a:01:01::/48');
expect(to6to4Prefix('172.18.10.9')).to.eql('2002:ac:1:2:0a:09::/48');
expect(to6to4Prefix('192.168.1.1')).to.eql('2002:c0:a:8:01:01::/48');
expect(to6to4Prefix('255.255.255.0')).to.eql('2002:ff:f:f:ff:00::/48');
expect(to6to4Prefix('2001:db8:0:85a3::ac1f:8001')).to.eql('');
});
});
});
expect(to6to4Prefix('1.1.1.1')).to.eql('2002:01:0:1:01:01::/48'); // NOSONAR
expect(to6to4Prefix('10.10.1.1')).to.eql('2002:0a:0:a:01:01::/48'); // NOSONAR
expect(to6to4Prefix('172.18.10.9')).to.eql('2002:ac:1:2:0a:09::/48'); // NOSONAR
expect(to6to4Prefix('192.168.1.1')).to.eql('2002:c0:a:8:01:01::/48'); // NOSONAR
expect(to6to4Prefix('255.255.255.0')).to.eql('2002:ff:f:f:ff:00::/48'); // NOSONAR
expect(to6to4Prefix('2001:db8:0:85a3::ac1f:8001')).to.eql(''); // NOSONAR
}); // NOSONAR
}); // NOSONAR
}); // NOSONAR
@@ -0,0 +1,157 @@
// vite.config.ts
import { URL, fileURLToPath } from "node:url";
import { resolve } from "node:path";
import { nodePolyfills } from "file:///home/sharevb/it-tools/node_modules/.pnpm/vite-plugin-node-polyfills@0.22.0_rollup@2.79.2_vite@4.4.9/node_modules/vite-plugin-node-polyfills/dist/index.js";
import { defineConfig } from "file:///home/sharevb/it-tools/node_modules/.pnpm/vite@4.4.9_@types+node@18.15.11_less@4.1.3/node_modules/vite/dist/node/index.js";
import vue from "file:///home/sharevb/it-tools/node_modules/.pnpm/@vitejs+plugin-vue@4.3.2_vite@4.4.9_vue@3.3.4/node_modules/@vitejs/plugin-vue/dist/index.mjs";
import vueJsx from "file:///home/sharevb/it-tools/node_modules/.pnpm/@vitejs+plugin-vue-jsx@3.0.2_vite@4.4.9_vue@3.3.4/node_modules/@vitejs/plugin-vue-jsx/dist/index.mjs";
import markdown from "file:///home/sharevb/it-tools/node_modules/.pnpm/vite-plugin-vue-markdown@0.23.5_rollup@2.79.2_vite@4.4.9/node_modules/vite-plugin-vue-markdown/dist/index.mjs";
import svgLoader from "file:///home/sharevb/it-tools/node_modules/.pnpm/vite-svg-loader@4.0.0/node_modules/vite-svg-loader/index.js";
import { VitePWA } from "file:///home/sharevb/it-tools/node_modules/.pnpm/vite-plugin-pwa@0.16.0_vite@4.4.9_workbox-build@7.3.0_workbox-window@7.0.0/node_modules/vite-plugin-pwa/dist/index.js";
import AutoImport from "file:///home/sharevb/it-tools/node_modules/.pnpm/unplugin-auto-import@0.16.4_@vueuse+core@10.11.1_rollup@2.79.2/node_modules/unplugin-auto-import/dist/vite.js";
import Components from "file:///home/sharevb/it-tools/node_modules/.pnpm/unplugin-vue-components@0.25.0_rollup@2.79.2_vue@3.3.4/node_modules/unplugin-vue-components/dist/vite.mjs";
import { NaiveUiResolver } from "file:///home/sharevb/it-tools/node_modules/.pnpm/unplugin-vue-components@0.25.0_rollup@2.79.2_vue@3.3.4/node_modules/unplugin-vue-components/dist/resolvers.mjs";
import Unocss from "file:///home/sharevb/it-tools/node_modules/.pnpm/unocss@0.57.7_postcss@8.4.49_rollup@2.79.2_vite@4.4.9/node_modules/unocss/dist/vite.mjs";
import { configDefaults } from "file:///home/sharevb/it-tools/node_modules/.pnpm/vitest@0.34.0_jsdom@22.0.0_less@4.1.3/node_modules/vitest/dist/config.js";
import Icons from "file:///home/sharevb/it-tools/node_modules/.pnpm/unplugin-icons@0.17.0_@vue+compiler-sfc@3.2.47/node_modules/unplugin-icons/dist/vite.mjs";
import IconsResolver from "file:///home/sharevb/it-tools/node_modules/.pnpm/unplugin-icons@0.17.0_@vue+compiler-sfc@3.2.47/node_modules/unplugin-icons/dist/resolver.mjs";
import VueI18n from "file:///home/sharevb/it-tools/node_modules/.pnpm/@intlify+unplugin-vue-i18n@0.13.0_rollup@2.79.2_vue-i18n@9.14.2/node_modules/@intlify/unplugin-vue-i18n/lib/vite.mjs";
var __vite_injected_original_dirname = "/home/sharevb/it-tools";
var __vite_injected_original_import_meta_url = "file:///home/sharevb/it-tools/vite.config.ts";
var baseUrl = process.env.BASE_URL ?? "/";
var vite_config_default = defineConfig({
plugins: [
VueI18n({
runtimeOnly: true,
compositionOnly: true,
fullInstall: true,
include: [resolve(__vite_injected_original_dirname, "locales/**")],
strictMessage: false,
escapeHtml: true
}),
AutoImport({
imports: [
"vue",
"vue-router",
"@vueuse/core",
"vue-i18n",
{
"naive-ui": ["useDialog", "useMessage", "useNotification", "useLoadingBar"]
}
],
vueTemplate: true,
eslintrc: {
enabled: true
}
}),
Icons({ compiler: "vue3" }),
vue({
include: [/\.vue$/, /\.md$/]
}),
vueJsx(),
markdown(),
svgLoader(),
VitePWA({
registerType: "autoUpdate",
strategies: "generateSW",
manifest: {
name: "IT Tools",
description: "Aggregated set of useful tools for developers.",
display: "standalone",
lang: "fr-FR",
start_url: `${baseUrl}?utm_source=pwa&utm_medium=pwa`,
orientation: "any",
theme_color: "#18a058",
background_color: "#f1f5f9",
icons: [
{
src: "/favicon-16x16.png",
type: "image/png",
sizes: "16x16"
},
{
src: "/favicon-32x32.png",
type: "image/png",
sizes: "32x32"
},
{
src: "/android-chrome-192x192.png",
sizes: "192x192",
type: "image/png"
},
{
src: "/android-chrome-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "any maskable"
}
]
}
}),
Components({
dirs: ["src/"],
extensions: ["vue", "md"],
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
resolvers: [NaiveUiResolver(), IconsResolver({ prefix: "icon" })]
}),
Unocss(),
nodePolyfills()
],
base: baseUrl,
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", __vite_injected_original_import_meta_url)),
"node:fs/promises": fileURLToPath(new URL("./src/_empty.ts", __vite_injected_original_import_meta_url)),
"node:fs": fileURLToPath(new URL("./src/_empty.ts", __vite_injected_original_import_meta_url)),
"fs": fileURLToPath(new URL("./src/_empty.ts", __vite_injected_original_import_meta_url)),
"@babel/core": fileURLToPath(new URL("./src/_empty.ts", __vite_injected_original_import_meta_url)),
"isolated-vm": fileURLToPath(new URL("./src/_empty.ts", __vite_injected_original_import_meta_url))
}
},
define: {
"import.meta.env.PACKAGE_VERSION": JSON.stringify(process.env.npm_package_version)
},
test: {
exclude: [...configDefaults.exclude, "**/*.e2e.spec.ts"]
},
build: {
target: "esnext",
// sourcemap: false,
minify: !process.env.VERCEL,
// cssMinify: false,
rollupOptions: {
external: ["node:fs/promises", "regex", "./out/isolated_vm", "isolated-vm"],
output: {
format: "es",
manualChunks: (id) => {
if (id.includes("monaco-editor"))
return "monaco-editor";
if (id.includes("tesseract.js"))
return "tesseract.js";
if (id.includes("pdfjs"))
return "pdfjs";
if (id.includes("unicode"))
return "unicode";
},
sourcemapIgnoreList: (relativeSourcePath) => {
const normalizedPath = path.normalize(relativeSourcePath);
return normalizedPath.includes("node_modules");
}
},
cache: false
}
},
optimizeDeps: {
include: ["re2-wasm-embedded", "isolated-vm", "pdfjs-dist"],
// optionally specify dependency name
esbuildOptions: {
supported: {
"top-level-await": true
}
}
}
});
export {
vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCIvaG9tZS9zaGFyZXZiL2l0LXRvb2xzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ZpbGVuYW1lID0gXCIvaG9tZS9zaGFyZXZiL2l0LXRvb2xzL3ZpdGUuY29uZmlnLnRzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9ob21lL3NoYXJldmIvaXQtdG9vbHMvdml0ZS5jb25maWcudHNcIjtpbXBvcnQgeyBVUkwsIGZpbGVVUkxUb1BhdGggfSBmcm9tICdub2RlOnVybCc7XG5pbXBvcnQgeyByZXNvbHZlIH0g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XRlZ2llczogJ2dlbmVyYXRlU1cnLFxuICAgICAgbWFuaWZlc3Q6IHtcbiAgICAgICAgbmFtZTogJ0lUIFRvb2xzJyxcbiAgICAgICAgZGVzY3JpcHRpb246ICdBZ2dyZWdhdGVkIHNldCBvZiB1c2VmdWwgdG9vbHMgZm9yIGRldmVsb3BlcnMuJyxcbiAgICAgICAgZGlzcGxheTogJ3N0YW5kYWxvbmUnLFxuICAgICAgICBsYW5nOiAnZnItRlInLFxuICAgICAgICBzdGFydF91cmw6IGAke2Jhc2VVcmx9P3V0bV9zb3VyY2U9cHdhJnV0bV9tZWRpdW09cHdhYCxcbiAgICAgICAgb3JpZW50YXRpb246ICdhbnknLFxuICAgICAgICB0aGVtZV9jb2xvcjogJyMxOGEwNTgnLFxuICAgICAgICBiYWNrZ3JvdW5kX2NvbG9yOiAnI2YxZjVmOScsXG4gICAgICAgIGljb25zOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgc3JjOiAnL2Zhdmljb24tMTZ4MTYucG5nJyxcbiAgICAgICAgICAgIHR5cGU6ICdpbWFnZS9wbmcnLFxuICAgICAgICAgICAgc2l6ZXM6ICcxNngxNicsXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBzcmM6ICcvZmF2aWNvbi0zMngzMi5wbmcnLFxuICAgICAgICAgICAgdHlwZTogJ2ltYWdlL3BuZycsXG4gICAgICAgICAgICBzaXplczogJzMyeDMyJyxcbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIHNyYzogJy9hbmRyb2lkLWNocm9tZS0xOTJ4MTkyLnBuZycsXG4gICAgICAgICAgICBzaXplczogJzE5MngxOTInLFxuICAgICAgICAgICAgdHlwZTogJ2ltYWdlL3BuZycsXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBzcmM6ICcvYW5kcm9pZC1jaHJvbWUtNTEyeDUxMi5wbmcnLFxuICAgICAgICAgICAgc2l6ZXM6ICc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