rate-limiter-flexible 2.3.1 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.editorconfig ADDED
@@ -0,0 +1,13 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_size = 2
5
+ indent_style = space
6
+ end_of_line = lf
7
+ charset = utf-8
8
+ trim_trailing_whitespace = true
9
+ insert_final_newline = true
10
+
11
+ [*.md]
12
+ insert_final_newline = false
13
+ trim_trailing_whitespace = false
@@ -8,7 +8,12 @@ const RateLimiterRes = require('./RateLimiterRes');
8
8
  */
9
9
  function getDriverVersion(client) {
10
10
  try {
11
- const { version } = client.topology.s.options.metadata.driver;
11
+ let version;
12
+ if (client.client) {
13
+ ({ version } = client.client.topology.s.options.metadata.driver);
14
+ } else {
15
+ ({ version } = client.topology.s.options.metadata.driver);
16
+ }
12
17
  const majorVersion = parseInt(version);
13
18
 
14
19
  return majorVersion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rate-limiter-flexible",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
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
5
  "main": "index.js",
6
6
  "scripts": {