(model: string)
| 8 | |
| 9 | function slugify(value: string): string { |
| 10 | return value.toLowerCase().replace(/[^a-z0-9]+/g, '-'); |
| 11 | } |
| 12 | |
| 13 | function slugifyTrimmed(value: string): string { |
| 14 | return slugify(value).replace(/^-|-$/g, ''); |
| 15 | } |
| 16 | |
| 17 | export function deriveModelStatsIdentity(model: string) { |
| 18 | const modelCreator = model.includes('/') ? model.split('/')[0] : 'unknown'; |
| 19 | return { |
| 20 | slug: slugifyTrimmed(model), |
| 21 | modelCreator, |
| 22 | creatorSlug: slugify(modelCreator), |
| 23 | }; |
no test coverage detected