Files
stats/apps/web/src/utils/truncate.ts
Carl-Gerhard Lindesvärd ccd1a1456f a lot
2024-02-04 13:23:21 +01:00

7 lines
138 B
TypeScript

export function truncate(str: string, len: number) {
if (str.length <= len) {
return str;
}
return str.slice(0, len) + '...';
}