mirror of
https://github.com/zebrajr/express.git
synced 2025-12-06 12:19:51 +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
|
* @public
|
||||||
*/
|
*/
|
||||||
|
|
||||||
req.acceptsLanguages = function(){
|
req.acceptsLanguages = function(...languages) {
|
||||||
var accept = accepts(this);
|
return accepts(this).languages(...languages);
|
||||||
return accept.languages.apply(accept, arguments);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user