const RTL = new Set(['he', 'ar', 'fa', 'ur', 'yi', 'dv'])

export function isRtl(locale: string): boolean {
  return RTL.has(locale.split('-')[0]!)
}

export function dir(locale: string): 'rtl' | 'ltr' {
  return isRtl(locale) ? 'rtl' : 'ltr'
}
