Relax type of capitalizeFirstLetter utility

This commit is contained in:
guerler
2026-03-24 12:22:29 +03:00
parent cf8c453531
commit d8fdec5f97
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ describe("capitalizeFirstLetter", () => {
});
it("returns empty string for undefined input", () => {
expect(capitalizeFirstLetter(undefined as unknown as string)).toBe("");
expect(capitalizeFirstLetter(undefined)).toBe("");
});
it("returns empty string for null input", () => {
+1 -1
View File
@@ -45,7 +45,7 @@ export function snakeCaseToTitleCase(str: string): string {
/**
* Capitalize the first letter of a string
*/
export function capitalizeFirstLetter(str: string): string {
export function capitalizeFirstLetter(str?: string): string {
if (!str) {
return "";
}