(size?: number, lang?: string)
| 1 | export const formatSize = (size?: number, lang?: string) => { |
| 2 | if (!size) { |
| 3 | return "Unknown"; |
| 4 | } |
| 5 | |
| 6 | return Intl.NumberFormat(lang, { |
| 7 | minimumFractionDigits: 2, |
| 8 | maximumFractionDigits: 2, |
| 9 | notation: "compact", |
| 10 | trailingZeroDisplay: "stripIfInteger", |
| 11 | |
| 12 | style: "unit", |
| 13 | unit: "byte", |
| 14 | unitDisplay: "narrow", |
| 15 | }).format(size); |
| 16 | }; |
| 17 | |
| 18 | export const formatStars = (stars?: number, lang?: string) => { |
| 19 | if (!stars) { |
nothing calls this directly
no outgoing calls
no test coverage detected