async-ratelimiter
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -5,2 +5,11 @@ # Change Log | ||
## [1.2.3](https://github.com/microlinkhq/async-ratelimiter/compare/v1.2.2...v1.2.3) (2019-04-21) | ||
### Bug Fixes | ||
* specify parse int radix ([a8b29f0](https://github.com/microlinkhq/async-ratelimiter/commit/a8b29f0)) | ||
<a name="1.2.2"></a> | ||
@@ -7,0 +16,0 @@ ## [1.2.2](https://github.com/microlinkhq/async-ratelimiter/compare/v1.2.1...v1.2.2) (2019-04-04) |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://documentup.com/microlinkhq/async-ratelimiter", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"main": "src/index.js", | ||
@@ -8,0 +8,0 @@ "author": { |
@@ -7,2 +7,4 @@ 'use strict' | ||
const toNumber = str => parseInt(str, 10) | ||
module.exports = class Limiter { | ||
@@ -43,5 +45,5 @@ constructor ({ id, db, max = 2500, duration = 3600000, namespace = 'limit' }) { | ||
const res = await this.db.multi(operations).exec() | ||
const count = parseInt(res[1][1]) | ||
const oldest = parseInt(res[decrease ? 3 : 2][1]) | ||
const oldestInRange = parseInt(res[decrease ? 4 : 3][1]) | ||
const count = toNumber(res[1][1]) | ||
const oldest = toNumber(res[decrease ? 3 : 2][1]) | ||
const oldestInRange = toNumber(res[decrease ? 4 : 3][1]) | ||
const resetMicro = | ||
@@ -48,0 +50,0 @@ (Number.isNaN(oldestInRange) ? oldest : oldestInRange) + duration * 1000 |
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
14365
81