(items: SampleSummary[])
| 291 | } |
| 292 | |
| 293 | export function getStats(items: SampleSummary[]) { |
| 294 | const featuredCount = items.filter((sample) => sample.featured).length; |
| 295 | const languageCount = new Set(items.map((sample) => sample.language)).size; |
| 296 | |
| 297 | return { |
| 298 | total: items.length, |
| 299 | featured: featuredCount, |
| 300 | languages: languageCount, |
| 301 | features: catalogIndex.f |
| 302 | }; |
| 303 | } |
| 304 | |
| 305 | export function parseQueryList(value: unknown) { |
| 306 | if (typeof value !== 'string' || value.trim().length === 0) { |