mirror of
https://github.com/expressjs/express.git
synced 2026-02-21 19:41:36 +00:00
refactor: simplify normalizeTypes function (#6097)
This commit is contained in:
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`.
|
||||
|
||||
Reference in New Issue
Block a user