1
0
Fork 1
mirror of https://github.com/hay-kot/homebox.git synced 2024-12-22 23:06:31 +00:00
homebox/frontend/composables/use-strings.ts

8 lines
227 B
TypeScript
Raw Normal View History

2022-09-06 18:32:13 +00:00
export function truncate(str: string, length: number) {
return str.length > length ? str.substring(0, length) + '...' : str;
}
export function capitalize(str: string) {
return str.charAt(0).toUpperCase() + str.slice(1);
}