mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Add optional method property in object form of pathFilter
This commit is contained in:
@@ -14,4 +14,6 @@ app.use(middleware.unless({ path: "/index", useOriginalUrl: true }));
|
||||
app.use(middleware.unless({ path: /home/g, ext: ".jpg" }));
|
||||
app.use(middleware.unless({ path: { url: "/index" }, ext: [ ".html", ".htm" ] }));
|
||||
app.use(middleware.unless({ path: { url: "/index", methods: [ "GET", "POST" ] } }));
|
||||
app.use(middleware.unless({ path: [ "/index", "/home", /home/i, { url: "/main", methods: [ "GET" ] }, { url: /home/i } ] }));
|
||||
app.use(middleware.unless({ path: [ "/index", "/home", /home/i, { url: "/main", methods: [ "GET" ] }, { url: /home/i } ] }));
|
||||
app.use(middleware.unless({ path: [ "/index", "/home", /home/i, { url: "/main", method: "GET" }, { url: /home/i } ] }));
|
||||
app.use(middleware.unless({ path: [ "/index", "/home", /home/i, { url: "/main", method: [ "GET" ] }, { url: /home/i } ] }));
|
||||
2
types/express-unless/index.d.ts
vendored
2
types/express-unless/index.d.ts
vendored
@@ -12,7 +12,7 @@ declare function unless(options: unless.Options): express.RequestHandler;
|
||||
declare function unless(options: unless.Options["custom"]): express.RequestHandler;
|
||||
|
||||
declare namespace unless {
|
||||
type pathFilter = string | RegExp | { url: string | RegExp, methods?: string[] };
|
||||
type pathFilter = string | RegExp | { url: string | RegExp, methods?: string[], method?: string | string[] };
|
||||
|
||||
export interface Options {
|
||||
custom?: (req: express.Request) => boolean;
|
||||
|
||||
Reference in New Issue
Block a user