We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4275db0 commit 4e8d46fCopy full SHA for 4e8d46f
app/utils/string.ts
@@ -1,3 +1,4 @@
1
export function truncate(s: string, n: number): string {
2
+ if (n <= 0) return ''
3
return s.length > n ? s.slice(0, n - 1) + '…' : s
4
}
0 commit comments