mmdb-lib 1.3.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +2 -2
- package/lib/decoder.js +55 -11
- package/lib/index.d.ts +1 -1
- package/lib/index.js +28 -5
- package/lib/ip.js +5 -2
- package/lib/metadata.js +8 -5
- package/lib/reader/response.d.ts +4 -0
- package/lib/reader/response.js +0 -1
- package/lib/reader/walker.js +2 -3
- package/lib/types.js +0 -1
- package/lib/utils.js +0 -1
- package/package.json +11 -9
- package/lib/decoder.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/ip.js.map +0 -1
- package/lib/metadata.js.map +0 -1
- package/lib/reader/response.js.map +0 -1
- package/lib/reader/walker.js.map +0 -1
- package/lib/types.js.map +0 -1
- package/lib/utils.js.map +0 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -14,12 +14,12 @@ npm i mmdb-lib
|
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
16
|
import fs from 'fs';
|
|
17
|
-
import
|
|
17
|
+
import * as mmdb from 'mmdb-lib';
|
|
18
18
|
|
|
19
19
|
// Get a buffer with mmdb database, from file system or whereever.
|
|
20
20
|
const db = fs.readFileSync('/path/to/GeoLite2-City.mmdb');
|
|
21
21
|
|
|
22
|
-
const reader = new Reader<CityResponse>(db);
|
|
22
|
+
const reader = new mmdb.Reader<CityResponse>(db);
|
|
23
23
|
console.log(reader.get('66.6.44.4')); // inferred type `CityResponse`
|
|
24
24
|
console.log(reader.getWithPrefixLength('66.6.44.4')); // tuple with inferred type `[CityResponse|null, number]`
|
|
25
25
|
```
|
package/lib/decoder.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const assert_1 = __importDefault(require("assert"));
|
|
7
7
|
const utils_1 = __importDefault(require("./utils"));
|
|
8
|
-
assert_1.default(typeof BigInt !== 'undefined', 'Apparently you are using old version of node. Please upgrade to node 10.4.x or above.');
|
|
8
|
+
(0, assert_1.default)(typeof BigInt !== 'undefined', 'Apparently you are using old version of node. Please upgrade to node 10.4.x or above.');
|
|
9
9
|
var DataType;
|
|
10
10
|
(function (DataType) {
|
|
11
11
|
DataType[DataType["Extended"] = 0] = "Extended";
|
|
@@ -34,7 +34,7 @@ const cursor = (value, offset) => ({ value, offset });
|
|
|
34
34
|
class Decoder {
|
|
35
35
|
constructor(db, baseOffset = 0, cache = noCache) {
|
|
36
36
|
this.telemetry = {};
|
|
37
|
-
assert_1.default((this.db = db), 'Database buffer is required');
|
|
37
|
+
(0, assert_1.default)((this.db = db), 'Database buffer is required');
|
|
38
38
|
this.baseOffset = baseOffset;
|
|
39
39
|
this.cache = cache;
|
|
40
40
|
}
|
|
@@ -68,6 +68,15 @@ class Decoder {
|
|
|
68
68
|
}
|
|
69
69
|
decodeByType(type, offset, size) {
|
|
70
70
|
const newOffset = offset + size;
|
|
71
|
+
// ipv4 types occurrence stats:
|
|
72
|
+
// 3618591 x utf8_string
|
|
73
|
+
// 448163 x map
|
|
74
|
+
// 175085 x uint32
|
|
75
|
+
// 83040 x double
|
|
76
|
+
// 24745 x array
|
|
77
|
+
// 3 x uint16
|
|
78
|
+
// 1 x uint64
|
|
79
|
+
// 14 x boolean
|
|
71
80
|
switch (type) {
|
|
72
81
|
case DataType.Utf8String:
|
|
73
82
|
return cursor(this.decodeString(offset, size), newOffset);
|
|
@@ -97,16 +106,37 @@ class Decoder {
|
|
|
97
106
|
throw new Error('Unknown type ' + type + ' at offset ' + offset);
|
|
98
107
|
}
|
|
99
108
|
sizeFromCtrlByte(ctrlByte, offset) {
|
|
109
|
+
// The first three bits of the control byte tell you what type the field is. If
|
|
110
|
+
// these bits are all 0, then this is an "extended" type, which means that the
|
|
111
|
+
// *next* byte contains the actual type. Otherwise, the first three bits will
|
|
112
|
+
// contain a number from 1 to 7, the actual type for the field.
|
|
113
|
+
// var type = ctrlByte >> 3;
|
|
114
|
+
// The next five bits in the control byte tell you how long the data field's
|
|
115
|
+
// payload is, except for maps and pointers. Maps and pointers use this size
|
|
116
|
+
// information a bit differently.``
|
|
100
117
|
const size = ctrlByte & 0x1f;
|
|
118
|
+
// If the five bits are smaller than 29, then those bits are the payload size in
|
|
119
|
+
// bytes. For example:
|
|
120
|
+
// 01000010 UTF-8 string - 2 bytes long
|
|
121
|
+
// 01011100 UTF-8 string - 28 bytes long
|
|
122
|
+
// 11000001 unsigned 32-bit int - 1 byte long
|
|
123
|
+
// 00000011 00000011 unsigned 128-bit int - 3 bytes long
|
|
101
124
|
if (size < 29) {
|
|
102
125
|
return cursor(size, offset);
|
|
103
126
|
}
|
|
127
|
+
// If the value is 29, then the size is 29 + *the next byte after the type
|
|
128
|
+
// specifying bytes as an unsigned integer*.
|
|
104
129
|
if (size === 29) {
|
|
105
130
|
return cursor(29 + this.db[offset], offset + 1);
|
|
106
131
|
}
|
|
132
|
+
// If the value is 30, then the size is 285 + *the next two bytes after the type
|
|
133
|
+
// specifying bytes as a single unsigned integer*.
|
|
107
134
|
if (size === 30) {
|
|
108
|
-
return cursor(285 + this.db.readUInt16BE(offset
|
|
135
|
+
return cursor(285 + this.db.readUInt16BE(offset), offset + 2);
|
|
109
136
|
}
|
|
137
|
+
// At this point `size` is always 31.
|
|
138
|
+
// If the value is 31, then the size is 65,821 + *the next three bytes after the
|
|
139
|
+
// type specifying bytes as a single unsigned integer*.
|
|
110
140
|
return cursor(65821 +
|
|
111
141
|
utils_1.default.concat3(this.db[offset], this.db[offset + 1], this.db[offset + 2]), offset + 3);
|
|
112
142
|
}
|
|
@@ -114,20 +144,36 @@ class Decoder {
|
|
|
114
144
|
return this.db.slice(offset, offset + size);
|
|
115
145
|
}
|
|
116
146
|
decodePointer(ctrlByte, offset) {
|
|
147
|
+
// Pointers use the last five bits in the control byte to calculate the pointer value.
|
|
148
|
+
// To calculate the pointer value, we start by subdividing the five bits into two
|
|
149
|
+
// groups. The first two bits indicate the size, and the next three bits are part
|
|
150
|
+
// of the value, so we end up with a control byte breaking down like this:
|
|
151
|
+
// 001SSVVV.
|
|
117
152
|
const pointerSize = (ctrlByte >> 3) & 3;
|
|
118
153
|
const pointer = this.baseOffset + pointerValueOffset[pointerSize];
|
|
119
154
|
let packed = 0;
|
|
155
|
+
// The size can be 0, 1, 2, or 3.
|
|
156
|
+
// If the size is 0, the pointer is built by appending the next byte to the last
|
|
157
|
+
// three bits to produce an 11-bit value.
|
|
120
158
|
if (pointerSize === 0) {
|
|
121
159
|
packed = utils_1.default.concat2(ctrlByte & 7, this.db[offset]);
|
|
160
|
+
// If the size is 1, the pointer is built by appending the next two bytes to the
|
|
161
|
+
// last three bits to produce a 19-bit value + 2048.
|
|
122
162
|
}
|
|
123
163
|
else if (pointerSize === 1) {
|
|
124
164
|
packed = utils_1.default.concat3(ctrlByte & 7, this.db[offset], this.db[offset + 1]);
|
|
165
|
+
// If the size is 2, the pointer is built by appending the next three bytes to the
|
|
166
|
+
// last three bits to produce a 27-bit value + 526336.
|
|
125
167
|
}
|
|
126
168
|
else if (pointerSize === 2) {
|
|
127
169
|
packed = utils_1.default.concat4(ctrlByte & 7, this.db[offset], this.db[offset + 1], this.db[offset + 2]);
|
|
170
|
+
// At next point `size` is always 3.
|
|
171
|
+
// Finally, if the size is 3, the pointer's value is contained in the next four
|
|
172
|
+
// bytes as a 32-bit value. In this case, the last three bits of the control byte
|
|
173
|
+
// are ignored.
|
|
128
174
|
}
|
|
129
175
|
else {
|
|
130
|
-
packed = this.db.readUInt32BE(offset
|
|
176
|
+
packed = this.db.readUInt32BE(offset);
|
|
131
177
|
}
|
|
132
178
|
offset += pointerSize + 1;
|
|
133
179
|
return cursor(pointer + packed, offset);
|
|
@@ -146,10 +192,10 @@ class Decoder {
|
|
|
146
192
|
return size !== 0;
|
|
147
193
|
}
|
|
148
194
|
decodeDouble(offset) {
|
|
149
|
-
return this.db.readDoubleBE(offset
|
|
195
|
+
return this.db.readDoubleBE(offset);
|
|
150
196
|
}
|
|
151
197
|
decodeFloat(offset) {
|
|
152
|
-
return this.db.readFloatBE(offset
|
|
198
|
+
return this.db.readFloatBE(offset);
|
|
153
199
|
}
|
|
154
200
|
decodeMap(size, offset) {
|
|
155
201
|
let tmp;
|
|
@@ -168,7 +214,7 @@ class Decoder {
|
|
|
168
214
|
if (size === 0) {
|
|
169
215
|
return 0;
|
|
170
216
|
}
|
|
171
|
-
return this.db.readInt32BE(offset
|
|
217
|
+
return this.db.readInt32BE(offset);
|
|
172
218
|
}
|
|
173
219
|
decodeUint(offset, size) {
|
|
174
220
|
switch (size) {
|
|
@@ -190,7 +236,7 @@ class Decoder {
|
|
|
190
236
|
return 0;
|
|
191
237
|
}
|
|
192
238
|
decodeString(offset, size) {
|
|
193
|
-
return this.db.
|
|
239
|
+
return this.db.toString('utf8', offset, offset + size);
|
|
194
240
|
}
|
|
195
241
|
decodeBigUint(offset, size) {
|
|
196
242
|
const buffer = Buffer.alloc(size);
|
|
@@ -199,11 +245,9 @@ class Decoder {
|
|
|
199
245
|
const numberOfLongs = size / 4;
|
|
200
246
|
for (let i = 0; i < numberOfLongs; i++) {
|
|
201
247
|
integer =
|
|
202
|
-
integer * BigInt(4294967296) +
|
|
203
|
-
BigInt(buffer.readUInt32BE(i << 2, true));
|
|
248
|
+
integer * BigInt(4294967296) + BigInt(buffer.readUInt32BE(i << 2));
|
|
204
249
|
}
|
|
205
250
|
return integer.toString();
|
|
206
251
|
}
|
|
207
252
|
}
|
|
208
253
|
exports.default = Decoder;
|
|
209
|
-
//# sourceMappingURL=decoder.js.map
|
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Metadata } from './metadata';
|
|
3
3
|
import { Response } from './reader/response';
|
|
4
4
|
import { ReaderOptions } from './types';
|
|
5
|
-
export
|
|
5
|
+
export declare class Reader<T extends Response> {
|
|
6
6
|
metadata: Metadata;
|
|
7
7
|
private decoder;
|
|
8
8
|
private db;
|
package/lib/index.js
CHANGED
|
@@ -7,12 +7,13 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
7
7
|
o[k2] = m[k];
|
|
8
8
|
}));
|
|
9
9
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
13
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
14
|
};
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.Reader = void 0;
|
|
16
17
|
const decoder_1 = __importDefault(require("./decoder"));
|
|
17
18
|
const ip_1 = __importDefault(require("./ip"));
|
|
18
19
|
const metadata_1 = require("./metadata");
|
|
@@ -24,10 +25,13 @@ class Reader {
|
|
|
24
25
|
this.load(db);
|
|
25
26
|
}
|
|
26
27
|
load(db) {
|
|
28
|
+
if (!Buffer.isBuffer(db)) {
|
|
29
|
+
throw new Error(`mmdb-lib expects an instance of Buffer, got: ${typeof db}`);
|
|
30
|
+
}
|
|
27
31
|
this.db = db;
|
|
28
|
-
this.metadata = metadata_1.parseMetadata(this.db);
|
|
32
|
+
this.metadata = (0, metadata_1.parseMetadata)(this.db);
|
|
29
33
|
this.decoder = new decoder_1.default(this.db, this.metadata.searchTreeSize + DATA_SECTION_SEPARATOR_SIZE, this.opts.cache);
|
|
30
|
-
this.walker = walker_1.default(this.db, this.metadata.recordSize);
|
|
34
|
+
this.walker = (0, walker_1.default)(this.db, this.metadata.recordSize);
|
|
31
35
|
this.ipv4StartNodeNumber = this.ipv4Start();
|
|
32
36
|
}
|
|
33
37
|
get(ipAddress) {
|
|
@@ -43,13 +47,26 @@ class Reader {
|
|
|
43
47
|
const rawAddress = ip_1.default.parse(ipAddress);
|
|
44
48
|
const nodeCount = this.metadata.nodeCount;
|
|
45
49
|
const bitLength = rawAddress.length * 8;
|
|
50
|
+
// Binary search tree consists of certain (`nodeCount`) number of nodes. Tree
|
|
51
|
+
// depth depends on the ip version, it's 32 for IPv4 and 128 for IPv6. Each
|
|
52
|
+
// tree node has the same fixed length and usually 6-8 bytes. It consists
|
|
53
|
+
// of two records, left and right:
|
|
54
|
+
// | node |
|
|
55
|
+
// | 0x000000 | 0x000000 |
|
|
46
56
|
let bit;
|
|
47
57
|
let nodeNumber = 0;
|
|
48
58
|
let offset;
|
|
49
59
|
let depth = 0;
|
|
60
|
+
// When storing IPv4 addresses in an IPv6 tree, they are stored as-is, so they
|
|
61
|
+
// occupy the first 32-bits of the address space (from 0 to 2**32 - 1).
|
|
62
|
+
// Which means they're padded with zeros.
|
|
50
63
|
if (rawAddress.length === 4) {
|
|
51
64
|
nodeNumber = this.ipv4StartNodeNumber;
|
|
52
65
|
}
|
|
66
|
+
// Record value can point to one of three things:
|
|
67
|
+
// 1. Another node in the tree (most common case)
|
|
68
|
+
// 2. Data section address with relevant information (less common case)
|
|
69
|
+
// 3. Point to the value of `nodeCount`, which means IP address is unknown
|
|
53
70
|
for (; depth < bitLength && nodeNumber < nodeCount; depth++) {
|
|
54
71
|
bit = ip_1.default.bitAt(rawAddress, depth);
|
|
55
72
|
offset = nodeNumber * this.metadata.nodeByteSize;
|
|
@@ -61,6 +78,13 @@ class Reader {
|
|
|
61
78
|
return [null, depth];
|
|
62
79
|
}
|
|
63
80
|
resolveDataPointer(pointer) {
|
|
81
|
+
// In order to determine where in the file this offset really points to, we also
|
|
82
|
+
// need to know where the data section starts. This can be calculated by
|
|
83
|
+
// determining the size of the search tree in bytes and then adding an additional
|
|
84
|
+
// 16 bytes for the data section separator.
|
|
85
|
+
// So the final formula to determine the offset in the file is:
|
|
86
|
+
// $offset_in_file = ( $record_value - $node_count )
|
|
87
|
+
// + $search_tree_size_in_bytes
|
|
64
88
|
const resolved = pointer - this.metadata.nodeCount + this.metadata.searchTreeSize;
|
|
65
89
|
return this.decoder.decodeFast(resolved).value;
|
|
66
90
|
}
|
|
@@ -78,6 +102,5 @@ class Reader {
|
|
|
78
102
|
return pointer;
|
|
79
103
|
}
|
|
80
104
|
}
|
|
81
|
-
exports.
|
|
105
|
+
exports.Reader = Reader;
|
|
82
106
|
__exportStar(require("./reader/response"), exports);
|
|
83
|
-
//# sourceMappingURL=index.js.map
|
package/lib/ip.js
CHANGED
|
@@ -21,6 +21,7 @@ const parseIPv6 = (input) => {
|
|
|
21
21
|
let i;
|
|
22
22
|
let parsed;
|
|
23
23
|
let chunk;
|
|
24
|
+
// ipv4 e.g. `::ffff:64.17.254.216`
|
|
24
25
|
const ip = input.indexOf('.') > -1
|
|
25
26
|
? input.replace(/(\d+)\.(\d+)\.(\d+)\.(\d+)/, (match, a, b, c, d) => {
|
|
26
27
|
return hex(a) + hex(b) + ':' + hex(c) + hex(d);
|
|
@@ -37,7 +38,7 @@ const parseIPv6 = (input) => {
|
|
|
37
38
|
}
|
|
38
39
|
if (right) {
|
|
39
40
|
parsed = right.split(':');
|
|
40
|
-
const offset = 16 - parsed.length * 2;
|
|
41
|
+
const offset = 16 - parsed.length * 2; // 2 bytes per chunk
|
|
41
42
|
for (i = 0; i < parsed.length; i++) {
|
|
42
43
|
chunk = parseInt(parsed[i], 16);
|
|
43
44
|
addr[offset + i * 2] = chunk >> 8;
|
|
@@ -50,8 +51,11 @@ const parse = (ip) => {
|
|
|
50
51
|
return ip.indexOf(':') === -1 ? parseIPv4(ip) : parseIPv6(ip);
|
|
51
52
|
};
|
|
52
53
|
const bitAt = (rawAddress, idx) => {
|
|
54
|
+
// 8 bits per octet in the buffer (>>3 is slightly faster than Math.floor(idx/8))
|
|
53
55
|
const bufIdx = idx >> 3;
|
|
56
|
+
// Offset within the octet (basically equivalent to 8 - (idx % 8))
|
|
54
57
|
const bitIdx = 7 ^ (idx & 7);
|
|
58
|
+
// Shift the offset rightwards by bitIdx bits and & it to grab the bit
|
|
55
59
|
return (rawAddress[bufIdx] >>> bitIdx) & 1;
|
|
56
60
|
};
|
|
57
61
|
const validate = (ip) => {
|
|
@@ -63,4 +67,3 @@ exports.default = {
|
|
|
63
67
|
parse,
|
|
64
68
|
validate,
|
|
65
69
|
};
|
|
66
|
-
//# sourceMappingURL=ip.js.map
|
package/lib/metadata.js
CHANGED
|
@@ -8,16 +8,16 @@ const assert_1 = __importDefault(require("assert"));
|
|
|
8
8
|
const decoder_1 = __importDefault(require("./decoder"));
|
|
9
9
|
const utils_1 = __importDefault(require("./utils"));
|
|
10
10
|
const METADATA_START_MARKER = Buffer.from('ABCDEF4D61784D696E642E636F6D', 'hex');
|
|
11
|
-
|
|
11
|
+
const parseMetadata = (db) => {
|
|
12
12
|
const offset = findStart(db);
|
|
13
13
|
const decoder = new decoder_1.default(db, offset);
|
|
14
14
|
const metadata = decoder.decode(offset).value;
|
|
15
15
|
if (!metadata) {
|
|
16
|
-
throw new Error(exports.isLegacyFormat(db)
|
|
16
|
+
throw new Error((0, exports.isLegacyFormat)(db)
|
|
17
17
|
? utils_1.default.legacyErrorMessage
|
|
18
18
|
: 'Cannot parse binary database');
|
|
19
19
|
}
|
|
20
|
-
assert_1.default([24, 28, 32].indexOf(metadata.record_size) > -1, 'Unsupported record size');
|
|
20
|
+
(0, assert_1.default)([24, 28, 32].indexOf(metadata.record_size) > -1, 'Unsupported record size');
|
|
21
21
|
return {
|
|
22
22
|
binaryFormatMajorVersion: metadata.binary_format_major_version,
|
|
23
23
|
binaryFormatMinorVersion: metadata.binary_format_minor_version,
|
|
@@ -30,9 +30,11 @@ exports.parseMetadata = (db) => {
|
|
|
30
30
|
nodeCount: metadata.node_count,
|
|
31
31
|
recordSize: metadata.record_size,
|
|
32
32
|
searchTreeSize: (metadata.node_count * metadata.record_size) / 4,
|
|
33
|
+
// Depth depends on the IP version, it's 32 for IPv4 and 128 for IPv6.
|
|
33
34
|
treeDepth: Math.pow(2, metadata.ip_version + 1),
|
|
34
35
|
};
|
|
35
36
|
};
|
|
37
|
+
exports.parseMetadata = parseMetadata;
|
|
36
38
|
const findStart = (db) => {
|
|
37
39
|
let found = 0;
|
|
38
40
|
let fsize = db.length - 1;
|
|
@@ -42,14 +44,15 @@ const findStart = (db) => {
|
|
|
42
44
|
}
|
|
43
45
|
return fsize + found;
|
|
44
46
|
};
|
|
45
|
-
|
|
47
|
+
const isLegacyFormat = (db) => {
|
|
46
48
|
const structureInfoMaxSize = 20;
|
|
47
49
|
for (let i = 0; i < structureInfoMaxSize; i++) {
|
|
48
50
|
const delim = db.slice(db.length - 3 - i, db.length - i);
|
|
51
|
+
// Look for [0xff, 0xff, 0xff] metadata delimiter
|
|
49
52
|
if (delim[0] === 255 && delim[1] === 255 && delim[2] === 255) {
|
|
50
53
|
return true;
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
56
|
return false;
|
|
54
57
|
};
|
|
55
|
-
|
|
58
|
+
exports.isLegacyFormat = isLegacyFormat;
|
package/lib/reader/response.d.ts
CHANGED
|
@@ -64,6 +64,8 @@ interface TraitsRecord {
|
|
|
64
64
|
readonly is_satellite_provider?: boolean;
|
|
65
65
|
readonly is_tor_exit_node?: boolean;
|
|
66
66
|
readonly isp?: string;
|
|
67
|
+
readonly mobile_country_code?: string;
|
|
68
|
+
readonly mobile_network_code?: string;
|
|
67
69
|
readonly organization?: string;
|
|
68
70
|
readonly user_type?: 'business' | 'cafe' | 'cellular' | 'college' | 'content_delivery_network' | 'dialup' | 'government' | 'hosting' | 'library' | 'military' | 'residential' | 'router' | 'school' | 'search_engine_spider' | 'traveler';
|
|
69
71
|
}
|
|
@@ -105,6 +107,8 @@ export interface DomainResponse {
|
|
|
105
107
|
}
|
|
106
108
|
export interface IspResponse extends AsnResponse {
|
|
107
109
|
readonly isp: string;
|
|
110
|
+
readonly mobile_country_code?: string;
|
|
111
|
+
readonly mobile_network_code?: string;
|
|
108
112
|
readonly organization: string;
|
|
109
113
|
}
|
|
110
114
|
export declare type Response = CountryResponse | CityResponse | AnonymousIPResponse | AsnResponse | ConnectionTypeResponse | DomainResponse | IspResponse;
|
package/lib/reader/response.js
CHANGED
package/lib/reader/walker.js
CHANGED
|
@@ -8,8 +8,8 @@ const readNodeRight24 = (db) => (offset) => utils_1.default.concat3(db[offset +
|
|
|
8
8
|
const readNodeLeft24 = (db) => (offset) => utils_1.default.concat3(db[offset], db[offset + 1], db[offset + 2]);
|
|
9
9
|
const readNodeLeft28 = (db) => (offset) => utils_1.default.concat4(db[offset + 3] >> 4, db[offset], db[offset + 1], db[offset + 2]);
|
|
10
10
|
const readNodeRight28 = (db) => (offset) => utils_1.default.concat4(db[offset + 3] & 0x0f, db[offset + 4], db[offset + 5], db[offset + 6]);
|
|
11
|
-
const readNodeLeft32 = (db) => (offset) => db.readUInt32BE(offset
|
|
12
|
-
const readNodeRight32 = (db) => (offset) => db.readUInt32BE(offset + 4
|
|
11
|
+
const readNodeLeft32 = (db) => (offset) => db.readUInt32BE(offset);
|
|
12
|
+
const readNodeRight32 = (db) => (offset) => db.readUInt32BE(offset + 4);
|
|
13
13
|
exports.default = (db, recordSize) => {
|
|
14
14
|
switch (recordSize) {
|
|
15
15
|
case 24:
|
|
@@ -21,4 +21,3 @@ exports.default = (db, recordSize) => {
|
|
|
21
21
|
}
|
|
22
22
|
throw new Error('Unsupported record size');
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=walker.js.map
|
package/lib/types.js
CHANGED
package/lib/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mmdb-lib",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"homepage": "https://github.com/runk/mmdb-lib",
|
|
5
5
|
"description": "Maxmind DB (MMDB) Library",
|
|
6
6
|
"keywords": [
|
|
@@ -11,23 +11,24 @@
|
|
|
11
11
|
"geoip2"
|
|
12
12
|
],
|
|
13
13
|
"author": "Dmitry Shirokov <deadrunk@gmail.com>",
|
|
14
|
-
"contributors": [
|
|
15
|
-
|
|
14
|
+
"contributors": [
|
|
15
|
+
"William Storey @horgh"
|
|
16
|
+
],
|
|
16
17
|
"devDependencies": {
|
|
17
18
|
"@types/ip-address": "5.8.2",
|
|
18
|
-
"@types/jest": "
|
|
19
|
-
"@types/node": "
|
|
19
|
+
"@types/jest": "27.0.0",
|
|
20
|
+
"@types/node": "16.0.0",
|
|
20
21
|
"@types/sinon": "7.5.2",
|
|
21
22
|
"@typescript-eslint/eslint-plugin": "^4.4.0",
|
|
22
23
|
"@typescript-eslint/parser": "^4.4.0",
|
|
23
24
|
"eslint": "^7.10.0",
|
|
24
25
|
"ip-address": "6.2.0",
|
|
25
|
-
"jest": "
|
|
26
|
+
"jest": "^27.4.7",
|
|
26
27
|
"prettier": "^2.1.2",
|
|
27
|
-
"semantic-release": "
|
|
28
|
+
"semantic-release": "^18.0.1",
|
|
28
29
|
"sinon": "9.0.1",
|
|
29
|
-
"ts-jest": "
|
|
30
|
-
"typescript": "
|
|
30
|
+
"ts-jest": "^27.1.2",
|
|
31
|
+
"typescript": "4.5.4"
|
|
31
32
|
},
|
|
32
33
|
"repository": {
|
|
33
34
|
"type": "git",
|
|
@@ -52,6 +53,7 @@
|
|
|
52
53
|
"lint": "eslint . --ext .ts",
|
|
53
54
|
"lint:types": "tsc --noEmit",
|
|
54
55
|
"test": "jest",
|
|
56
|
+
"test-imports": "node test/imports/commonjs.js && node test/imports/esm.mjs",
|
|
55
57
|
"format": "prettier --write src",
|
|
56
58
|
"prepublish": "npm run build",
|
|
57
59
|
"semantic-release": "semantic-release"
|
package/lib/decoder.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decoder.js","sourceRoot":"","sources":["../src/decoder.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAC5B,oDAA4B;AAG5B,gBAAM,CACJ,OAAO,MAAM,KAAK,WAAW,EAC7B,uFAAuF,CACxF,CAA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C,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAEhC,MAAM,eAAe,GAAG,CAAC,EAAU,EAAc,EAAE,CAAC,CAAC,MAAc,EAAU,EAAE,CAC7E,EAAE,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;AAEpC,kBAAe,CAAC,EAAU,EAAE,UAAkB,EAAU,EAAE;IACxD,QAAQ,UAAU,EAAE;QAClB,KAAK,EAAE;YACL,OAAO,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC;QAClE,KAAK,EAAE;YACL,OAAO,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC;QAClE,KAAK,EAAE;YACL,OAAO,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC;KACnE;IACD,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AAC7C,CAAC,CAAC"}
|
package/lib/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/lib/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;AAAA,MAAM,OAAO,GAAG,CAAC,CAAS,EAAE,CAAS,EAAU,EAAE;IAC/C,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAU,EAAE;IAC1D,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAU,EAAE;IACrE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG;;;oEAGyC,CAAC;AAErE,kBAAe;IACb,OAAO;IACP,OAAO;IACP,OAAO;IACP,kBAAkB;CACnB,CAAC"}
|