get filename
This commit is contained in:
parent
425ebcca2c
commit
eb4a022954
1 changed files with 11 additions and 0 deletions
|
@ -7,3 +7,14 @@
|
|||
export const logStart = (name: string, status: boolean) => {
|
||||
return `> ${name} ${status === true ? '✅' : '❌'}`;
|
||||
};
|
||||
|
||||
/**
|
||||
* Filename without path and extension
|
||||
* @param path __filename
|
||||
* @returns string
|
||||
*/
|
||||
export const getFilename = (path: string) => {
|
||||
const path_list = path.split('/');
|
||||
|
||||
return path_list[path_list.length - 1].split('.')[0];
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue