ayiin 2.0.36 → 2.0.37
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.
|
@@ -2,5 +2,5 @@ import { RequestHandler } from "express";
|
|
|
2
2
|
import { RateLimiterOptions } from "../types";
|
|
3
3
|
import Tools from "./tools";
|
|
4
4
|
export declare class Limiter extends Tools {
|
|
5
|
-
createRateLimit: (options: RateLimiterOptions) =>
|
|
5
|
+
createRateLimit: (options: RateLimiterOptions) => RequestHandler;
|
|
6
6
|
}
|
package/dist/methods/limiter.js
CHANGED
|
@@ -43,7 +43,7 @@ class MemoryStore {
|
|
|
43
43
|
}
|
|
44
44
|
// 🔹 Class Limiter
|
|
45
45
|
class Limiter extends tools_1.default {
|
|
46
|
-
createRateLimit =
|
|
46
|
+
createRateLimit = (options) => {
|
|
47
47
|
const store = options.store ?? new MemoryStore(); // default ke MemoryStore
|
|
48
48
|
return async (req, res, next) => {
|
|
49
49
|
const now = Date.now();
|