(klass: QuestionClass)
| 522 | * the back of. |
| 523 | */ |
| 524 | export function priorityOf(klass: QuestionClass): (kind: CardKind) => number { |
| 525 | const base: Record<CardKind, number> = { |
| 526 | subject: 0, |
| 527 | calls: 20, |
| 528 | raises: 30, |
| 529 | caller: 40, |
| 530 | callee: 50, |
| 531 | route: 60, |
| 532 | entry: 62, |
| 533 | overview: 64, |
| 534 | compare: 66, |
| 535 | observed: 70, |
| 536 | absence: 100, |
| 537 | }; |
| 538 | const lift: Partial<Record<QuestionClass, Partial<Record<CardKind, number>>>> = { |
| 539 | 'who-calls': { caller: 10, observed: 15 }, |
| 540 | 'what-if': { caller: 10, observed: 15 }, |
| 541 | 'why-error': { raises: 10, callee: 15, observed: 18 }, |
| 542 | 'where-entry': { route: 5, entry: 6, overview: 8 }, |
| 543 | overview: { overview: 5, entry: 6, route: 8 }, |
| 544 | compare: { compare: 5 }, |
| 545 | 'what-is': { calls: 10, raises: 12 }, |
| 546 | }; |
| 547 | const overrides = lift[klass] ?? {}; |
| 548 | return (kind) => overrides[kind] ?? base[kind]; |
| 549 | } |
| 550 | |
| 551 | // ------------------------------------------------------------ the compiler -- |
| 552 |
no outgoing calls
no test coverage detected