Home

tailwind-ctp-intellisense @bac7e2e5642c8e3ce8c7e23024b31417d19b569f - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tailwind-ctp-intellisense / packages / tailwindcss-language-service / src / util / joinWithAnd.ts
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
export function joinWithAnd(strings: string[]): string {
  return strings.reduce((acc, cur, i) => {
    if (i === 0) {
      return cur
    }
    if (strings.length > 1 && i === strings.length - 1) {
      return `${acc} and ${cur}`
    }
    return `${acc}, ${cur}`
  }, '')
}