Skip to content

Commit

Permalink
Merge pull request #4 from beclab/feat/file_suffix_type
Browse files Browse the repository at this point in the history
fix: update files
  • Loading branch information
wushuangs authored Aug 29, 2024
2 parents 50bf096 + 85fc484 commit c536c63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bytetrade/core",
"version": "0.3.60",
"version": "0.3.61",
"description": "didvault core module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
8 changes: 4 additions & 4 deletions src/files.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

export function getFileIcon(fileName: string) {
export function getFileIcon(fileName: string): string {
let suffix = '';
let result: string | undefined = '';
if (fileName) {
const fileArr = fileName.split('.');
suffix = fileArr[fileArr.length - 1];
}
if (!suffix) return false;
if (!suffix) return 'other';
suffix = suffix.toLocaleLowerCase();

const imgList = ['png', 'jpg', 'jpeg', 'bmp', 'gif'];
Expand Down Expand Up @@ -58,14 +58,14 @@ export function getFileIcon(fileName: string) {
return 'other';
}

export function getFileType(fileName: string) {
export function getFileType(fileName: string): string {
let suffix = '';
let result: string | undefined = '';
if (fileName) {
const fileArr = fileName.split('.');
suffix = fileArr[fileArr.length - 1];
}
if (!suffix) return false;
if (!suffix) return 'blob';
suffix = suffix.toLocaleLowerCase();

const docList = ['doc'];
Expand Down

0 comments on commit c536c63

Please sign in to comment.