Permalink
Browse files

Beautifyed and http://www.jshint.com/

  • Loading branch information...
1 parent 56a7444 commit bdf6d326c659f33fb5e2e17ff739f362c343e4a5 @keverw committed May 25, 2012
Showing with 26 additions and 26 deletions.
  1. +26 −26 node_CloudFlare.js
View
@@ -1,9 +1,9 @@
(function ()
{
- var isEmpty = function (obj)
- {
- return Object.keys(obj).length === 0;
- }
+ function isEmpty(obj)
+ {
+ return Object.keys(obj).length === 0;
+ }
var ranges = {};
@@ -34,32 +34,32 @@
else
{
var range_check = require('range_check');
- if (range_check.vaild_ip(ip_address))
- {
- var ip_ver = range_check.ver(ip_address);
- if (ip_ver == 4)
- {
- return range_check.in_range(ip_address, ranges.v4)
- }
- else if (ip_ver == 6)
- {
- return range_check.in_range(ip_address, ranges.v6)
- }
- else
- {
- return false;
- }
- }
- else
- {
- return false;
- }
+ if (range_check.vaild_ip(ip_address))
+ {
+ var ip_ver = range_check.ver(ip_address);
+ if (ip_ver === 4)
+ {
+ return range_check.in_range(ip_address, ranges.v4);
+ }
+ else if (ip_ver === 6)
+ {
+ return range_check.in_range(ip_address, ranges.v6);
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
}
}
function get(req)
{
- var ip_address = (req.connection.remoteAddress ? req.connection.remoteAddress : req.remoteAddress);
+ var ip_address = (req.connection.remoteAddress ? req.connection.remoteAddress : req.remoteAddress);
if (typeof req.headers['cf-connecting-ip'] === 'undefined')
{
return ip_address;
@@ -69,7 +69,7 @@
return req.headers['cf-connecting-ip'];
}
}
-
+
// Export public API
var node_CloudFlare = {};

0 comments on commit bdf6d32

Please sign in to comment.