Merge branch 'feat/ip-utils' into chore/all-my-stuffs

# Conflicts:
#	package.json
#	src/utils/ip.test.ts
This commit is contained in:
ShareVB committed 2024-11-03 22:53:17 +01:00
commit 57e8f5f8d6
2 files changed
+5 -17

No files matched your search

+1 -2
View File
@@ -5297,7 +5297,7 @@ packages:
/@types/lodash-es@4.17.10:
resolution: {integrity: sha512-YJP+w/2khSBwbUSFdGsSqmDvmnN3cCKoPOL7Zjle6s30ZtemkkqhjVfFqGwPN7ASil5VyjE2GtyU/yqYY6mC0A==}
dependencies:
'@types/lodash': 4.14.200
'@types/lodash': 4.14.192
dev: false
/@types/lodash.defaultsdeep@4.6.9:
@@ -5320,7 +5320,6 @@ packages:
/@types/lodash@4.14.192:
resolution: {integrity: sha512-km+Vyn3BYm5ytMO13k9KTp27O75rbQ0NFw+U//g+PX7VZyjCioXaRFisqSIJRECljcTv73G3i6BpglNGHgUQ5A==}
dev: true
/@types/lodash@4.14.200:
resolution: {integrity: sha512-YI/M/4HRImtNf3pJgbF+W6FrXovqj+T+/HpENLTooK9PnkacBsDpeP3IpHab40CClUfhNmdM2WTNP2sa2dni5Q==}
+4 -15
View File
@@ -1,13 +1,3 @@
// removed test because of SonarQube false positives, but all test pass
import { describe, expect, it } from 'vitest';
describe('parseAsCIDR', () => {
it('returns cidr', () => {
expect(true).to.eql(true);
});
});
/*
import { describe, expect, it } from 'vitest';
import { getIPNetworkType, getNetworksCount, getSubnets, parseAsCIDR, to6to4Prefix, toARPA, toIPv4MappedAddress, toIPv4MappedAddressDecimal } from './ip';
@@ -16,18 +6,18 @@ describe('ipv4/6 util', () => {
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(undefined);
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(undefined);
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(undefined);
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(undefined);
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');
});
});
@@ -240,4 +230,3 @@ describe('ipv4/6 util', () => {
});
});
});
*/