_comuns/dist-front/extensoes.mjs.map
2025-07-17 08:54:56 -03:00

1 line
No EOL
4.9 KiB
Text

{"version":3,"sources":["../src/extensoes.ts"],"sourcesContent":["type tiposArquivo = \"imagem\" | \"documento\" | \"vídeo\" | \"outros\"\n\nexport const extensoes: {\n ext: string\n tipo: tiposArquivo\n mime: string\n}[] = [\n {\n ext: \"gif\",\n tipo: \"imagem\",\n mime: \"image/gif\",\n },\n {\n ext: \"jpg\",\n tipo: \"imagem\",\n mime: \"image/jpeg\",\n },\n {\n ext: \"jpeg\",\n tipo: \"imagem\",\n mime: \"image/jpeg\",\n },\n {\n ext: \"png\",\n tipo: \"imagem\",\n mime: \"image/png\",\n },\n {\n ext: \"bmp\",\n tipo: \"imagem\",\n mime: \"image/bmp\",\n },\n {\n ext: \"webp\",\n tipo: \"imagem\",\n mime: \"image/webp\",\n },\n {\n ext: \"tiff\",\n tipo: \"imagem\",\n mime: \"image/tiff\",\n },\n {\n ext: \"svg\",\n tipo: \"imagem\",\n mime: \"image/svg+xml\",\n },\n {\n ext: \"ico\",\n tipo: \"imagem\",\n mime: \"image/x-icon\",\n },\n {\n ext: \"pdf\",\n tipo: \"documento\",\n mime: \"application/pdf\",\n },\n {\n ext: \"doc\",\n tipo: \"documento\",\n mime: \"application/msword\",\n },\n {\n ext: \"docx\",\n tipo: \"documento\",\n mime: \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n },\n {\n ext: \"xls\",\n tipo: \"documento\",\n mime: \"application/vnd.ms-excel\",\n },\n {\n ext: \"xlsx\",\n tipo: \"documento\",\n mime: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n },\n {\n ext: \"ppt\",\n tipo: \"documento\",\n mime: \"application/vnd.ms-powerpoint\",\n },\n {\n ext: \"pptx\",\n tipo: \"documento\",\n mime: \"application/vnd.openxmlformats-officedocument.presentationml.presentation\",\n },\n {\n ext: \"txt\",\n tipo: \"documento\",\n mime: \"text/plain\",\n },\n {\n ext: \"odt\",\n tipo: \"documento\",\n mime: \"application/vnd.oasis.opendocument.text\",\n },\n {\n ext: \"ods\",\n tipo: \"documento\",\n mime: \"application/vnd.oasis.opendocument.spreadsheet\",\n },\n {\n ext: \"rtf\",\n tipo: \"documento\",\n mime: \"application/rtf\",\n },\n {\n ext: \"csv\",\n tipo: \"documento\",\n mime: \"text/csv\",\n },\n {\n ext: \"mp4\",\n tipo: \"vídeo\",\n mime: \"video/mp4\",\n },\n {\n ext: \"avi\",\n tipo: \"vídeo\",\n mime: \"video/x-msvideo\",\n },\n {\n ext: \"mkv\",\n tipo: \"vídeo\",\n mime: \"video/x-matroska\",\n },\n {\n ext: \"mov\",\n tipo: \"vídeo\",\n mime: \"video/quicktime\",\n },\n {\n ext: \"wmv\",\n tipo: \"vídeo\",\n mime: \"video/x-ms-wmv\",\n },\n {\n ext: \"flv\",\n tipo: \"vídeo\",\n mime: \"video/x-flv\",\n },\n {\n ext: \"webm\",\n tipo: \"vídeo\",\n mime: \"video/webm\",\n },\n {\n ext: \"3gp\",\n tipo: \"vídeo\",\n mime: \"video/3gpp\",\n },\n {\n ext: \"mpeg\",\n tipo: \"vídeo\",\n mime: \"video/mpeg\",\n },\n]\n\n/**\n * Função que retorna o tipo do arquivo\n * @param nomeArquivo\n * @returns\n */\nexport const tipoArquivo = (\n nomeArquivo: string | null | undefined,\n): tiposArquivo => {\n // extenssão do arquivo\n const extArquivo = String(nomeArquivo || \"\")\n .toLocaleLowerCase()\n .split(\".\")\n .pop()\n // procura a extensão do arquivo na lista de extensões\n const extensao = extensoes.find((extensao) => extensao.ext === extArquivo)\n // retorna o tipo do arquivo\n return extensao?.tipo || \"outros\"\n}\n"],"mappings":"AAEO,MAAMA,EAIP,CACJ,CACE,IAAK,MACL,KAAM,SACN,KAAM,WACR,EACA,CACE,IAAK,MACL,KAAM,SACN,KAAM,YACR,EACA,CACE,IAAK,OACL,KAAM,SACN,KAAM,YACR,EACA,CACE,IAAK,MACL,KAAM,SACN,KAAM,WACR,EACA,CACE,IAAK,MACL,KAAM,SACN,KAAM,WACR,EACA,CACE,IAAK,OACL,KAAM,SACN,KAAM,YACR,EACA,CACE,IAAK,OACL,KAAM,SACN,KAAM,YACR,EACA,CACE,IAAK,MACL,KAAM,SACN,KAAM,eACR,EACA,CACE,IAAK,MACL,KAAM,SACN,KAAM,cACR,EACA,CACE,IAAK,MACL,KAAM,YACN,KAAM,iBACR,EACA,CACE,IAAK,MACL,KAAM,YACN,KAAM,oBACR,EACA,CACE,IAAK,OACL,KAAM,YACN,KAAM,yEACR,EACA,CACE,IAAK,MACL,KAAM,YACN,KAAM,0BACR,EACA,CACE,IAAK,OACL,KAAM,YACN,KAAM,mEACR,EACA,CACE,IAAK,MACL,KAAM,YACN,KAAM,+BACR,EACA,CACE,IAAK,OACL,KAAM,YACN,KAAM,2EACR,EACA,CACE,IAAK,MACL,KAAM,YACN,KAAM,YACR,EACA,CACE,IAAK,MACL,KAAM,YACN,KAAM,yCACR,EACA,CACE,IAAK,MACL,KAAM,YACN,KAAM,gDACR,EACA,CACE,IAAK,MACL,KAAM,YACN,KAAM,iBACR,EACA,CACE,IAAK,MACL,KAAM,YACN,KAAM,UACR,EACA,CACE,IAAK,MACL,KAAM,WACN,KAAM,WACR,EACA,CACE,IAAK,MACL,KAAM,WACN,KAAM,iBACR,EACA,CACE,IAAK,MACL,KAAM,WACN,KAAM,kBACR,EACA,CACE,IAAK,MACL,KAAM,WACN,KAAM,iBACR,EACA,CACE,IAAK,MACL,KAAM,WACN,KAAM,gBACR,EACA,CACE,IAAK,MACL,KAAM,WACN,KAAM,aACR,EACA,CACE,IAAK,OACL,KAAM,WACN,KAAM,YACR,EACA,CACE,IAAK,MACL,KAAM,WACN,KAAM,YACR,EACA,CACE,IAAK,OACL,KAAM,WACN,KAAM,YACR,CACF,EAOaC,EACXC,GACiB,CAEjB,MAAMC,EAAa,OAAOD,GAAe,EAAE,EACxC,kBAAkB,EAClB,MAAM,GAAG,EACT,IAAI,EAIP,OAFiBF,EAAU,KAAMI,GAAaA,EAAS,MAAQD,CAAU,GAExD,MAAQ,QAC3B","names":["extensoes","tipoArquivo","nomeArquivo","extArquivo","extensao"]}