MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / getMimeType

Function getMimeType

lib/utils.js:704–732  ·  view source on GitHub ↗
(fileName)

Source from the content-addressed store, hash-verified

702}
703
704export const getMimeType = function (fileName) {
705 const ext = path.extname(fileName).toLowerCase()
706 const mimeTypes = {
707 '.jpg': 'image/jpeg',
708 '.jpeg': 'image/jpeg',
709 '.png': 'image/png',
710 '.gif': 'image/gif',
711 '.bmp': 'image/bmp',
712 '.svg': 'image/svg+xml',
713 '.webp': 'image/webp',
714 '.pdf': 'application/pdf',
715 '.txt': 'text/plain',
716 '.html': 'text/html',
717 '.css': 'text/css',
718 '.js': 'application/javascript',
719 '.json': 'application/json',
720 '.xml': 'application/xml',
721 '.zip': 'application/zip',
722 '.csv': 'text/csv',
723 '.doc': 'application/msword',
724 '.docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
725 '.xls': 'application/vnd.ms-excel',
726 '.xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
727 '.mp3': 'audio/mpeg',
728 '.mp4': 'video/mp4',
729 '.wav': 'audio/wav',
730 }
731 return mimeTypes[ext] || 'application/octet-stream'
732}
733
734export const markdownToAnsi = function (markdown) {
735 return (

Callers 3

attachFileMethod · 0.90
attachFileMethod · 0.90
attachFileMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected