get filename

This commit is contained in:
Mylloon 2022-07-21 21:06:01 +02:00
parent 425ebcca2c
commit eb4a022954
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -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];
};