moltres-utils
Version:
Utils for Moltres apps
27 lines (22 loc) • 707 B
JavaScript
require("core-js/modules/es6.object.define-property");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _mimeTypes = require("mime-types");
/**
* Create a full content-type header given a content-type or extension.
*
* @example
* toContentType('markdown') // 'text/x-markdown; charset=utf-8'
* toContentType('file.json') // 'application/json; charset=utf-8'
*
* toContentType(path.extname('/path/to/file.json')) // 'application/json
*/
var toContentType = function toContentType(type) {
return (0, _mimeTypes.contentType)(type);
};
var _default = toContentType;
exports.default = _default;
//# sourceMappingURL=toContentType.js.map
;