Comparing version 1.2.0 to 1.3.0
@@ -11,3 +11,5 @@ /// <reference types="node" /> | ||
private walker; | ||
private opts; | ||
constructor(db: Buffer, opts?: ReaderOptions); | ||
load(db: Buffer): void; | ||
get(ipAddress: string): T | null; | ||
@@ -14,0 +16,0 @@ getWithPrefixLength(ipAddress: string): [T | null, number]; |
@@ -23,5 +23,9 @@ "use strict"; | ||
constructor(db, opts = {}) { | ||
this.opts = opts; | ||
this.load(db); | ||
} | ||
load(db) { | ||
this.db = db; | ||
this.metadata = metadata_1.parseMetadata(this.db); | ||
this.decoder = new decoder_1.default(this.db, this.metadata.searchTreeSize + DATA_SECTION_SEPARATOR_SIZE, opts.cache); | ||
this.decoder = new decoder_1.default(this.db, this.metadata.searchTreeSize + DATA_SECTION_SEPARATOR_SIZE, this.opts.cache); | ||
this.walker = walker_1.default(this.db, this.metadata.recordSize); | ||
@@ -28,0 +32,0 @@ this.ipv4StartNodeNumber = this.ipv4Start(); |
{ | ||
"name": "mmdb-lib", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"homepage": "https://github.com/runk/mmdb-lib", | ||
@@ -5,0 +5,0 @@ "description": "Maxmind DB (MMDB) Library", |
@@ -1,2 +0,2 @@ | ||
# mmdb-lib [![Build Status](https://api.travis-ci.org/runk/node-maxmind.svg?branch=master)](https://travis-ci.org/runk/node-maxmind) | ||
# mmdb-lib | ||
@@ -3,0 +3,0 @@ Javascript library for working with Maxmind binary databases (aka mmdb or geoip2). |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47217
663