inleft
2022-02-09 9bcb19959eeb9da9bde2561e7278f6d0a55eb151
commit | author | age
9bcb19 1 export function handleDocType(fileType) {
I 2   let docType = ''
3   const fileTypesDoc = [
4     'doc', 'docm', 'docx', 'dot', 'dotm', 'dotx', 'epub', 'fodt', 'htm', 'html', 'mht', 'odt', 'ott', 'pdf', 'rtf', 'txt', 'djvu', 'xps'
5   ]
6   const fileTypesCsv = [
7     'csv', 'fods', 'ods', 'ots', 'xls', 'xlsm', 'xlsx', 'xlt', 'xltm', 'xltx'
8   ]
9   const fileTypesPPt = [
10     'fodp', 'odp', 'otp', 'pot', 'potm', 'potx', 'pps', 'ppsm', 'ppsx', 'ppt', 'pptm', 'pptx'
11   ]
12   if (fileTypesDoc.includes(fileType)) {
13     docType = 'text'
14   }
15   if (fileTypesCsv.includes(fileType)) {
16     docType = 'spreadsheet'
17   }
18   if (fileTypesPPt.includes(fileType)) {
19     docType = 'presentation'
20   }
21   return docType
22 }