- update safe checking for string util

- remove required for threshold in joi
-  refine if logic and update no error checking with values due to the change to set null instead of delete error entry
- move customthreshold component to under create infrastructure folder
- correct interval setting and threshold default value and fix typo
This commit is contained in:
Shemy Gan committed 2024-11-15 14:49:27 -05:00
1 parent c3859c7507
commit 2f8638cf04
5 files changed
+29 -24

No files matched your search

+12 -3
View File
@@ -3,6 +3,15 @@
* @param {string} str String whose first letter is to be capitalized
* @returns A string with first letter capitalized
*/
export const capitalizeFirstLetter = (str) =>{
return str?.charAt(0).toUpperCase() + str.slice(1);
}
export const capitalizeFirstLetter = (str) => {
if (str === null || str === undefined) {
return "";
}
if (typeof str !== "string") {
throw new TypeError("Input must be a string");
}
if (str.length === 0) {
return "";
}
return str.charAt(0).toUpperCase() + str.slice(1);
};