Skip to content

Commit

Permalink
lint: change variable name style for constants
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Aug 7, 2017
1 parent e39b22c commit 5e4e076
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var ipaddr = require('ipaddr.js')
* @private
*/

var digitre = /^[0-9]+$/
var DIGIT_REGEXP = /^[0-9]+$/
var isip = ipaddr.isValid
var parseip = ipaddr.parse

Expand All @@ -37,7 +37,7 @@ var parseip = ipaddr.parse
* @private
*/

var ipranges = {
var IP_RANGES = {
linklocal: ['169.254.0.0/16', 'fe80::/10'],
loopback: ['127.0.0.1/8', '::1/128'],
uniquelocal: ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16', 'fc00::/7']
Expand Down Expand Up @@ -99,12 +99,12 @@ function compile (val) {
for (var i = 0; i < trust.length; i++) {
val = trust[i]

if (!ipranges.hasOwnProperty(val)) {
if (!IP_RANGES.hasOwnProperty(val)) {
continue
}

// Splice in pre-defined range
val = ipranges[val]
val = IP_RANGES[val]
trust.splice.apply(trust, [i, 1].concat(val))
i += val.length - 1
}
Expand Down Expand Up @@ -180,7 +180,7 @@ function parseipNotation (note) {

if (range === null) {
range = max
} else if (digitre.test(range)) {
} else if (DIGIT_REGEXP.test(range)) {
range = parseInt(range, 10)
} else if (ip.kind() === 'ipv4' && isip(range)) {
range = parseNetmask(range)
Expand Down

0 comments on commit 5e4e076

Please sign in to comment.