Refactor: simplify acceptsLanguages implementation using spread operator (#6137)

Refactored `req.acceptsLanguages` to use the spread operator for passing arguments directly to `accept.languages`, eliminating the need for `.apply`. This approach improves readability and streamlines the function call.
This commit is contained in:
Ayoub Mabrouk
2025-04-10 20:49:23 -05:00
committed by GitHub
parent 59fb317ce5
commit 172b4e640d
+2 -3
View File
@@ -169,9 +169,8 @@ req.acceptsCharsets = function(){
* @public
*/
req.acceptsLanguages = function(){
var accept = accepts(this);
return accept.languages.apply(accept, arguments);
req.acceptsLanguages = function(...languages) {
return accepts(this).languages(...languages);
};
/**