Comparing version 2.1.0 to 2.1.1
@@ -6,5 +6,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const assert_1 = __importDefault(require("assert")); | ||
const utils_1 = __importDefault(require("./utils")); | ||
(0, assert_1.default)(typeof BigInt !== 'undefined', 'Apparently you are using old version of node. Please upgrade to node 10.4.x or above.'); | ||
utils_1.default.assert(typeof BigInt !== 'undefined', 'Apparently you are using old version of node. Please upgrade to node 10.4.x or above.'); | ||
var DataType; | ||
@@ -38,3 +37,4 @@ (function (DataType) { | ||
this.telemetry = {}; | ||
(0, assert_1.default)((this.db = db), 'Database buffer is required'); | ||
utils_1.default.assert(Boolean(db), 'Database buffer is required'); | ||
this.db = db; | ||
this.baseOffset = baseOffset; | ||
@@ -41,0 +41,0 @@ this.cache = cache; |
@@ -7,3 +7,2 @@ "use strict"; | ||
exports.isLegacyFormat = exports.parseMetadata = void 0; | ||
const assert_1 = __importDefault(require("assert")); | ||
const decoder_1 = __importDefault(require("./decoder")); | ||
@@ -21,3 +20,3 @@ const utils_1 = __importDefault(require("./utils")); | ||
} | ||
(0, assert_1.default)([24, 28, 32].indexOf(metadata.record_size) > -1, 'Unsupported record size'); | ||
utils_1.default.assert([24, 28, 32].indexOf(metadata.record_size) > -1, 'Unsupported record size'); | ||
return { | ||
@@ -24,0 +23,0 @@ binaryFormatMajorVersion: metadata.binary_format_major_version, |
declare const _default: { | ||
assert: (condition: boolean, message: string) => void; | ||
concat2: (a: number, b: number) => number; | ||
@@ -3,0 +4,0 @@ concat3: (a: number, b: number, c: number) => number; |
@@ -16,3 +16,9 @@ "use strict"; | ||
If you want to use legacy library then explicitly install maxmind@1`; | ||
const assert = (condition, message) => { | ||
if (!condition) { | ||
throw new Error(message); | ||
} | ||
}; | ||
exports.default = { | ||
assert, | ||
concat2, | ||
@@ -19,0 +25,0 @@ concat3, |
{ | ||
"name": "mmdb-lib", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"homepage": "https://github.com/runk/mmdb-lib", | ||
@@ -19,16 +19,13 @@ "description": "Maxmind DB (MMDB) Library", | ||
"devDependencies": { | ||
"@types/ip-address": "6.0.0", | ||
"@types/ip-address": "7.0.0", | ||
"@types/mocha": "^10.0.1", | ||
"@types/node": "20.10.3", | ||
"@types/sinon": "17.0.2", | ||
"@typescript-eslint/eslint-plugin": "^5.0.0", | ||
"@typescript-eslint/parser": "^5.0.0", | ||
"eslint": "^8.0.0", | ||
"@types/node": "20.12.8", | ||
"@types/sinon": "17.0.3", | ||
"ip-address": "9.0.5", | ||
"mocha": "^10.2.0", | ||
"prettier": "^3.0.0", | ||
"semantic-release": "^21.0.0", | ||
"semantic-release": "^23.0.0", | ||
"sinon": "17.0.1", | ||
"ts-node": "^10.4.0", | ||
"typescript": "5.3.2" | ||
"typescript": "5.4.5" | ||
}, | ||
@@ -55,4 +52,3 @@ "repository": { | ||
"build": "rm -rf lib/* && tsc", | ||
"lint": "eslint . --ext .ts", | ||
"lint:types": "tsc --noEmit", | ||
"typecheck": "tsc --noEmit", | ||
"test": "mocha", | ||
@@ -59,0 +55,0 @@ "test-imports": "node test/imports/commonjs.js && node test/imports/esm.mjs && ts-node test/imports/typescript.ts", |
@@ -66,2 +66,14 @@ # mmdb-lib | ||
add a link | ||
All contributions are welcome. Please make sure to add tests for your changes. | ||
You need to initialise the repository with the following command: | ||
```shell | ||
git submodule update --init --recursive | ||
``` | ||
Then you can run tests with: | ||
```shell | ||
npm test | ||
``` |
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
34459
11
758
79