add capitalizeFirstLetter utility
This commit is contained in:
@@ -31,7 +31,8 @@ export {
|
||||
type IconDef,
|
||||
getLabel,
|
||||
getValue,
|
||||
defaultIconProps
|
||||
defaultIconProps,
|
||||
capitalizeFirstLetter
|
||||
} from './util';
|
||||
export {
|
||||
type ToolbarToggleState,
|
||||
|
||||
@@ -87,3 +87,9 @@ export function targetMust<T extends HTMLElement>(event: Event): T {
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
/** capitalizeFirstLetter capitalizes the first letter of a string */
|
||||
export const capitalizeFirstLetter = (str: string): string => {
|
||||
const lower = str.toLowerCase();
|
||||
return lower.charAt(0).toUpperCase() + lower.slice(1);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user