mirror of
https://github.com/zebrajr/express.git
synced 2026-01-15 12:15:27 +00:00
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:
@@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user