Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿
at main 6 lines 222 B view raw
1const truncateByWords = (str: string, count: number): string => { 2 const words = str.trim().split(/\s+/); 3 return words.length > count ? `${words.slice(0, count).join(" ")}` : str; 4}; 5 6export default truncateByWords;