feat: locales #27
1 changed files with 12 additions and 0 deletions
|
@ -18,3 +18,15 @@ export const getFilename = (path: string) => {
|
||||||
|
|
||||||
return path_list[path_list.length - 1].split('.')[0];
|
return path_list[path_list.length - 1].split('.')[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove extension from a filename
|
||||||
|
* @param filename string of the filename with an extension
|
||||||
|
* @returns string of the filename without an extension
|
||||||
|
*/
|
||||||
|
export const removeExtension = (filename: string) => {
|
||||||
|
const array = filename.split('.');
|
||||||
|
array.pop();
|
||||||
|
|
||||||
|
return array.join('.');
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in a new issue