(mimeType: string)
| 1092 | * @returns {string} |
| 1093 | */ |
| 1094 | export const mapMimeTypeToInputField = (mimeType: string) => { |
| 1095 | switch (mimeType) { |
| 1096 | case 'text/plain': |
| 1097 | return 'txtFile' |
| 1098 | case 'application/pdf': |
| 1099 | return 'pdfFile' |
| 1100 | case 'application/json': |
| 1101 | return 'jsonFile' |
| 1102 | case 'text/csv': |
| 1103 | return 'csvFile' |
| 1104 | case 'application/json-lines': |
| 1105 | case 'application/jsonl': |
| 1106 | case 'text/jsonl': |
| 1107 | return 'jsonlinesFile' |
| 1108 | case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': |
| 1109 | case 'application/msword': { |
| 1110 | return 'docxFile' |
| 1111 | } |
| 1112 | case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': |
| 1113 | case 'application/vnd.ms-excel': { |
| 1114 | return 'excelFile' |
| 1115 | } |
| 1116 | case 'application/vnd.openxmlformats-officedocument.presentationml.presentation': |
| 1117 | case 'application/vnd.ms-powerpoint': { |
| 1118 | return 'powerpointFile' |
| 1119 | } |
| 1120 | case 'application/vnd.yaml': |
| 1121 | case 'application/x-yaml': |
| 1122 | case 'text/vnd.yaml': |
| 1123 | case 'text/x-yaml': |
| 1124 | case 'text/yaml': |
| 1125 | return 'yamlFile' |
| 1126 | default: |
| 1127 | return 'txtFile' |
| 1128 | } |
| 1129 | } |
| 1130 | |
| 1131 | /** |
| 1132 | * Map MimeType to Extension |
no outgoing calls
no test coverage detected