dis+/node_modules/exegesis/lib/utils/mime.js
/**
 * Parses a mimeType into a `{type, subtype}` object.
 * Parameters provided with the mimeType are ignored.
 */
Parses a mimeType into a `{type, subtype}` object.
Parameters provided with the mimeType are ignored.
Parses a mimeType into a ` { type subtype } ` object . Parameters provided with the mimeType are ignored .
function parseMimeType(mimeType) {
    const match = MIME_TYPE_REGEX.exec(mimeType);
    if (!match) {
        throw new Error(`Invalid MIME type: "${mimeType}"`);
    }
    if (match[3] && match[3][0] !== ';') {
        throw new Error(`Invalid MIME type: "${mimeType}"`);
    }
    return { type: match[1].toLowerCase(), subtype: match[2].toLowerCase() };
}
function parseMimeType ( mimeType ) { const match = MIME_TYPE_REGEX . exec ( mimeType ) ; if ( ! match ) { throw new Error ( ` ${ mimeType } ` ) ; } if ( match [ 3 ] && match [ 3 ] [ 0 ] !== ';' ) { throw new Error ( ` ${ mimeType } ` ) ; } return { type : match [ 1 ] . toLowerCase ( ) , subtype : match [ 2 ] . toLowerCase ( ) } ; }
Parses a mimeType into a `{type, subtype}` object.
Parses a mimeType into a ` { type subtype } ` object .