diff --git a/index.js b/index.js index a5f1109..834ed16 100644 --- a/index.js +++ b/index.js @@ -232,19 +232,14 @@ function mimeMatch (expected, actual) { * Normalize a type and remove parameters. * * @param {string} value - * @return {string} + * @return {(string|null)} * @private */ - function normalizeType (value) { - // parse the type + // Parse the type var type = contentType.parse(value).type - if (!typer.test(type)) { - return null - } - - return type + return typer.test(type) ? type : null } /**