@lark-apaas/dataloom 0.1.4 → 0.1.5-alpha.20260917133532
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/lib/RateLimiter.d.ts +0 -4
- package/lib/RateLimiter.d.ts.map +1 -1
- package/lib/RateLimiter.js +5 -7
- package/package.json +1 -1
package/lib/RateLimiter.d.ts
CHANGED
package/lib/RateLimiter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RateLimiter.d.ts","sourceRoot":"","sources":["../src/RateLimiter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RateLimiter.d.ts","sourceRoot":"","sources":["../src/RateLimiter.ts"],"names":[],"mappings":"AAKA,cAAM,WAAW;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,WAAW,CAAS;gBAEhB,WAAW,EAAE,MAAM;IAO/B,mBAAmB;IAYnB,UAAU;CASX;AAED,eAAe,WAAW,CAAC"}
|
package/lib/RateLimiter.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
this.WINDOW_SIZE = 5000;
|
|
4
|
-
}
|
|
1
|
+
const WINDOW_SIZE_MS = 5000;
|
|
2
|
+
class RateLimiter_RateLimiter {
|
|
5
3
|
constructor(maxRequests){
|
|
6
4
|
this.maxRequests = maxRequests;
|
|
7
|
-
this.windowSizeMs =
|
|
5
|
+
this.windowSizeMs = WINDOW_SIZE_MS;
|
|
8
6
|
this.requestCount = 0;
|
|
9
7
|
this.windowStart = Date.now();
|
|
10
8
|
}
|
|
@@ -27,5 +25,5 @@ class RateLimiter {
|
|
|
27
25
|
return false;
|
|
28
26
|
}
|
|
29
27
|
}
|
|
30
|
-
const
|
|
31
|
-
export {
|
|
28
|
+
const RateLimiter = RateLimiter_RateLimiter;
|
|
29
|
+
export { RateLimiter as default };
|