mirror of
https://github.com/zebrajr/express.git
synced 2025-12-06 12:19:51 +01:00
refactor: simplify normalizeTypes function (#6097)
This commit is contained in:
parent
7f13d572c1
commit
511d9dfca8
11
lib/utils.js
11
lib/utils.js
|
|
@ -70,16 +70,11 @@ exports.normalizeType = function(type){
|
|||
* @api private
|
||||
*/
|
||||
|
||||
exports.normalizeTypes = function(types){
|
||||
var ret = [];
|
||||
|
||||
for (var i = 0; i < types.length; ++i) {
|
||||
ret.push(exports.normalizeType(types[i]));
|
||||
}
|
||||
|
||||
return ret;
|
||||
exports.normalizeTypes = function(types) {
|
||||
return types.map(exports.normalizeType);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Parse accept params `str` returning an
|
||||
* object with `.value`, `.quality` and `.params`.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user