feat(utils.ts): add capitalizeFirstLetter function to capitalize the first letter of a string for better readability and consistency

This commit is contained in:
Sped0n
2023-11-03 14:19:55 +08:00
parent f4eda42785
commit a629ec08c3

View File

@@ -39,6 +39,10 @@ export function onVisible<T extends Element>(
}).observe(element) }).observe(element)
} }
export function capitalizeFirstLetter(str: string): string {
return str.charAt(0).toUpperCase() + str.slice(1)
}
export async function loadGsap(): Promise<[typeof gsap, typeof Power3]> { export async function loadGsap(): Promise<[typeof gsap, typeof Power3]> {
const g = await import('gsap') const g = await import('gsap')
return [g.gsap, g.Power3] return [g.gsap, g.Power3]