(i: number)
| 369 | } |
| 370 | |
| 371 | export function ordinal(i: number): string { |
| 372 | const j = i % 10 |
| 373 | const k = i % 100 |
| 374 | |
| 375 | if (j === 1 && k !== 11) { |
| 376 | return `${i}st` |
| 377 | } |
| 378 | |
| 379 | if (j === 2 && k !== 12) { |
| 380 | return `${i}nd` |
| 381 | } |
| 382 | |
| 383 | if (j === 3 && k !== 13) { |
| 384 | return `${i}rd` |
| 385 | } |
| 386 | |
| 387 | return `${i}th` |
| 388 | } |
| 389 | |
| 390 | /** |
| 391 | * Deep merge :P |
no outgoing calls
no test coverage detected