build
This commit is contained in:
parent
aa7953e452
commit
f8dabeb40c
75 changed files with 712 additions and 57 deletions
168
dist-import/extensoes.js
Normal file
168
dist-import/extensoes.js
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
export const extensoes = [
|
||||
{
|
||||
ext: "gif",
|
||||
tipo: "imagem",
|
||||
mime: "image/gif",
|
||||
},
|
||||
{
|
||||
ext: "jpg",
|
||||
tipo: "imagem",
|
||||
mime: "image/jpeg",
|
||||
},
|
||||
{
|
||||
ext: "jpeg",
|
||||
tipo: "imagem",
|
||||
mime: "image/jpeg",
|
||||
},
|
||||
{
|
||||
ext: "png",
|
||||
tipo: "imagem",
|
||||
mime: "image/png",
|
||||
},
|
||||
{
|
||||
ext: "bmp",
|
||||
tipo: "imagem",
|
||||
mime: "image/bmp",
|
||||
},
|
||||
{
|
||||
ext: "webp",
|
||||
tipo: "imagem",
|
||||
mime: "image/webp",
|
||||
},
|
||||
{
|
||||
ext: "tiff",
|
||||
tipo: "imagem",
|
||||
mime: "image/tiff",
|
||||
},
|
||||
{
|
||||
ext: "svg",
|
||||
tipo: "imagem",
|
||||
mime: "image/svg+xml",
|
||||
},
|
||||
{
|
||||
ext: "ico",
|
||||
tipo: "imagem",
|
||||
mime: "image/x-icon",
|
||||
},
|
||||
{
|
||||
ext: "pdf",
|
||||
tipo: "documento",
|
||||
mime: "application/pdf",
|
||||
},
|
||||
{
|
||||
ext: "doc",
|
||||
tipo: "documento",
|
||||
mime: "application/msword",
|
||||
},
|
||||
{
|
||||
ext: "docx",
|
||||
tipo: "documento",
|
||||
mime: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||
},
|
||||
{
|
||||
ext: "xls",
|
||||
tipo: "documento",
|
||||
mime: "application/vnd.ms-excel",
|
||||
},
|
||||
{
|
||||
ext: "xlsx",
|
||||
tipo: "documento",
|
||||
mime: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
},
|
||||
{
|
||||
ext: "ppt",
|
||||
tipo: "documento",
|
||||
mime: "application/vnd.ms-powerpoint",
|
||||
},
|
||||
{
|
||||
ext: "pptx",
|
||||
tipo: "documento",
|
||||
mime: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
||||
},
|
||||
{
|
||||
ext: "txt",
|
||||
tipo: "documento",
|
||||
mime: "text/plain",
|
||||
},
|
||||
{
|
||||
ext: "odt",
|
||||
tipo: "documento",
|
||||
mime: "application/vnd.oasis.opendocument.text",
|
||||
},
|
||||
{
|
||||
ext: "ods",
|
||||
tipo: "documento",
|
||||
mime: "application/vnd.oasis.opendocument.spreadsheet",
|
||||
},
|
||||
{
|
||||
ext: "rtf",
|
||||
tipo: "documento",
|
||||
mime: "application/rtf",
|
||||
},
|
||||
{
|
||||
ext: "csv",
|
||||
tipo: "documento",
|
||||
mime: "text/csv",
|
||||
},
|
||||
{
|
||||
ext: "mp4",
|
||||
tipo: "vídeo",
|
||||
mime: "video/mp4",
|
||||
},
|
||||
{
|
||||
ext: "avi",
|
||||
tipo: "vídeo",
|
||||
mime: "video/x-msvideo",
|
||||
},
|
||||
{
|
||||
ext: "mkv",
|
||||
tipo: "vídeo",
|
||||
mime: "video/x-matroska",
|
||||
},
|
||||
{
|
||||
ext: "mov",
|
||||
tipo: "vídeo",
|
||||
mime: "video/quicktime",
|
||||
},
|
||||
{
|
||||
ext: "wmv",
|
||||
tipo: "vídeo",
|
||||
mime: "video/x-ms-wmv",
|
||||
},
|
||||
{
|
||||
ext: "flv",
|
||||
tipo: "vídeo",
|
||||
mime: "video/x-flv",
|
||||
},
|
||||
{
|
||||
ext: "webm",
|
||||
tipo: "vídeo",
|
||||
mime: "video/webm",
|
||||
},
|
||||
{
|
||||
ext: "3gp",
|
||||
tipo: "vídeo",
|
||||
mime: "video/3gpp",
|
||||
},
|
||||
{
|
||||
ext: "mpeg",
|
||||
tipo: "vídeo",
|
||||
mime: "video/mpeg",
|
||||
},
|
||||
];
|
||||
/**
|
||||
* Função que retorna o tipo do arquivo
|
||||
* @param nomeArquivo
|
||||
* @returns
|
||||
*/
|
||||
export const tipoArquivo = (nomeArquivo) => {
|
||||
// extenssão do arquivo
|
||||
const extArquivo = String(nomeArquivo || "")
|
||||
.toLocaleLowerCase()
|
||||
.split(".")
|
||||
.pop();
|
||||
// procura a extensão do arquivo na lista de extensões
|
||||
const extensao = extensoes.find((extensao) => extensao.ext === extArquivo);
|
||||
// retorna o tipo do arquivo
|
||||
return extensao?.tipo || "outros";
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue