documentation structure

This commit is contained in:
David Haz
2025-07-08 23:34:52 +03:00
parent 9ddb731258
commit 660e4fd701
46 changed files with 3488 additions and 79 deletions

View File

@@ -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(' ')
}