refactor: simplify normalizeTypes function (#6097)

This commit is contained in:
Ayoub Mabrouk 2025-02-04 11:59:48 +01:00 committed by GitHub
parent 7f13d572c1
commit 511d9dfca8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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`.