Skip to content

Commit

Permalink
refactor(isIP): removed redundant check for IPv4 addresses
Browse files Browse the repository at this point in the history
refactor(isIP): removed redundant !!

Closes validatorjs#1962
  • Loading branch information
UnKnoWn-Consortium committed May 16, 2022
1 parent ccd2c69 commit df33684
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/isIP.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import assertString from './util/assertString';
* * */
const IPv4SegmentFormat = '(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])';
const IPv4AddressFormat = `(${IPv4SegmentFormat}[.]){3}${IPv4SegmentFormat}`;
const IPv4AddressRegExp = new RegExp(`^\b${IPv4AddressFormat}\b$`);
const IPv4AddressRegExp = new RegExp(`^${IPv4AddressFormat}$`);

const IPv6SegmentFormat = '(?:[0-9a-fA-F]{1,4})';
const IPv6AddressRegExp = new RegExp('^(' +
Expand Down

0 comments on commit df33684

Please sign in to comment.