Skip to content

Commit 36c632b

Browse files
committed
Update ucFirst function
1 parent 64b0417 commit 36c632b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/helpers/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ export function shortString(value: string, limit = 3) {
1616
}
1717

1818
export function ucFirst(value: string) {
19-
return `${value[0].toUpperCase()}${value.slice(1, value.length)}`;
19+
return `${(value[0] || "").toUpperCase()}${(value || "").slice(1, value.length)}`;
2020
}

0 commit comments

Comments
 (0)