export const limitItems = (items: string, max: number | undefined) => { if (max && items.length > max) { return items.slice(0, max) } return items } export const splitJoin = (text: string, splitOn = `\n`, joinWith = ` `) => text.split(splitOn).filter(Boolean).join(joinWith)