fix: truncation

This commit is contained in:
Cory Dransfeldt 2024-10-15 17:50:16 -07:00
parent c04c69fcbd
commit 7fb22f6d62
No known key found for this signature in database
7 changed files with 116 additions and 554 deletions

View file

@ -1,3 +1,4 @@
import truncateHtml from 'truncate-html'
import { shuffleArray } from '../utilities/index.js'
export default {
@ -8,5 +9,9 @@ export default {
return string.replace(pattern, replacement)
},
formatNumber: (number) => number.toLocaleString('en-US'),
htmlTruncate: (content, limit = 50) => truncateHtml(content, limit, {
byWords: true,
ellipsis: '...'
}),
shuffleArray,
}