MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / mapMimeTypeToExt

Function mapMimeTypeToExt

packages/components/src/utils.ts:1136–1243  ·  view source on GitHub ↗
(mimeType: string)

Source from the content-addressed store, hash-verified

1134 * @returns {string}
1135 */
1136export const mapMimeTypeToExt = (mimeType: string) => {
1137 switch (mimeType) {
1138 case 'text/plain':
1139 return 'txt'
1140 case 'text/html':
1141 return 'html'
1142 case 'text/css':
1143 return 'css'
1144 case 'text/javascript':
1145 case 'application/javascript':
1146 return 'js'
1147 case 'text/xml':
1148 case 'application/xml':
1149 return 'xml'
1150 case 'text/markdown':
1151 case 'text/x-markdown':
1152 return 'md'
1153 case 'application/pdf':
1154 return 'pdf'
1155 case 'application/json':
1156 return 'json'
1157 case 'text/csv':
1158 return 'csv'
1159 case 'application/json-lines':
1160 case 'application/jsonl':
1161 case 'text/jsonl':
1162 return 'jsonl'
1163 // YAML types
1164 case 'application/vnd.yaml':
1165 case 'application/x-yaml':
1166 case 'text/vnd.yaml':
1167 case 'text/x-yaml':
1168 case 'text/yaml':
1169 return 'yaml'
1170 // SQL types
1171 case 'application/sql':
1172 case 'text/x-sql':
1173 return 'sql'
1174 // Document types
1175 case 'application/msword':
1176 return 'doc'
1177 case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
1178 return 'docx'
1179 case 'application/vnd.ms-excel':
1180 return 'xls'
1181 case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
1182 return 'xlsx'
1183 case 'application/vnd.ms-powerpoint':
1184 return 'ppt'
1185 case 'application/vnd.openxmlformats-officedocument.presentationml.presentation':
1186 return 'pptx'
1187 case 'application/rtf':
1188 return 'rtf'
1189 // Image types
1190 case 'image/jpeg':
1191 case 'image/jpg':
1192 return 'jpg'
1193 case 'image/png':

Callers 3

initMethod · 0.90
isAllowedUploadMimeTypeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected