mirror of
https://github.com/certd/certd.git
synced 2026-05-17 05:37:30 +08:00
chore: 补充单元测试
This commit is contained in:
@@ -51,7 +51,10 @@ function isIpv4(d: string) {
|
||||
return false;
|
||||
}
|
||||
const isIPv4Regex = /^(\d{1,3}\.){3}\d{1,3}$/;
|
||||
return isIPv4Regex.test(d);
|
||||
if (!isIPv4Regex.test(d)) {
|
||||
return false;
|
||||
}
|
||||
return d.split(".").every(item => Number(item) <= 255);
|
||||
}
|
||||
|
||||
function isIpv6(d: string) {
|
||||
|
||||
Reference in New Issue
Block a user