From 9ce59084f559b5a3bfefaec57f6b9cbfc5c03fae Mon Sep 17 00:00:00 2001 From: Gandhi V Date: Thu, 11 Aug 2022 22:00:32 -0500 Subject: [PATCH] Merge with latest code base and add capitalize strings --- util/load-profiles.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/load-profiles.ts b/util/load-profiles.ts index 513ddf2a..82a53766 100644 --- a/util/load-profiles.ts +++ b/util/load-profiles.ts @@ -15,6 +15,9 @@ export const loadProfiles = () => { fs.readFileSync(`${path.join(process.cwd(), "data", file)}`, "utf8"), ); + data.name = capitalizeStrings(data.name); + data.goal = capitalizeStrings(data.goal); + return { username: file.split(".")[0], ...data, @@ -48,3 +51,7 @@ export const loadSingleProfile = (username) => { ...profile, }; }; + +function capitalizeStrings(str:String){ + return str.charAt(0).toUpperCase() + str.slice(1); +} \ No newline at end of file