Comparing version 0.3.3 to 0.3.4
@@ -25,3 +25,3 @@ var Database = require('./database'), | ||
for (var i = _dbs.length - 1; i >= 0; i--) { | ||
if (types.indexOf(_dbs[i].type) > -1) | ||
if (~types.indexOf(_dbs[i].type)) | ||
return _dbs[i]; | ||
@@ -36,3 +36,5 @@ } | ||
module.exports.getDb = _getDb; | ||
module.exports.ip2Long = function(ip) { | ||
@@ -145,4 +147,3 @@ ip = ip.split('.', 4); | ||
// shouldn't reach here | ||
return 0; | ||
throw new Error('Should not reach here'); | ||
}; | ||
@@ -149,0 +150,0 @@ |
@@ -27,3 +27,3 @@ var DynBuffer = require('../dyn_buffer'); | ||
return recordBuf.toString('utf8', 0, pointer); | ||
return recordBuf.toString('binary', 0, pointer); | ||
}; |
{ | ||
"name": "maxmind", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"homepage": "https://github.com/runk/node-maxmind", | ||
@@ -5,0 +5,0 @@ "description": "IP lookup using Maxmind databases", |
@@ -147,8 +147,12 @@ var assert = require('assert'), | ||
it('should return ISP by ip', function() { | ||
assert.equal(ls.getOrganization('109.60.171.33'), 'AS47241 CJSC "Ivtelecom"') | ||
assert.equal(ls.getOrganization('64.4.4.4'), 'AS8075 Microsoft Corp') | ||
assert.equal(ls.getOrganization('210.250.100.200'), 'AS2527 So-net Entertainment Corporation') | ||
assert.equal(ls.getOrganization('109.60.171.33'), 'AS47241 CJSC "Ivtelecom"'); | ||
assert.equal(ls.getOrganization('64.4.4.4'), 'AS8075 Microsoft Corp'); | ||
assert.equal(ls.getOrganization('210.250.100.200'), 'AS2527 So-net Entertainment Corporation'); | ||
}); | ||
it('should work fine with utf8', function() { | ||
assert.equal(ls.getOrganization('189.63.71.77'), 'AS28573 Serviços de Comunicação S.A.'); | ||
}); | ||
}); | ||
}); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
7017
0
18396649
40