mirror of
https://github.com/DavidHDev/vue-bits.git
synced 2026-03-07 14:39:30 -07:00
documentation structure
This commit is contained in:
@@ -6,11 +6,11 @@
|
||||
export const getStarsCount = async (repo: string = 'DavidHDev/vue-bits'): Promise<number> => {
|
||||
try {
|
||||
const response = await fetch(`https://api.github.com/repos/${repo}`)
|
||||
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`GitHub API error: ${response.status}`)
|
||||
}
|
||||
|
||||
|
||||
const data = await response.json()
|
||||
return data.stargazers_count || 0
|
||||
} catch (error) {
|
||||
@@ -18,3 +18,17 @@ export const getStarsCount = async (repo: string = 'DavidHDev/vue-bits'): Promis
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes a label from kebab-case to title case
|
||||
* @param label - The label to decode (e.g., "split-text")
|
||||
* @returns The decoded label (e.g., "Split Text")
|
||||
*/
|
||||
export const decodeLabel = (label: string): string => {
|
||||
if (!label) return ''
|
||||
|
||||
return label
|
||||
.split('-')
|
||||
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
||||
.join(' ')
|
||||
}
|
||||
Reference in New Issue
Block a user