Comparing version 0.4.5 to 0.4.6
@@ -34,5 +34,5 @@ const EARTH_DIAMETER = 2 * 6378.2; | ||
// Find the great circle distance | ||
temp = Math.pow(Math.sin(deltaLat/2),2) + Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(deltaLon/2), 2); | ||
return Math.round(EARTH_DIAMETER * Math.atan2(Math.sqrt(temp), Math.sqrt(1-temp)) * 1e6) / 1e6; | ||
temp = Math.pow(Math.sin(deltaLat / 2), 2) + Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(deltaLon / 2), 2); | ||
return Math.round(EARTH_DIAMETER * Math.atan2(Math.sqrt(temp), Math.sqrt(1 - temp)) * 1e6) / 1e6; | ||
}; | ||
}; |
@@ -8,3 +8,3 @@ var _data = require('./data/time_zone_data'); | ||
var country = _data[country]; | ||
return country ? country[region || ''] : null; | ||
return country ? country[region] || country[''] : null; | ||
}; |
{ | ||
"name": "maxmind", | ||
"version": "0.4.5", | ||
"version": "0.4.6", | ||
"homepage": "https://github.com/runk/node-maxmind", | ||
@@ -9,8 +9,9 @@ "description": "IP lookup using Maxmind databases", | ||
"contributors": [ | ||
"Thomas Birke @quafzi <quafzi@netextreme.de>" | ||
"Thomas Birke @quafzi <quafzi@netextreme.de>", | ||
"Afzaal Ameer @afzaalace" | ||
], | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"mocha": ">= 1.10.0", | ||
"jshint": ">= 2.1.3", | ||
"mocha": "latest", | ||
"jshint": "latest", | ||
"istanbul": "latest" | ||
@@ -17,0 +18,0 @@ }, |
@@ -217,3 +217,3 @@ var assert = require('assert'), | ||
it('should work fine', function() { | ||
assert.equal(ls.getOrganization('89.66.148.0'), 'Cable/DSL'); | ||
assert.equal(ls.getNetSpeed('89.66.148.0'), 'Cable/DSL'); | ||
}); | ||
@@ -220,0 +220,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
191111
7445