Skip to content

Commit

Permalink
refactor: simplify normalizeTypes function (#6097)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayoub-Mabrouk authored Feb 4, 2025
1 parent 7f13d57 commit 511d9df
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down

0 comments on commit 511d9df

Please sign in to comment.