Socket
Socket
Sign inDemoInstall

rate-limiter-flexible

Package Overview
Dependencies
0
Maintainers
1
Versions
163
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.12.4 to 0.12.5

10

lib/RateLimiterMongo.js

@@ -19,2 +19,3 @@ const RateLimiterStoreAbstract = require('./RateLimiterStoreAbstract');

upsert: true,
returnOriginal: false,
} // eslint-disable-line comma-dangle

@@ -38,2 +39,3 @@ );

upsert: true,
returnOriginal: false,
} // eslint-disable-line comma-dangle

@@ -96,9 +98,7 @@ );

res.isFirstInDuration = result.value === null;
res.consumedPoints = res.isFirstInDuration ? changedPoints : result.value.points + changedPoints;
res.isFirstInDuration = result.value.points === changedPoints;
res.consumedPoints = result.value.points;
res.remainingPoints = Math.max(this.points - res.consumedPoints, 0);
res.msBeforeNext = res.isFirstInDuration
? this.duration * 1000
: Math.max(new Date(result.value.expire).getTime() - Date.now(), 0);
res.msBeforeNext = Math.max(new Date(result.value.expire).getTime() - Date.now(), 0);

@@ -105,0 +105,0 @@ return res;

{
"name": "rate-limiter-flexible",
"version": "0.12.4",
"version": "0.12.5",
"description": "Flexible API rate limiter backed by Redis for distributed node.js applications",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc