Merge pull request #26557 from denkpark/patch-1

Middleware properties optional; req.brute
This commit is contained in:
Mine Starks
2018-06-15 11:13:28 -07:00
committed by GitHub
+11 -3
View File
@@ -67,19 +67,19 @@ declare namespace ExpressBrute {
* @summary Allows you to override the value of failCallback for this middleware.
* @type {Function}
*/
failCallback: Function;
failCallback?: Function;
/**
* @summary Disregard IP address when matching requests if set to true. Defaults to false.
* @type {boolean}
*/
ignoreIP: boolean;
ignoreIP?: boolean;
/**
* @summary Key.
* @type {any}
*/
key: any;
key?: any;
}
/**
@@ -156,5 +156,13 @@ declare namespace ExpressBrute {
reset(key: string, callback: (error: any) => void): void;
}
}
declare module "express-serve-static-core" {
export interface Request {
brute?: {
reset?: (callback?: () => void) => void
};
}
}
export = ExpressBrute;