Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wataryooou committed Nov 10, 2024
1 parent bed611f commit 7aaa270
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
13 changes: 1 addition & 12 deletions deno/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -665,18 +665,7 @@ export function datetimeRegex(args: {
return new RegExp(`^${regex}$`);
}

function isValidIP(ip: string, version?: IpVersion, cidr?: boolean) {
if (cidr) {
if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) {
return true;
}
if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) {
return true;
}

return false;
}

function isValidIP(ip: string, version?: IpVersion) {
if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
return true;
}
Expand Down
13 changes: 1 addition & 12 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -665,18 +665,7 @@ export function datetimeRegex(args: {
return new RegExp(`^${regex}$`);
}

function isValidIP(ip: string, version?: IpVersion, cidr?: boolean) {
if (cidr) {
if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) {
return true;
}
if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) {
return true;
}

return false;
}

function isValidIP(ip: string, version?: IpVersion) {
if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
return true;
}
Expand Down

0 comments on commit 7aaa270

Please sign in to comment.