@oschwald/maxminddb 0.3.1 → 0.4.0
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/CHANGELOG.md +30 -0
- package/index.darwin-arm64.node +0 -0
- package/index.darwin-x64.node +0 -0
- package/index.js +5 -1
- package/index.linux-arm64-gnu.node +0 -0
- package/index.linux-x64-gnu.node +0 -0
- package/index.win32-arm64-msvc.node +0 -0
- package/index.win32-x64-msvc.node +0 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,35 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.4.0] - 2026-09-12
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Upgraded the Rust `maxminddb` dependency from 0.30.0 to 0.32.0, adding
|
|
13
|
+
resource limits for decoding records and metadata, fixing overflowing
|
|
14
|
+
extended data types, and improving record decoding, search-tree traversal,
|
|
15
|
+
and selective path lookups.
|
|
16
|
+
- Databases that exceed the new decoding limits now raise the same bad-data
|
|
17
|
+
error as other corrupt databases, including databases that previously
|
|
18
|
+
decoded successfully. These limits apply to lookups, batches, compiled
|
|
19
|
+
paths, and network iteration, as well as metadata during opens and reloads.
|
|
20
|
+
- Refreshed Rust and npm development dependencies.
|
|
21
|
+
|
|
22
|
+
### Performance
|
|
23
|
+
|
|
24
|
+
- Bind single-record `get()` calls to a validated native reader once, avoiding
|
|
25
|
+
repeated receiver validation and generic borrow tracking in the updated
|
|
26
|
+
N-API bindings. Bound calls retain the reader, use its existing reentrancy
|
|
27
|
+
protection, and follow loads and reloads.
|
|
28
|
+
|
|
29
|
+
### Development
|
|
30
|
+
|
|
31
|
+
- Added regression coverage for decoding limits, records at the supported
|
|
32
|
+
limits, empty metadata containers, malformed database fixtures, and
|
|
33
|
+
overflowing extended data types.
|
|
34
|
+
- Added coverage ensuring failed resource-limited reloads preserve the
|
|
35
|
+
existing reader and its cached records.
|
|
36
|
+
|
|
8
37
|
## [0.3.1] - 2026-07-19
|
|
9
38
|
|
|
10
39
|
### Fixed
|
|
@@ -166,6 +195,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
166
195
|
- Added Rust formatting, `cargo check`, clippy, TypeScript, Node test, npm pack,
|
|
167
196
|
and packed-package smoke-test validation.
|
|
168
197
|
|
|
198
|
+
[0.4.0]: https://github.com/oschwald/maxminddb-node/releases/tag/v0.4.0
|
|
169
199
|
[0.3.1]: https://github.com/oschwald/maxminddb-node/releases/tag/v0.3.1
|
|
170
200
|
[0.3.0]: https://github.com/oschwald/maxminddb-node/releases/tag/v0.3.0
|
|
171
201
|
[0.2.1]: https://github.com/oschwald/maxminddb-node/releases/tag/v0.2.1
|
package/index.darwin-arm64.node
CHANGED
|
Binary file
|
package/index.darwin-x64.node
CHANGED
|
Binary file
|
package/index.js
CHANGED
|
@@ -308,6 +308,7 @@ class Reader {
|
|
|
308
308
|
this._lastReloadError = null;
|
|
309
309
|
this._cacheCapacity = normalizeCacheCapacity(options);
|
|
310
310
|
this._reader = new native.NativeReader(database, this._cacheCapacity);
|
|
311
|
+
this._get = this._reader.bindGet();
|
|
311
312
|
this.metadata = normalizeMetadata(this._reader.metadata());
|
|
312
313
|
this.options = options;
|
|
313
314
|
}
|
|
@@ -347,6 +348,7 @@ class Reader {
|
|
|
347
348
|
reader._lastReloadError = null;
|
|
348
349
|
reader._cacheCapacity = normalizeCacheCapacity(options);
|
|
349
350
|
reader._reader = nativeReader;
|
|
351
|
+
reader._get = nativeReader.bindGet();
|
|
350
352
|
reader.metadata = normalizeMetadata(reader._reader.metadata());
|
|
351
353
|
reader.options = options;
|
|
352
354
|
return reader;
|
|
@@ -408,8 +410,10 @@ class Reader {
|
|
|
408
410
|
|
|
409
411
|
_replaceNativeReader(replacement) {
|
|
410
412
|
const metadata = normalizeMetadata(replacement.metadata());
|
|
413
|
+
const get = replacement.bindGet();
|
|
411
414
|
const previous = this._reader;
|
|
412
415
|
this._reader = replacement;
|
|
416
|
+
this._get = get;
|
|
413
417
|
this.metadata = metadata;
|
|
414
418
|
this._lastReloadError = null;
|
|
415
419
|
previous.close();
|
|
@@ -488,7 +492,7 @@ class Reader {
|
|
|
488
492
|
}
|
|
489
493
|
|
|
490
494
|
get(ipAddress) {
|
|
491
|
-
return this.
|
|
495
|
+
return this._get(ipAddress);
|
|
492
496
|
}
|
|
493
497
|
|
|
494
498
|
getPath(ipAddress, path) {
|
|
Binary file
|
package/index.linux-x64-gnu.node
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oschwald/maxminddb",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Rust-backed Node.js reader for MaxMind DB files",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
],
|
|
52
52
|
"license": "ISC",
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@napi-rs/cli": "^3.
|
|
55
|
-
"@types/node": "^26.1
|
|
54
|
+
"@napi-rs/cli": "^3.9.1",
|
|
55
|
+
"@types/node": "^26.5.1",
|
|
56
56
|
"typescript": "^7.0.2"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|