Skip to content

Commit 00d565f

Browse files
krzysdzmarcosmol204lvn
authored
docs: fix types description (#72)
Port changes from expressjs/express#6936 and expressjs/express#2527. Co-authored-by: krzysdz <krzysdz@users.noreply.github.com> Co-authored-by: Marcos Molina <53741892+marcosmol204@users.noreply.github.com> Co-authored-by: Elvin Yung <elvin@elvinyung.com>
1 parent fa67a8b commit 00d565f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ function Accepts (req) {
4040

4141
/**
4242
* Check if the given `type(s)` is acceptable, returning
43-
* the best match when true, otherwise `undefined`, in which
43+
* the best match when true, otherwise `false`, in which
4444
* case you should respond with 406 "Not Acceptable".
4545
*
46-
* The `type` value may be a single mime type string
47-
* such as "application/json", the extension name
48-
* such as "json" or an array `["json", "html", "text/plain"]`. When a list
49-
* or array is given the _best_ match, if any is returned.
46+
* The `type` value may be a single MIME type string
47+
* such as "application/json", an extension name
48+
* such as "json", an argument list such as `"json", "html", "text/plain",
49+
* or an array `["json", "html", "text/plain"]`. When a list
50+
* or array is given, the _best_ match, if any is returned.
5051
*
5152
* Examples:
5253
*
@@ -67,7 +68,7 @@ function Accepts (req) {
6768
* // Accept: text/*, application/json
6869
* this.types('image/png');
6970
* this.types('png');
70-
* // => undefined
71+
* // => false
7172
*
7273
* // Accept: text/*;q=.5, application/json
7374
* this.types(['html', 'json']);

0 commit comments

Comments
 (0)