Add prettier config, format codebase

This commit is contained in:
David Haz
2025-07-12 11:59:33 +03:00
parent ac8b2c04d8
commit f4d97ee94e
211 changed files with 10586 additions and 8810 deletions

View File

@@ -5,19 +5,19 @@
*/
export const getStarsCount = async (repo: string = 'DavidHDev/vue-bits'): Promise<number> => {
try {
const response = await fetch(`https://api.github.com/repos/${repo}`)
const response = await fetch(`https://api.github.com/repos/${repo}`);
if (!response.ok) {
throw new Error(`GitHub API error: ${response.status}`)
throw new Error(`GitHub API error: ${response.status}`);
}
const data = await response.json()
return data.stargazers_count || 0
const data = await response.json();
return data.stargazers_count || 0;
} catch (error) {
console.error('Error fetching GitHub stars:', error)
throw error
console.error('Error fetching GitHub stars:', error);
throw error;
}
}
};
/**
* Decodes a label from kebab-case to title case
@@ -25,10 +25,10 @@ export const getStarsCount = async (repo: string = 'DavidHDev/vue-bits'): Promis
* @returns The decoded label (e.g., "Split Text")
*/
export const decodeLabel = (label: string): string => {
if (!label) return ''
if (!label) return '';
return label
.split('-')
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ')
}
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
};