@spoosh/plugin-throttle 0.1.7 → 0.1.9
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/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -37,7 +37,7 @@ function throttlePlugin() {
|
|
|
37
37
|
return next();
|
|
38
38
|
}
|
|
39
39
|
const { path, method } = context;
|
|
40
|
-
const stableKey = `${path
|
|
40
|
+
const stableKey = `${path}:${method}`;
|
|
41
41
|
const now = Date.now();
|
|
42
42
|
const lastTime = lastFetchTime.get(stableKey) ?? 0;
|
|
43
43
|
const elapsed = now - lastTime;
|
package/dist/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ function throttlePlugin() {
|
|
|
11
11
|
return next();
|
|
12
12
|
}
|
|
13
13
|
const { path, method } = context;
|
|
14
|
-
const stableKey = `${path
|
|
14
|
+
const stableKey = `${path}:${method}`;
|
|
15
15
|
const now = Date.now();
|
|
16
16
|
const lastTime = lastFetchTime.get(stableKey) ?? 0;
|
|
17
17
|
const elapsed = now - lastTime;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spoosh/plugin-throttle",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Request throttling plugin for Spoosh - limits request frequency",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@spoosh/core": ">=0.
|
|
36
|
+
"@spoosh/core": ">=0.11.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@spoosh/core": "0.
|
|
40
|
-
"@spoosh/test-utils": "0.1.
|
|
39
|
+
"@spoosh/core": "0.11.1",
|
|
40
|
+
"@spoosh/test-utils": "0.1.6"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"dev": "tsup --watch",
|