Skip to content

Commit

Permalink
undo the try exception
Browse files Browse the repository at this point in the history
  • Loading branch information
gary-singh-filestack committed Jan 12, 2024
1 parent 14d14e8 commit 46e9f92
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,15 @@ export const getMimetype = async(file: Uint8Array | Buffer, name?: string): Prom
console.warn("An exception occurred while processing the buffer:", e.message);
}

try {
console.log("passed here:",name.split('.').pop());
if (name && name.indexOf('.') > -1) {
const mime = extensionToMime(name);
if (name && name.indexOf('.') > -1) {
const mime = extensionToMime(name);

if (mime) {
if (mime) {
return mime;
}
}
} catch (e){
const mime = extensionToMime(name);
}


try {
if (isutf8(file)) {
return 'text/plain';
Expand Down

0 comments on commit 46e9f92

Please sign in to comment.