All files / src/features/properties room-count.ts

100% Statements 6/6
100% Branches 0/0
100% Functions 5/5
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16        4x 280x 315x 280x 280x         1155x    
import { m } from '#/paraglide/messages.js'
import type { RoomCount } from './property'
 
// Static keys for Paraglide's no-dynamic-message-access rule.
const labels: Record<RoomCount, () => string> = {
  1: () => m.room_count_1(),
  2: () => m.room_count_2(),
  3: () => m.room_count_3(),
  4: () => m.room_count_4(),
}
 
/** "Yksiƶ", "Kaksio", "Kolmio" or "4h+" in Finnish. */
export function roomCountLabel(count: RoomCount): string {
  return labels[count]()
}