Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ var rules = {
// regex to check that each octet is valid
var er = /^[0-9]+$/;
// ipv4 octets are delimited by dot
octets = val.split('.');
const octets = val.split('.');
// check 1: ipv4 address should contains 4 octets
if (octets.length != 4)
return false;
Expand Down Expand Up @@ -524,10 +524,10 @@ var rules = {
// regex to check that each hextet is valid
var er = /^[0-9a-f]+$/;
// ipv6 hextets are delimited by colon
hextets = val.split(':');
const hextets = val.split(':');

// check 1: ipv6 should contain only one consecutive colons
colons = val.match(/::/);
const colons = val.match(/::/);
if (colons != null && val.match(/::/g).length > 1)
return false;

Expand Down