Skip to content
Myr

docs: fix JSDoc for req.accepts() return value and parameter format (#6936)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* fixed request accept jsdoc * reverted format * reverted format * updated jsdoc * updated the rest of the documentation

authored by Marcos Molina · committed by GitHub · parent 9a3f7ff · Browse files · 1 file+4 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−8 removed

  • other:+4 added−8 removed

1 file+4 added−8 removed

modified:lib/request.js+4 added-8 removed
81 unmodified lines
82 }83};8485/**86 * To do: update docs.87 *86 * Check if the given `type(s)` is acceptable, returning89 * the best match when true, otherwise `undefined`, in which87 * the best match when true, otherwise `false`, in which88 * case you should respond with 406 "Not Acceptable".89 *90 * The `type` value may be a single MIME type string91 * such as "application/json", an extension name94 * such as "json", a comma-delimited list such as "json, html, text/plain",95 * an argument list such as `"json", "html", "text/plain"`,92 * such as "json", an argument list such as `"json", "html", "text/plain"`,93 * or an array `["json", "html", "text/plain"]`. When a list94 * or array is given, the _best_ match, if any is returned.95 *96 * Examples:
6 unmodified lines
103 * req.accepts('html');104 * // => "html"105 * req.accepts('text/html');106 * // => "text/html"110 * req.accepts('json, text');107 * req.accepts('json', 'text');108 * // => "json"109 * req.accepts('application/json');110 * // => "application/json"111 *112 * // Accept: text/*, application/json113 * req.accepts('image/png');114 * req.accepts('png');118 * // => undefined115 * // => false116 *117 * // Accept: text/*;q=.5, application/json118 * req.accepts(['html', 'json']);119 * req.accepts('html', 'json');123 * req.accepts('html, json');120 * // => "json"121 *122 * @param {String|Array} type(s)123 * @return {String|Array|Boolean}
404 unmodified lines