swipe game with overlay
This commit is contained in:
13
utils/fileNameParser.ts
Normal file
13
utils/fileNameParser.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export const toTitleCaseWithSpaces = (input: string): string => {
|
||||
return input
|
||||
.replace(/[-_]/g, " ")
|
||||
.split(" ")
|
||||
.filter(Boolean)
|
||||
.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
||||
.join(" ");
|
||||
};
|
||||
|
||||
export const parseImageName = (fileName: string): string => {
|
||||
// Extract the name without the extension
|
||||
return fileName.split(".").slice(0, -1).join(".");
|
||||
};
|
||||
Reference in New Issue
Block a user