Skip to content

Commit 511d9df

Browse files
refactor: simplify normalizeTypes function (#6097)
1 parent 7f13d57 commit 511d9df

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib/utils.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,11 @@ exports.normalizeType = function(type){
7070
* @api private
7171
*/
7272

73-
exports.normalizeTypes = function(types){
74-
var ret = [];
75-
76-
for (var i = 0; i < types.length; ++i) {
77-
ret.push(exports.normalizeType(types[i]));
78-
}
79-
80-
return ret;
73+
exports.normalizeTypes = function(types) {
74+
return types.map(exports.normalizeType);
8175
};
8276

77+
8378
/**
8479
* Parse accept params `str` returning an
8580
* object with `.value`, `.quality` and `.params`.

0 commit comments

Comments
 (0)