Socket
Socket
Sign inDemoInstall

rate-limiter-flexible

Package Overview
Dependencies
Maintainers
1
Versions
163
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rate-limiter-flexible - npm Package Compare versions

Comparing version 2.3.3 to 2.3.4

28

lib/RateLimiterMongo.js

@@ -7,17 +7,18 @@ const RateLimiterStoreAbstract = require('./RateLimiterStoreAbstract');

* @params {Object} Client instance
* @returns {Number|undefined} Major version
* @returns {Object} Version Object containing major, feature & minor versions.
*/
function getDriverVersion(client) {
try {
let version;
if (client.client) {
({ version } = client.client.topology.s.options.metadata.driver);
} else {
({ version } = client.topology.s.options.metadata.driver);
}
const majorVersion = parseInt(version);
const _client = client.client ? client.client : client;
return majorVersion;
const { version } = _client.topology.s.options.metadata.driver;
const _v = version.split('.').map(v => parseInt(v));
return {
major: _v[0],
feature: _v[1],
patch: _v[2],
};
} catch (err) {
return undefined;
return { major: 0, feature: 0, patch: 0 };
}

@@ -178,3 +179,8 @@ }

};
if (this._driverVersion >= 4) {
if ((this._driverVersion.major >= 4) ||
(this._driverVersion.major === 3 &&
(this._driverVersion.feature >=7) ||
(this._driverVersion.feature >= 6 &&
this._driverVersion.patch >= 7 )))
{
upsertOptions.returnDocument = 'after';

@@ -181,0 +187,0 @@ } else {

{
"name": "rate-limiter-flexible",
"version": "2.3.3",
"version": "2.3.4",
"description": "Node.js rate limiter by key and protection from DDoS and Brute-Force attacks in process Memory, Redis, MongoDb, Memcached, MySQL, PostgreSQL, Cluster or PM",

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

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