2017-05-11 03:21:07 +00:00
|
|
|
/* jslint node: true */
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const mimeTypes = require('mime-types');
|
|
|
|
|
|
|
|
exports.resolveMimeType = resolveMimeType;
|
|
|
|
|
|
|
|
function resolveMimeType(query) {
|
2017-05-20 00:41:13 +00:00
|
|
|
if(mimeTypes.extensions[query]) {
|
|
|
|
return query; // alreaed a mime-type
|
|
|
|
}
|
|
|
|
|
|
|
|
return mimeTypes.lookup(query) || undefined; // lookup() returns false; we want undefined
|
2017-05-11 03:21:07 +00:00
|
|
|
}
|