mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
net: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36303 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
5f1bf80b5e
commit
0869b829fa
2 changed files with 18 additions and 12 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
const {
|
||||
RegExp,
|
||||
RegExpPrototypeTest,
|
||||
Symbol,
|
||||
} = primordials;
|
||||
|
||||
|
@ -28,11 +29,11 @@ const IPv6Reg = new RegExp('^(' +
|
|||
')(%[0-9a-zA-Z-.:]{1,})?$');
|
||||
|
||||
function isIPv4(s) {
|
||||
return IPv4Reg.test(s);
|
||||
return RegExpPrototypeTest(IPv4Reg, s);
|
||||
}
|
||||
|
||||
function isIPv6(s) {
|
||||
return IPv6Reg.test(s);
|
||||
return RegExpPrototypeTest(IPv6Reg, s);
|
||||
}
|
||||
|
||||
function isIP(s) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue