Skip to content

Commit 31e81f9

Browse files
authored
feat: upgrade mmdb-lib to v3 (#920)
BREAKING CHANGE: Values stored in the database as uint64 or uint128 will now be decoded to BigInt. Previously, they were decoded as strings. This change comes from mmdb-lib v3 which now uses BigInt for all 64-bit and 128-bit unsigned integers.
1 parent e31d131 commit 31e81f9

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"Mariano Facundo Scigliano @MarianoFacundoArch"
2828
],
2929
"dependencies": {
30-
"mmdb-lib": "2.2.1",
30+
"mmdb-lib": "3.0.1",
3131
"tiny-lru": "11.3.4"
3232
},
3333
"devDependencies": {

src/__test__/integration.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ describe('maxmind', () => {
9797
float: 1.100000023841858,
9898
int32: -268435456,
9999
map: { mapX: { arrayX: [7, 8, 9], utf8_stringX: 'hello' } },
100-
uint128: '1329227995784915872903807060280344576',
100+
uint128: 1329227995784915872903807060280344576n,
101101
uint16: 100,
102102
uint32: 268435456,
103-
uint64: '1152921504606846976',
103+
uint64: 1152921504606846976n,
104104
utf8_string: 'unicode! ☯ - ♫',
105105
});
106106
});
@@ -117,10 +117,10 @@ describe('maxmind', () => {
117117
float: 0,
118118
int32: 0,
119119
map: {},
120-
uint128: 0,
120+
uint128: 0n,
121121
uint16: 0,
122122
uint32: 0,
123-
uint64: 0,
123+
uint64: 0n,
124124
utf8_string: '',
125125
});
126126
});
@@ -221,10 +221,10 @@ describe('maxmind', () => {
221221
utf8_stringX: 'hello',
222222
},
223223
},
224-
uint128: '1329227995784915872903807060280344576',
224+
uint128: 1329227995784915872903807060280344576n,
225225
uint16: 0x64,
226226
uint32: 268435456,
227-
uint64: '1152921504606846976',
227+
uint64: 1152921504606846976n,
228228
utf8_string: 'unicode! ☯ - ♫',
229229
};
230230
const tests = [

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"removeComments": true,
1515
"sourceMap": true,
1616
"strict": true,
17-
"lib": ["ES2019"],
18-
"target": "ES2019"
17+
"lib": ["ES2020"],
18+
"target": "ES2020"
1919
},
2020
"exclude": [
2121
"__mocks__",

0 commit comments

Comments
 (0)