All files / src/features/year-summary holder.ts

100% Statements 5/5
100% Branches 3/3
100% Functions 1/1
100% Lines 5/5

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 83x   54x   17x   12x      
// The `person` search parameter of the year summary pages (openspec:
// year-summary, "Choosing whose figures"): absent for the own share,
// `whole` for the whole flats, or another owner's user id.
import type { HolderView } from './view'
 
export const personParam = (holder: HolderView): string | undefined => {
  switch (holder.kind) {
    case 'own':
      return undefined
    case 'whole':
      return 'whole'
    case 'person':
      return holder.userId
  }
}