Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

async-ratelimiter

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-ratelimiter - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

9

CHANGELOG.md

@@ -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)

2

package.json

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc