mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-30 18:13:23 +08:00
Relax type of capitalizeFirstLetter utility
This commit is contained in:
@@ -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", () => {
|
||||
|
||||
@@ -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 "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user