jan/web/utils/model.ts
Louis d7329c7719
chore: remove hard coded recommendation models and use cortexso featured tags (#4741)
* chore: remove hard coded recommendation models and use cortexso featured tags

* chore: polish model detail page

* chore: fix test
2025-02-26 15:54:06 +07:00

10 lines
345 B
TypeScript

/**
* Extracts and normalizes the model ID from a given download URL.
*
* @param downloadUrl - The URL from which to extract the model ID.
* @returns The extracted model ID, or the original URL if extraction fails.
*/
export const normalizeModelId = (downloadUrl: string): string => {
return downloadUrl.split('/').pop() ?? downloadUrl
}