mirror of
https://github.com/hay-kot/homebox.git
synced 2024-11-16 21:58:40 +00:00
7 lines
227 B
TypeScript
7 lines
227 B
TypeScript
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);
|
|
}
|