jbilcke-hf's picture
jbilcke-hf HF staff
hide some features for the beta + improve player
f27679f
raw
history blame
167 Bytes
export function truncate(text: string, length: number): string {
const truncated = text.slice(0, length)
return `${truncated}${truncated !== text ? '...' : ''}`
}