mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Merge pull request #12670 from ligaz/express-router-options
[express] Add Router constructor options
This commit is contained in:
@@ -29,8 +29,7 @@ namespace express_tests {
|
||||
res.send('hello world');
|
||||
});
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
const router = express.Router({ caseSensitive: true, mergeParams: true, strict: true });
|
||||
|
||||
const pathStr: string = 'test';
|
||||
const pathRE: RegExp = /test/;
|
||||
|
||||
Vendored
+22
-1
@@ -28,7 +28,28 @@ declare namespace e {
|
||||
*/
|
||||
var static: typeof serveStatic;
|
||||
|
||||
export function Router(options?: any): core.Router;
|
||||
export function Router(options?: RouterOptions): core.Router;
|
||||
|
||||
interface RouterOptions {
|
||||
/**
|
||||
* Enable case sensitivity.
|
||||
*/
|
||||
caseSensitive?: boolean;
|
||||
|
||||
/**
|
||||
* Preserve the req.params values from the parent router.
|
||||
* If the parent and the child have conflicting param names, the child’s value take precedence.
|
||||
*
|
||||
* @default false
|
||||
* @since 4.5.0
|
||||
*/
|
||||
mergeParams?: boolean;
|
||||
|
||||
/**
|
||||
* Enable strict routing.
|
||||
*/
|
||||
strict?: boolean;
|
||||
}
|
||||
|
||||
interface Application extends core.Application { }
|
||||
interface CookieOptions extends core.CookieOptions { }
|
||||
|
||||
Reference in New Issue
Block a user