mirror of
https://github.com/zebrajr/express.git
synced 2025-12-06 00:19:48 +01: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:
parent
fa40ecfe76
commit
3dc96995df
|
|
@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user