frigate/web/src/utils/stringUtil.ts
Nicolas Mowen 404807c697
UI tweaks (#14814)
* Tweak bird icon and fix _ in object name

* Apply to all capitalization
2024-11-05 08:29:07 -07:00

12 lines
321 B
TypeScript

export const capitalizeFirstLetter = (text: string): string => {
return text.charAt(0).toUpperCase() + text.slice(1);
};
export const capitalizeAll = (text: string): string => {
return text
.replaceAll("_", " ")
.split(" ")
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(" ");
};