From 0dfabf300221ad5720b0f24896f8629bbe3b317f Mon Sep 17 00:00:00 2001 From: krzysdz Date: Sun, 18 Jan 2026 20:51:43 +0100 Subject: [PATCH] docs: fix types description Port changes from https://github.com/expressjs/express/pull/6936 and https://github.com/expressjs/express/pull/2527. Co-Authored-By: Marcos Molina <53741892+marcosmol204@users.noreply.github.com> Co-Authored-By: Elvin Yung --- index.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 4f2840c..7d335f8 100644 --- a/index.js +++ b/index.js @@ -40,13 +40,14 @@ function Accepts (req) { /** * Check if the given `type(s)` is acceptable, returning - * the best match when true, otherwise `undefined`, in which + * the best match when true, otherwise `false`, in which * case you should respond with 406 "Not Acceptable". * - * The `type` value may be a single mime type string - * such as "application/json", the extension name - * such as "json" or an array `["json", "html", "text/plain"]`. When a list - * or array is given the _best_ match, if any is returned. + * The `type` value may be a single MIME type string + * such as "application/json", an extension name + * such as "json", an argument list such as `"json", "html", "text/plain", + * or an array `["json", "html", "text/plain"]`. When a list + * or array is given, the _best_ match, if any is returned. * * Examples: * @@ -67,7 +68,7 @@ function Accepts (req) { * // Accept: text/*, application/json * this.types('image/png'); * this.types('png'); - * // => undefined + * // => false * * // Accept: text/*;q=.5, application/json * this.types(['html', 'json']);