a lot
This commit is contained in:
6
apps/web/src/utils/truncate.ts
Normal file
6
apps/web/src/utils/truncate.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export function truncate(str: string, len: number) {
|
||||
if (str.length <= len) {
|
||||
return str;
|
||||
}
|
||||
return str.slice(0, len) + '...';
|
||||
}
|
||||
Reference in New Issue
Block a user