mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-13 01:48:33 +00:00
21 lines
513 B
TypeScript
21 lines
513 B
TypeScript
export function capitalizeFirstLetter(str?: string | null) {
|
|
if (!str) {
|
|
return undefined;
|
|
}
|
|
return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
|
|
}
|
|
|
|
export function lowerFirstLetter(str?: string | null) {
|
|
if (!str) {
|
|
return undefined;
|
|
}
|
|
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
}
|
|
|
|
export function capitalizeFirstLetterOnly(str?: string | null) {
|
|
if (!str) {
|
|
return undefined;
|
|
}
|
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
}
|