Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure variables are declared before reference #471

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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