ohctechv3/.svn/pristine/cc/cc4f5af3493a4387f7523d8b46eccd886f50fb77.svn-base
2024-10-28 15:03:36 +05:30

11 lines
583 B
Plaintext

import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.
//
// A strict capitalization should uppercase the first letter of each word in the sentence.
// We only handle the first word.
export default function capitalize(string) {
if (typeof string !== 'string') {
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: `capitalize(string)` expects a string argument." : _formatMuiErrorMessage(7));
}
return string.charAt(0).toUpperCase() + string.slice(1);
}