diff --git a/types/express-unless/express-unless-tests.ts b/types/express-unless/express-unless-tests.ts index 56d1a72574..859d72286d 100644 --- a/types/express-unless/express-unless-tests.ts +++ b/types/express-unless/express-unless-tests.ts @@ -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 } ] })); \ No newline at end of file +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 } ] })); \ No newline at end of file diff --git a/types/express-unless/index.d.ts b/types/express-unless/index.d.ts index c98516a411..601cc199fc 100644 --- a/types/express-unless/index.d.ts +++ b/types/express-unless/index.d.ts @@ -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;