export function compact(n: number): string {
  if (n >= 1_000_000) return (n / 1_000_000).toFixed(1) + "M"
  if (n >= 1_000) return (n / 1_000).toFixed(1) + "K"
  return String(n)
}

export function filterTruthy<T>(arr: (T | false | null | undefined | 0 | "")[]): T[] {
  return arr.filter(Boolean as any) as T[]
}
