fix(Strings/capitalize): error occuring when passing empty string

This commit is contained in:
Aminejv 2021-09-24 18:16:03 +01:00
parent 5c4d723296
commit 4d8514b4dc

View File

@ -335,4 +335,4 @@ export const createSlug = (text, base = "untitled") => {
return text;
};
export const capitalize = (str = "") => str[0].toUpperCase() + str.slice(1);
export const capitalize = (str = "") => str[0]?.toUpperCase() + str?.slice(1);